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

mozilla / relman-auto-nag / #5256

11 Oct 2024 06:43PM UTC coverage: 21.646% (+0.1%) from 21.55%
#5256

push

coveralls-python

web-flow
Readded tox.ini

426 of 2878 branches covered (14.8%)

1941 of 8967 relevant lines covered (21.65%)

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

5
from libmozdata.bugzilla import Bugzilla
×
6

7
from bugbot.bzcleaner import BzCleaner
×
8

9

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

13
    def description(self):
×
14
        return "Core bugs blocking webcompat knowledge base entries without webcompat:platform-bug"
×
15

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

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

22
    def handle_bug(self, bug, data):
×
23
        data[bug["id"]] = {"depends_on": set(bug.get("depends_on", []))}
×
24
        return bug
×
25

26
    def get_core_bugs(self, bugs):
×
27
        core_bugs = set()
×
28
        for bug_data in bugs.values():
×
29
            core_bugs |= bug_data.get("depends_on", set())
×
30

31
        def bug_handler(bug, data):
×
32
            if "webcompat:platform-bug" not in bug["keywords"]:
×
33
                data[bug["id"]] = bug
×
34

35
        core_bug_data = {}
×
36

37
        Bugzilla(
×
38
            bugids=list(core_bugs),
39
            include_fields=["id", "summary", "keywords"],
40
            bughandler=bug_handler,
41
            bugdata=core_bug_data,
42
        ).get_data().wait()
43

44
        return core_bug_data
×
45

46
    def get_autofix_change(self):
×
47
        return {
×
48
            "keywords": {"add": ["webcompat:platform-bug"]},
49
        }
50

51
    def get_bz_params(self, date):
×
52
        fields = [
×
53
            "id",
54
            "depends_on",
55
        ]
56
        params = {
×
57
            "include_fields": fields,
58
            "product": "Web Compatibility",
59
            "component": "Knowledge Base",
60
        }
61

62
        return params
×
63

64
    def get_bugs(self, *args, **kwargs):
×
65
        bugs = super().get_bugs(*args, **kwargs)
×
66
        bugs = self.get_core_bugs(bugs)
×
67
        return bugs
×
68

69

70
if __name__ == "__main__":
×
71
    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