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

mozilla / relman-auto-nag / #4848

07 Dec 2023 02:35PM UTC 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/workflow/p2_no_activity.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 dateutil.relativedelta import relativedelta
×
6
from libmozdata import utils as lmdutils
×
7

8
from bugbot import utils
×
9
from bugbot.bzcleaner import BzCleaner
×
10
from bugbot.escalation import Escalation
×
11
from bugbot.nag_me import Nag
×
12

13

14
class P2NoActivity(BzCleaner, Nag):
×
15
    def __init__(self):
×
16
        super(P2NoActivity, self).__init__()
×
17
        self.nmonths = utils.get_config(self.name(), "months_lookup", 3)
×
18
        self.escalation = Escalation(
×
19
            self.people,
20
            data=utils.get_config(self.name(), "escalation"),
21
            skiplist=utils.get_config("workflow", "supervisor_skiplist", []),
22
        )
23

24
    def description(self):
×
25
        return "P2 bugs without activity for {} months".format(self.nmonths)
×
26

27
    def nag_template(self):
×
28
        return self.template()
×
29

30
    def get_extra_for_template(self):
×
31
        return {"nmonths": self.nmonths}
×
32

33
    def get_extra_for_nag_template(self):
×
34
        return self.get_extra_for_template()
×
35

36
    def ignore_meta(self):
×
37
        return True
×
38

39
    def has_last_comment_time(self):
×
40
        return True
×
41

42
    def has_product_component(self):
×
43
        return True
×
44

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

48
    def set_people_to_nag(self, bug, buginfo):
×
49
        priority = "default"
×
50
        if not self.filter_bug(priority):
×
51
            return None
×
52

53
        # check if the product::component is in the list
54
        if not utils.check_product_component(self.components, bug):
×
55
            return None
×
56

57
        owner = bug["triage_owner"]
×
58
        self.add_triage_owner(owner, utils.get_config("workflow", "components"))
×
59
        if not self.add(owner, buginfo, priority=priority):
×
60
            self.add_no_manager(buginfo["id"])
×
61
        return bug
×
62

63
    def get_bz_params(self, date):
×
64
        date = lmdutils.get_date_ymd(date)
×
65
        start_date = date - relativedelta(months=self.nmonths)
×
66
        days = (date - start_date).days
×
67
        fields = ["triage_owner"]
×
68
        self.components = utils.get_config("workflow", "components")
×
69
        params = {
×
70
            "include_fields": fields,
71
            "bug_type": "defect",
72
            "component": utils.get_components(self.components),
73
            "resolution": "---",
74
            "f1": "priority",
75
            "o1": "equals",
76
            "v1": "P2",
77
            "f2": "days_elapsed",
78
            "o2": "greaterthaneq",
79
            "v2": days,
80
        }
81
        return params
×
82

83

84
if __name__ == "__main__":
×
85
    P2NoActivity().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