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

mozilla / relman-auto-nag / #4848

07 Dec 2023 02:35PM CUT coverage: 21.938%. Remained the same
#4848

push

coveralls-python

suhaibmujahid
Use `product::component` to refer to components in all emails

716 of 3588 branches covered (0.0%)

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

1924 of 8770 relevant lines covered (21.94%)

0.22 hits per line

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

0.0
/bugbot/rules/to_triage.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 import utils as lmdutils
×
6

7
from bugbot import logger, utils
×
8
from bugbot.bzcleaner import BzCleaner
×
9
from bugbot.escalation import Escalation
×
10
from bugbot.nag_me import Nag
×
11
from bugbot.round_robin import RoundRobin
×
12
from bugbot.round_robin_calendar import BadFallback, InvalidCalendar
×
13

14

15
class ToTriage(BzCleaner, Nag):
×
16
    def __init__(self):
×
17
        super(ToTriage, self).__init__()
×
18
        self.escalation = Escalation(self.people, data=self.get_config("escalation"))
×
19
        try:
×
20
            self.round_robin = RoundRobin.get_instance(
×
21
                teams=self.get_config("teams", [])
22
            )
23
        except (BadFallback, InvalidCalendar) as err:
×
24
            logger.error(err)
×
25
        self.components = self.round_robin.get_components()
×
26
        for person in self.get_config("persons", []):
×
27
            self.components += utils.get_triage_owners()[person]
×
28

29
    def description(self):
×
30
        return "Bugs to triage"
×
31

32
    def nag_template(self):
×
33
        return self.template()
×
34

35
    def has_default_product(self):
×
36
        return False
×
37

38
    def has_product_component(self):
×
39
        return True
×
40

41
    def ignore_meta(self):
×
42
        return True
×
43

44
    def columns(self):
×
NEW
45
        return ["product", "component", "id", "summary", "type"]
×
46

47
    def columns_nag(self):
×
48
        return self.columns()
×
49

50
    def handle_bug(self, bug, data):
×
51
        # check if the product::component is in the list
52
        if not utils.check_product_component(self.components, bug):
×
53
            return None
×
54

55
        bugid = str(bug["id"])
×
56
        data[bugid] = {"type": bug["type"]}
×
57
        return bug
×
58

59
    def set_people_to_nag(self, bug, buginfo):
×
60
        priority = "default"
×
61
        if not self.filter_bug(priority):
×
62
            return None
×
63

64
        buginfo["type"] = bug["type"]
×
65
        fallback = self.round_robin.get_fallback(bug)
×
66

67
        owners = self.round_robin.get(bug, self.date, only_one=False, has_nick=False)
×
68
        real_owner = bug["triage_owner"]
×
69
        self.add_triage_owner(owners, real_owner=real_owner)
×
70
        if not self.add(owners, buginfo, priority=priority, fallback=fallback):
×
71
            self.add_no_manager(buginfo["id"])
×
72
        return bug
×
73

74
    def get_bz_params(self, date):
×
75
        self.date = lmdutils.get_date_ymd(date)
×
76
        prods, comps = utils.get_products_components(self.components)
×
77
        fields = ["triage_owner", "type"]
×
78
        params = {
×
79
            "include_fields": fields,
80
            "product": list(prods),
81
            "component": list(comps),
82
            "keywords": "intermittent-failure",
83
            "keywords_type": "nowords",
84
            "email2": "wptsync@mozilla.bugs",
85
            "emailreporter2": "1",
86
            "emailtype2": "notequals",
87
            "resolution": "---",
88
            "f1": "bug_type",
89
            "o1": "equals",
90
            "v1": "defect",
91
            "f2": "flagtypes.name",
92
            "o2": "notsubstring",
93
            "v2": "needinfo?",
94
            "f3": "bug_severity",
95
            "o3": "anyexact",
96
            "v3": "--, n/a",
97
        }
98

99
        return params
×
100

101

102
if __name__ == "__main__":
×
103
    ToTriage().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