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

mozilla / relman-auto-nag / #5623

02 Oct 2025 09:44PM UTC coverage: 20.699% (-0.1%) from 20.81%
#5623

push

coveralls-python

marco-c
Notify managers and release managers when there is a needinfo on a top crash without activity for a week

Fixes #2723

426 of 3034 branches covered (14.04%)

0 of 45 new or added lines in 1 file covered. (0.0%)

1 existing line in 1 file now uncovered.

1942 of 9382 relevant lines covered (20.7%)

0.21 hits per line

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

0.0
/bugbot/rules/topcrash_notify.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 utils
×
NEW
6
from bugbot.bzcleaner import BzCleaner
×
NEW
7
from bugbot.nag_me import Nag
×
8

9

NEW
10
class TopcrashNotify(BzCleaner, Nag):
×
NEW
11
    def __init__(self):
×
NEW
12
        super(TopcrashNotify, self).__init__()
×
NEW
13
        self.nweeks = utils.get_config(self.name(), "number_of_weeks", 1)
×
14

NEW
15
    def description(self):
×
NEW
16
        return "Bugs with a ni on a bug with topcrash keyword without activity for the last {} {}".format(
×
17
            self.nweeks, utils.plural("week", self.nweeks)
18
        )
19

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

NEW
23
    def get_extra_for_nag_template(self):
×
NEW
24
        return self.get_extra_for_template()
×
25

NEW
26
    def has_last_comment_time(self):
×
NEW
27
        return True
×
28

NEW
29
    def has_needinfo(self):
×
NEW
30
        return True
×
31

NEW
32
    def columns(self):
×
NEW
33
        return ["id", "summary", "needinfos", "last_comment"]
×
34

NEW
35
    def columns_nag(self):
×
NEW
36
        return ["id", "summary", "to", "from", "last_comment"]
×
37

NEW
38
    def get_priority(self, bug):
×
NEW
39
        return "normal"
×
40

NEW
41
    def set_people_to_nag(self, bug, buginfo):
×
NEW
42
        priority = self.get_priority(bug)
×
NEW
43
        if not self.filter_bug(priority):
×
NEW
44
            return None
×
45

NEW
46
        has_manager = False
×
NEW
47
        for flag in bug["flags"]:
×
NEW
48
            if flag.get("name", "") == "needinfo" and flag["status"] == "?":
×
NEW
49
                requestee = flag["requestee"]
×
NEW
50
                buginfo["to"] = requestee
×
NEW
51
                moz_name = self.get_people().get_moz_name(flag["setter"])
×
NEW
52
                buginfo["from"] = moz_name if moz_name is not None else flag["setter"]
×
NEW
53
                if self.add(requestee, buginfo, priority=priority):
×
NEW
54
                    has_manager = True
×
55

NEW
56
        if not has_manager:
×
NEW
57
            self.add_no_manager(buginfo["id"])
×
58

NEW
59
        return bug
×
60

NEW
61
    def get_bz_params(self, date):
×
NEW
62
        fields = ["flags", "_custom"]
×
NEW
63
        params = {
×
64
            "include_fields": fields,
65
            "resolution": "---",
66
            "f1": "days_elapsed",
67
            "o1": "greaterthan",
68
            "v1": self.nweeks * 7,
69
            "f2": "flagtypes.name",
70
            "o2": "casesubstring",
71
            "v2": "needinfo?",
72
            "f3": "keywords",
73
            "o3": "anyexact",
74
            "v3": ["topcrash", "topcrash-startup"],
75
        }
76

NEW
77
        return params
×
78

79

NEW
80
if __name__ == "__main__":
×
NEW
81
    TopcrashNotify().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