Skip to content

Commit c0a848d

Browse files
authored
Small improvements on the lot/several rules (#2313)
1 parent e30cca8 commit c0a848d

13 files changed

+46
-21
lines changed

bugbot/rules/lot_of_cc.py bugbot/rules/several_cc.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,28 @@ def has_product_component(self):
1919
return True
2020

2121
def columns(self):
22-
return ["id", "product", "component", "summary", "creation", "last_change"]
22+
return [
23+
"id",
24+
"product",
25+
"component",
26+
"summary",
27+
"creation",
28+
"last_change",
29+
"cc_count",
30+
]
2331

2432
def handle_bug(self, bug, data):
2533
bugid = str(bug["id"])
2634
data[bugid] = {
2735
"creation": utils.get_human_lag(bug["creation_time"]),
2836
"last_change": utils.get_human_lag(bug["last_change_time"]),
37+
"cc_count": len(bug["cc"]),
2938
}
3039
return bug
3140

3241
def get_bz_params(self, date):
3342
params = {
34-
"include_fields": ["creation_time", "last_change_time"],
43+
"include_fields": ["creation_time", "last_change_time", "cc"],
3544
"resolution": "---",
3645
"f1": "days_elapsed",
3746
"o1": "lessthan",
File renamed without changes.

bugbot/rules/several_dups.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,20 @@ def description(self):
1616
return "Bugs with several dups for the last {} weeks".format(self.nweeks)
1717

1818
def columns(self):
19-
return ["id", "summary", "creation", "last_change"]
19+
return ["id", "summary", "creation", "last_change", "dupe_count"]
2020

2121
def handle_bug(self, bug, data):
2222
bugid = str(bug["id"])
2323
data[bugid] = {
2424
"creation": utils.get_human_lag(bug["creation_time"]),
2525
"last_change": utils.get_human_lag(bug["last_change_time"]),
26+
"dupe_count": len(bug["duplicates"]),
2627
}
2728
return bug
2829

2930
def get_bz_params(self, date):
3031
params = {
31-
"include_fields": ["creation_time", "last_change_time"],
32+
"include_fields": ["creation_time", "last_change_time", "duplicates"],
3233
"resolution": "---",
3334
"f1": "days_elapsed",
3435
"o1": "lessthan",
File renamed without changes.

bugbot/rules/lot_of_votes.py bugbot/rules/several_votes.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,28 @@ def has_product_component(self):
1919
return True
2020

2121
def columns(self):
22-
return ["id", "product", "component", "summary", "creation", "last_change"]
22+
return [
23+
"id",
24+
"product",
25+
"component",
26+
"summary",
27+
"creation",
28+
"last_change",
29+
"votes",
30+
]
2331

2432
def handle_bug(self, bug, data):
2533
bugid = str(bug["id"])
2634
data[bugid] = {
2735
"creation": utils.get_human_lag(bug["creation_time"]),
2836
"last_change": utils.get_human_lag(bug["last_change_time"]),
37+
"votes": bug["votes"],
2938
}
3039
return bug
3140

3241
def get_bz_params(self, date):
3342
params = {
34-
"include_fields": ["creation_time", "last_change_time"],
43+
"include_fields": ["creation_time", "last_change_time", "votes"],
3544
"resolution": "---",
3645
"f1": "days_elapsed",
3746
"o1": "lessthan",

configs/rules.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,23 +157,23 @@
157157
"additional_receivers": "rm",
158158
"must_run": ["Mon"]
159159
},
160-
"lot_of_votes": {
160+
"several_votes": {
161161
"weeks_lookup": 3,
162162
"number_votes": 10,
163163
"additional_receivers": "rm",
164164
"must_run": ["Mon"]
165165
},
166-
"lot_of_cc": {
166+
"several_cc": {
167167
"weeks_lookup": 3,
168168
"number_cc": 50,
169169
"additional_receivers": "rm",
170170
"must_run": ["Mon"]
171171
},
172-
"lot_of_comments": {
172+
"several_comments": {
173173
"additional_receivers": "rm",
174174
"must_run": ["Mon"]
175175
},
176-
"lot_of_see_also": {
176+
"several_see_also": {
177177
"additional_receivers": "rm",
178178
"must_run": ["Mon"]
179179
},

scripts/check_rules_on_wiki.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class CheckWikiPage:
4545
"multi_nag.py",
4646
"multifix_regression.py",
4747
"several_dups.py",
48-
"lot_of_votes.py",
49-
"lot_of_cc.py",
50-
"lot_of_comments.py",
51-
"lot_of_see_also.py",
48+
"several_votes.py",
49+
"several_cc.py",
50+
"several_comments.py",
51+
"several_see_also.py",
5252
"pdfjs_tag_change.py",
5353
"pdfjs_update.py",
5454
"leave_open_sec.py",

scripts/cron_run_weekdays.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@ python -m bugbot.rules.meta_defect --production
7777
python -m bugbot.rules.several_dups --production
7878

7979
# Bugs with a lot of cc
80-
python -m bugbot.rules.lot_of_cc --production
80+
python -m bugbot.rules.several_cc --production
8181

8282
# Bugs with a lot of votes
83-
python -m bugbot.rules.lot_of_votes --production
83+
python -m bugbot.rules.several_votes --production
8484

8585
# Bugs with a lot of comments
86-
python -m bugbot.rules.lot_of_comments --production
86+
python -m bugbot.rules.several_comments --production
8787

8888
# Bugs with a lot of see also
89-
python -m bugbot.rules.lot_of_see_also --production
89+
python -m bugbot.rules.several_see_also --production
9090

9191
# Bug caused several regressions recently reported
9292
# Pretty rare

templates/lot_of_cc.html templates/several_cc.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
<th>Summary</th>
88
<th>Creation</th>
99
<th>Last comment</th>
10+
<th># of cc</th>
1011
</tr>
1112
</thead>
1213
<tbody>
13-
{% for i, (bugid, product, component, summary, creation, last_change) in enumerate(data) -%}
14+
{% for i, (bugid, product, component, summary, creation, last_change, cc_count) in enumerate(data) -%}
1415
<tr {% if i % 2 == 0 %}bgcolor="#E0E0E0"
1516
{% endif -%}
1617
>
@@ -21,6 +22,7 @@
2122
<td>{{ summary | e }}</td>
2223
<td>{{ creation }}</td>
2324
<td>{{ last_change }}</td>
25+
<td>{{ cc_count }}</td>
2426
</tr>
2527
{% endfor -%}
2628
</tbody>
File renamed without changes.

templates/several_dups.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
<th>Summary</th>
77
<th>Creation</th>
88
<th>Last comment</th>
9+
<th># of dupes</th>
910
</tr>
1011
</thead>
1112
<tbody>
12-
{% for i, (bugid, summary, creation, last_change) in enumerate(data) -%}
13+
{% for i, (bugid, summary, creation, last_change, dupe_count) in enumerate(data) -%}
1314
<tr {% if i % 2 == 0 %}bgcolor="#E0E0E0"
1415
{% endif -%}
1516
>
@@ -19,6 +20,7 @@
1920
<td>{{ summary | e }}</td>
2021
<td>{{ creation }}</td>
2122
<td>{{ last_change }}</td>
23+
<td>{{ dupe_count }}</td>
2224
</tr>
2325
{% endfor -%}
2426
</tbody>
File renamed without changes.

templates/lot_of_votes.html templates/several_votes.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
<th>Summary</th>
88
<th>Creation</th>
99
<th>Last comment</th>
10+
<th># of votes</th>
1011
</tr>
1112
</thead>
1213
<tbody>
13-
{% for i, (bugid, product, component, summary, creation, last_change) in enumerate(data) -%}
14+
{% for i, (bugid, product, component, summary, creation, last_change, votes) in enumerate(data) -%}
1415
<tr {% if i % 2 == 0 %}bgcolor="#E0E0E0"
1516
{% endif -%}
1617
>
@@ -21,6 +22,7 @@
2122
<td>{{ summary | e }}</td>
2223
<td>{{ creation }}</td>
2324
<td>{{ last_change }}</td>
25+
<td>{{ votes }}</td>
2426
</tr>
2527
{% endfor -%}
2628
</tbody>

0 commit comments

Comments
 (0)