• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / relman-auto-nag / #5255

11 Oct 2024 03:14PM UTC coverage: 21.55% (-0.1%) from 21.646%
#5255

push

coveralls-python

jgraham
Add a rule to sync [webcompat:sightline] whiteboard entry

This should be set on all bugs that are part of the webcompat metrics
set, and by no bugs that aren't.

This initial approach just gets all the bugs that are either in that
set or have the whiteboard entry, and implements the logic to update
them in the client. Given that we expect initially to have ~700 bugs
in that set, this means we need to set the maximum number of bugs to
update to something rather high.

426 of 2886 branches covered (14.76%)

0 of 54 new or added lines in 3 files covered. (0.0%)

12 existing lines in 1 file now uncovered.

1941 of 9007 relevant lines covered (21.55%)

0.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/bugbot/rules/webcompat_platform_without_keyword.py
1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
# You can obtain one at http://mozilla.org/MPL/2.0/.
4

NEW
5
from bugbot import gcp
×
UNCOV
6
from bugbot.bzcleaner import BzCleaner
×
7

8

UNCOV
9
class WebcompatPlatformWithoutKeyword(BzCleaner):
×
10
    normal_changes_max = 200
×
11

UNCOV
12
    def description(self):
×
13
        return "Web Compat platform bugs without webcompat:platform-bug keyword"
×
14

UNCOV
15
    def filter_no_nag_keyword(self):
×
16
        return False
×
17

UNCOV
18
    def has_default_products(self):
×
19
        return False
×
20

21
    def get_autofix_change(self):
×
UNCOV
22
        return {
×
23
            "keywords": {"add": ["webcompat:platform-bug"]},
24
        }
25

26
    def get_bz_params(self, date):
×
UNCOV
27
        fields = ["id", "summary", "keywords"]
×
28
        return {"include_fields": fields, "id": self.get_core_bug_ids()}
×
29

30
    def get_core_bug_ids(self):
×
UNCOV
31
        project = "moz-fx-dev-dschubert-wckb"
×
32
        dataset = "webcompat_knowledge_base"
×
33

NEW
34
        client = gcp.get_client(project, ["cloud-platform", "drive"])
×
UNCOV
35
        query = f"""
×
36
        SELECT core_bug FROM `{project}.{dataset}.prioritized_kb_entries` as kb_entries
37
        JOIN `moz-fx-dev-dschubert-wckb.webcompat_knowledge_base.bugzilla_bugs` as bugzilla_bugs ON bugzilla_bugs.number = kb_entries.core_bug
38
        WHERE "webcompat:platform-bug" not in UNNEST(bugzilla_bugs.keywords)
39
        LIMIT {self.normal_changes_max}
40
        """
41

UNCOV
42
        return list(row["core_bug"] for row in client.query(query).result())
×
43

44

UNCOV
45
if __name__ == "__main__":
×
UNCOV
46
    WebcompatPlatformWithoutKeyword().run()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc