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

mozilla / relman-auto-nag / #4077

pending completion
#4077

push

coveralls-python

suhaibmujahid
Merge remote-tracking branch 'upstream/master' into wiki-missed

549 of 3109 branches covered (17.66%)

615 of 615 new or added lines in 27 files covered. (100.0%)

1773 of 8016 relevant lines covered (22.12%)

0.22 hits per line

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

0.0
/auto_nag/scripts/fuzz_blockers.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 auto_nag import utils
×
6
from auto_nag.bzcleaner import BzCleaner
×
7
from auto_nag.constants import LOW_SEVERITY
×
8
from auto_nag.history import History
×
9
from auto_nag.nag_me import Nag
×
10

11

12
class FuzzBlockers(BzCleaner, Nag):
×
13
    def __init__(self, waiting_days: int = 3):
×
14
        """Constructor
15

16
        Args:
17
            waiting_days: number of days to wait after the bug creation before
18
                starting to nag.
19
        """
20
        super().__init__()
×
21

22
        self.waiting_days = waiting_days
×
23

24
    def description(self):
×
25
        return "Bugs that prevent fuzzing from making progress"
×
26

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

30
    def set_people_to_nag(self, bug, buginfo):
×
31
        persons = [
×
32
            bug["assigned_to"],
33
            bug["triage_owner"],
34
        ]
35
        if not self.add(persons, buginfo):
×
36
            self.add_no_manager(buginfo["id"])
×
37

38
        return bug
×
39

40
    def get_mail_to_auto_ni(self, bug):
×
41
        if bug["severity"] in LOW_SEVERITY and not self._is_commented(bug):
×
42
            return utils.get_mail_to_ni(bug)
×
43

44
    @staticmethod
×
45
    def _is_commented(bug: dict) -> bool:
×
46
        """Get whether the bug has a previous comment by this tool"""
47
        for comment in reversed(bug["comments"]):
×
48
            if comment["creator"] == History.BOT and comment["raw_text"].startswith(
×
49
                "This bug prevents fuzzing from making progress"
50
            ):
51
                return True
×
52

53
        return False
×
54

55
    def get_bz_params(self, date):
×
56
        fields = [
×
57
            "triage_owner",
58
            "assigned_to",
59
            "severity",
60
            "comments.raw_text",
61
            "comments.creator",
62
        ]
63
        return {
×
64
            "include_fields": fields,
65
            "bug_status": ["UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED"],
66
            "f1": "status_whiteboard",
67
            "o1": "substring",
68
            "v1": "[fuzzblocker]",
69
            "f2": "creation_ts",
70
            "o2": "lessthaneq",
71
            "v2": f"-{self.waiting_days}d",
72
            "f3": "keywords",
73
            "o3": "nowords",
74
            "v3": "stalled",
75
        }
76

77

78
if __name__ == "__main__":
×
79
    FuzzBlockers().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