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

mozilla / relman-auto-nag / #5638

08 Oct 2025 01:12PM UTC coverage: 20.812% (+0.02%) from 20.792%
#5638

push

coveralls-python

marco-c
Remove filters on old-style severity

426 of 3022 branches covered (14.1%)

1943 of 9336 relevant lines covered (20.81%)

0.21 hits per line

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

0.0
/bugbot/rules/close_intermittents.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.bzcleaner import BzCleaner
×
6
from bugbot.components import ComponentName, fetch_component_teams
×
7

8

9
class Intermittents(BzCleaner):
×
10
    normal_changes_max: int = 2100
×
11

12
    def __init__(self):
×
13
        super().__init__()
×
14
        self.component_teams = fetch_component_teams()
×
15

16
    def description(self):
×
17
        return "Intermittent test failure bugs unchanged in 21 days"
×
18

19
    def get_max_actions(self):
×
20
        limit_per_run = 2100
×
21
        limit_per_team = 42
×
22

23
        # Number of teams that have bugs to be autoclosed
24
        number_of_teams = len(self.quota_actions)
×
25

26
        return min([limit_per_run // number_of_teams, limit_per_team])
×
27

28
    def has_product_component(self):
×
29
        return True
×
30

31
    def columns(self):
×
32
        return ["product", "component", "id", "summary"]
×
33

34
    def get_bz_params(self, date):
×
35
        params = {
×
36
            "include_fields": ["_custom", "product", "component"],
37
            "n1": "1",
38
            "f1": "longdescs.count",
39
            "o1": "changedafter",
40
            "v1": "-3w",
41
            "f3": "flagtypes.name",
42
            "o3": "notequals",
43
            "v3": "needinfo?",
44
            "f4": "OP",
45
            "n4": "1",
46
            "f5": "bug_status",
47
            "o5": "changedto",
48
            "v5": "REOPENED",
49
            "f6": "bug_status",
50
            "o6": "changedafter",
51
            "v6": "-7d",
52
            "f7": "CP",
53
            "f8": "bug_severity",
54
            "o8": "notequals",
55
            "v8": "S1",
56
            "f9": "keywords",
57
            "o9": "allwords",
58
            "v9": "intermittent-failure",
59
            "f10": "keywords",
60
            "o10": "nowords",
61
            "v10": "test-verify-fail,test-disabled,topcrash",
62
            "j11": "OR",
63
            "f11": "OP",
64
            "f12": "blocked",
65
            "o12": "isempty",
66
            # We want to include bugs that are blocked by sm-defects-intermittent
67
            # since it is rooting all SpiderMonkey's intermittent failures.
68
            # See https://github.com/mozilla/bugbot/issues/2635
69
            "f13": "blocked",
70
            "o13": "equals",
71
            "v13": 1729503,
72
            "f14": "CP",
73
            "resolution": "---",
74
            "status_whiteboard_type": "notregexp",
75
            "status_whiteboard": "(test disabled|test-disabled|testdisabled)",
76
        }
77

78
        return params
×
79

80
    def handle_bug(self, bug, data):
×
81
        status_flags = {
×
82
            field: "wontfix"
83
            for field, value in bug.items()
84
            if field.startswith("cf_status_") and value in ("affected", "fix-optional")
85
        }
86

87
        autofix = {
×
88
            **status_flags,
89
            "status": "RESOLVED",
90
            "resolution": "INCOMPLETE",
91
            "keywords": {"remove": ["leave-open"]},
92
            "comment": {
93
                "body": f"https://wiki.mozilla.org/Bug_Triage#Intermittent_Test_Failure_Cleanup\n{self.get_documentation()}"
94
            },
95
        }
96

97
        team_name = self.component_teams[ComponentName.from_bug(bug)]
×
98

99
        self.add_prioritized_action(bug, quota_name=team_name, autofix=autofix)
×
100

101
        return bug
×
102

103

104
if __name__ == "__main__":
×
105
    Intermittents().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