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

mozilla / relman-auto-nag / #4562

pending completion
#4562

push

coveralls-python

suhaibmujahid
[no_severity] Re-enable for bugs imported by Move to Bugzilla add-on

This reverts commit d86f8a9a1.

641 of 3222 branches covered (19.89%)

1821 of 8004 relevant lines covered (22.75%)

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

8
HIGH_SECURITY_KEYWORDS = ["sec-high", "sec-critical"]
×
9

10

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

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

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

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

32
        return bug
×
33

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

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

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

46
        return None
×
47

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

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

66
        return params
×
67

68

69
if __name__ == "__main__":
×
70
    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