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

mozilla / relman-auto-nag / #4851

12 Dec 2023 12:52PM CUT coverage: 21.877% (-0.009%) from 21.886%
#4851

push

coveralls-python

sylvestre
lot_of_*: add product::components

716 of 3590 branches covered (0.0%)

0 of 12 new or added lines in 4 files covered. (0.0%)

1925 of 8799 relevant lines covered (21.88%)

0.22 hits per line

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

0.0
/bugbot/rules/lot_of_comments.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 SeveralComments(BzCleaner):
×
10
    def __init__(self, nweeks: int = 52, comments: int = 50):
×
11
        """Constructor
12

13
        Args:
14
            nweeks: the maximum number of weeks from the submission date
15
            comments: the number of comments in the bug
16
        """
17
        super().__init__()
×
18
        self.nweeks = nweeks
×
19
        self.comments = comments
×
20

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

NEW
24
    def has_product_component(self):
×
NEW
25
        return True
×
26

27
    def columns(self):
×
NEW
28
        return [
×
29
            "id",
30
            "product",
31
            "component",
32
            "summary",
33
            "creation",
34
            "last_change",
35
            "comment_count",
36
        ]
37

38
    def handle_bug(self, bug, data):
×
39
        bugid = str(bug["id"])
×
40
        comment_count = bug["comment_count"]
×
41

42
        data[bugid] = {
×
43
            "creation": utils.get_human_lag(bug["creation_time"]),
44
            "last_change": utils.get_human_lag(bug["last_change_time"]),
45
            "comment_count": comment_count,
46
        }
47
        return bug
×
48

49
    def get_bz_params(self, date):
×
50
        return {
×
51
            "include_fields": ["creation_time", "last_change_time", "comment_count"],
52
            "resolution": "---",
53
            "f1": "days_elapsed",
54
            "o1": "lessthan",
55
            "v1": self.nweeks * 7,
56
            "f2": "longdescs.count",
57
            "o2": "greaterthaneq",
58
            "v2": self.comments,
59
            "f3": "keywords",
60
            "o3": "nowords",
61
            "v3": ["meta", "intermittent"],
62
        }
63

64

65
if __name__ == "__main__":
×
66
    SeveralComments().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