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

mozilla / relman-auto-nag / #4840

05 Dec 2023 03:58PM CUT coverage: 21.889% (-0.05%) from 21.936%
#4840

push

coveralls-python

web-flow
Apply suggestions from code review

716 of 3590 branches covered (0.0%)

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

12 existing lines in 1 file now uncovered.

1924 of 8790 relevant lines covered (21.89%)

0.22 hits per line

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

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

9
class SeveralSeeAlso(BzCleaner):
×
10
    def __init__(self, nweeks: int = 52, min_see_also: int = 5):
×
11
        """Constructor
12

13
        Args:
14
            nweeks: the maximum number of weeks since the bug was last updated
15
            min_see_also: the minimum number of 'see also' in the bug
16
        """
17
        super().__init__()
×
18
        self.nweeks = nweeks
×
NEW
19
        self.min_see_also = min_see_also
×
20

21
    def description(self):
×
22
        return "Bugs with several see_also for the last {} weeks".format(self.nweeks)
×
23

24
    def columns(self):
×
25
        return ["id", "summary", "creation", "last_change", "see_also_count"]
×
26

27
    def handle_bug(self, bug, data):
×
28
        bugid = str(bug["id"])
×
29
        see_also_count = len(bug["see_also"])
×
30

31
        data[bugid] = {
×
32
            "creation": utils.get_human_lag(bug["creation_time"]),
33
            "last_change": utils.get_human_lag(bug["last_change_time"]),
34
            "see_also_count": see_also_count,
35
        }
36
        return bug
×
37

38
    def get_bz_params(self, date):
×
39
        return {
×
40
            "include_fields": ["creation_time", "last_change_time", "see_also"],
41
            "resolution": "---",
42
            "f1": "days_elapsed",
43
            "o1": "lessthan",
44
            "v1": self.nweeks * 7,
45
            "f2": "see_also_count",
46
            "o2": "greaterthaneq",
47
            "v2": self.min_see_also,
48
            "f3": "keywords",
49
            "o3": "nowords",
50
            "v3": ["meta", "intermittent"],
51
        }
52

53

54
if __name__ == "__main__":
×
55
    SeveralSeeAlso().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