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

mozilla / relman-auto-nag / #5355

26 Nov 2024 03:53PM CUT coverage: 21.571% (+0.002%) from 21.569%
#5355

push

coveralls-python

benjaminmah
Removed `self.tracking` and changed status to a local variable

426 of 2880 branches covered (14.79%)

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

1941 of 8998 relevant lines covered (21.57%)

0.22 hits per line

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

0.0
/bugbot/rules/pending_sec_no_tracking.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

6
from bugbot import utils
×
7
from bugbot.bzcleaner import BzCleaner
×
8

9

10
class SecurityApprovalTracking(BzCleaner):
×
11
    def __init__(self, channel):
×
12
        super().__init__()
×
13
        self.channel = channel
×
14
        if not self.init_versions():
×
15
            return
×
16

17
        self.version = self.versions[channel] if self.versions else None
×
18

19
        self.extra_ni = None
×
20

21
    def description(self):
×
22
        return "Bugs with attachments pending security approval and incomplete tracking flags"
×
23

24
    def handle_bug(self, bug, data):
×
25
        # Assuming these bugs are bugs that do not have a status flag set to either "affected" or "unaffected"
26
        bugid = str(bug["id"])
×
27
        data[bugid] = {
×
28
            "id": bugid,
29
            "summary": bug["summary"],
30
            "assignee": bug["assigned_to"],
31
        }
32
        self.add_auto_ni(
×
33
            bugid,
34
            {"mail": bug["assigned_to"], "nickname": bug["assigned_to_detail"]["nick"]},
35
        )
36

37
        return bug
×
38

39
    def get_extra_for_needinfo_template(self):
×
40
        return self.extra_ni
×
41

42
    def columns(self):
×
43
        return ["id", "summary", "assignee"]
×
44

45
    def get_bz_params(self, date):
×
46
        start_date, _ = self.get_dates(date)
×
47

NEW
48
        status = utils.get_flag(self.version, "status", self.channel)
×
49
        fields = [
×
50
            "id",
51
            "assigned_to",
52
            "nickname",
53
            "flags",
54
        ]
55

56
        params = {
×
57
            "include_fields": fields,
58
            "resolution": "---",
59
            "f1": "creation_ts",
60
            "o1": "greaterthan",
61
            "v1": start_date,
62
            "f2": status,
63
            "o2": "anywords",
64
            "n2": "1",
65
            "v2": ",".join(["unaffected", "affected"]),
66
            "f3": "flagtypes.name",
67
            "o3": "substring",
68
            "v3": "sec-approval?",
69
        }
70

71
        return params
×
72

73

74
if __name__ == "__main__":
×
75
    SecurityApprovalTracking("beta").run()
×
76
    SecurityApprovalTracking("central").run()
×
77
    SecurityApprovalTracking("esr").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