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

mozilla / relman-auto-nag / #4559

pending completion
#4559

push

coveralls-python

marco-c
Don't autoclose security bugs where there is a needinfo on an inactive reporter

Fixes #2097

641 of 3223 branches covered (19.89%)

4 of 4 new or added lines in 3 files covered. (100.0%)

1822 of 8006 relevant lines covered (22.76%)

0.23 hits per line

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

0.0
/bugbot/rules/severity_high_security.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 bugbot import utils
×
6
from bugbot.bzcleaner import BzCleaner
×
7
from bugbot.constants import HIGH_SECURITY_KEYWORDS
×
8

9

10
class SeverityHighSecurity(BzCleaner):
×
11
    def description(self):
×
12
        return "Bugs with high security keywords which are set to low severity"
×
13

14
    def has_needinfo(self):
×
15
        return True
×
16

17
    def handle_bug(self, bug, data):
×
18
        security_keywords = [
×
19
            keyword for keyword in bug["keywords"] if keyword in HIGH_SECURITY_KEYWORDS
20
        ]
21
        assert len(security_keywords) == 1
×
22
        security_keyword = security_keywords[0]
×
23

24
        bugid = str(bug["id"])
×
25
        data[bugid] = {
×
26
            "security_keyword": security_keyword,
27
            "severity": bug["severity"],
28
        }
29
        self.extra_ni = data
×
30

31
        return bug
×
32

33
    def get_extra_for_needinfo_template(self):
×
34
        return self.extra_ni
×
35

36
    def columns(self):
×
37
        return ["id", "summary", "severity", "security_keyword"]
×
38

39
    def get_mail_to_auto_ni(self, bug):
×
40
        for field in ["assigned_to", "triage_owner"]:
×
41
            person = bug.get(field, "")
×
42
            if person and not utils.is_no_assignee(person):
×
43
                return {"mail": person, "nickname": bug[f"{field}_detail"]["nick"]}
×
44

45
        return None
×
46

47
    def get_bz_params(self, date):
×
48
        fields = ["triage_owner", "assigned_to", "severity", "keywords"]
×
49

50
        params = {
×
51
            "include_fields": fields,
52
            "resolution": "---",
53
            "f3": "keywords",
54
            "o3": "anyexact",
55
            "v3": HIGH_SECURITY_KEYWORDS,
56
            "f4": "bug_severity",
57
            "o4": "anyexact",
58
            "v4": ["S3", "normal", "S4", "minor", "trivial", "enhancement"],
59
            "n15": 1,
60
            "f15": "longdesc",
61
            "o15": "casesubstring",
62
            "v15": "could you consider increasing the severity of this security bug?",
63
        }
64

65
        return params
×
66

67

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