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

mozilla / relman-auto-nag / #5325

06 Nov 2024 10:53AM CUT coverage: 21.411% (-0.1%) from 21.516%
#5325

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 2902 branches covered (14.68%)

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

1 existing line in 1 file now uncovered.

1942 of 9070 relevant lines covered (21.41%)

0.21 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
×
6
from bugbot.bzcleaner import BzCleaner
×
7

8

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

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

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

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

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

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

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

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

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

45

46
if __name__ == "__main__":
×
47
    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