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

mozilla / relman-auto-nag / #5224

06 Sep 2024 06:20PM CUT coverage: 21.635%. Remained the same
#5224

push

coveralls-python

web-flow
[severity_high_security] Exclude cases where the feature is disabled on release (#2474)


Co-authored-by: Suhaib Mujahid <suhaibmujahid@gmail.com>

585 of 3508 branches covered (16.68%)

1940 of 8967 relevant lines covered (21.63%)

0.22 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
            "n5": 1,
60
            "f5": "cf_status_firefox_release",
61
            "o5": "equals",
62
            "v5": "disabled",
63
            "n15": 1,
64
            "f15": "longdesc",
65
            "o15": "casesubstring",
66
            "v15": "could you consider increasing the severity of this security bug?",
67
        }
68

69
        return params
×
70

71

72
if __name__ == "__main__":
×
73
    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