• 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/p3_p4_p5.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

11

12
class P3P4P5(BzCleaner):
×
13
    def __init__(self):
×
14
        super(P3P4P5, self).__init__()
×
15
        self.nmonths = utils.get_config(self.name(), "months_lookup", 6)
×
16

17
    def description(self):
×
18
        return "P3, P4 or P5 bugs without activity for {} months".format(self.nmonths)
×
19

20
    def get_extra_for_template(self):
×
21
        return {"nmonths": self.nmonths}
×
22

23
    def ignore_meta(self):
×
24
        return True
×
25

26
    def has_product_component(self):
×
27
        return True
×
28

29
    def columns(self):
×
NEW
30
        return ["product", "component", "id", "summary"]
×
31

32
    def handle_bug(self, bug, data):
×
33
        # check if the product::component is in the list
34
        if not utils.check_product_component(self.components, bug):
×
35
            return None
×
36
        return bug
×
37

38
    def get_bz_params(self, date):
×
39
        date = lmdutils.get_date_ymd(date)
×
40
        start_date = date - relativedelta(months=self.nmonths)
×
41
        days = (date - start_date).days
×
42
        self.components = utils.get_config("workflow", "components")
×
43
        params = {
×
44
            "component": utils.get_components(self.components),
45
            "bug_type": "defect",
46
            "resolution": "---",
47
            "f1": "priority",
48
            "o1": "anywordssubstr",
49
            "v1": ",".join(["P3", "P4", "P5"]),
50
            "f2": "days_elapsed",
51
            "o2": "greaterthaneq",
52
            "v2": days,
53
        }
54
        return params
×
55

56
    def get_autofix_change(self):
×
57
        return {
×
58
            "comment": {
59
                "body": "Resolve the bug as INACTIVE since there is no activity for {} months.\nSee [What Do You Triage](https://firefox-source-docs.mozilla.org/bug-mgmt/policies/triage-bugzilla.html#what-do-you-triage) for more information.".format(
60
                    self.nmonths
61
                )
62
            },
63
            "status": "RESOLVED",
64
            "resolution": "INACTIVE",
65
        }
66

67

68
if __name__ == "__main__":
×
69
    P3P4P5().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