Skip to content

Commit 8e170b4

Browse files
Merge pull request #131 from ricky-rav/totalbugscount
NO-JIRA: Add real total line to the bug ranking
2 parents 08ee887 + ccec65c commit 8e170b4

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

jira-scripts/network_bugs_overview

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ def print_results(developers, stale_bugs, print_stale_bugs=False, quick=False):
960960

961961

962962

963-
def add_extra_line(lines, new_data, new_data_name, quick=False):
963+
def prepare_extra_line(new_data, new_data_name, quick=False):
964964
if new_data:
965965
new_line = [
966966
"",
@@ -978,9 +978,7 @@ def add_extra_line(lines, new_data, new_data_name, quick=False):
978978
# last but one column is for recently assigned, keep last column is for total
979979
new_line.insert(-1, None)
980980

981-
lines.append(new_line)
982-
return lines
983-
981+
return new_line
984982

985983
def print_summary_table(developers, quick=False):
986984
# Remove external devs from the count
@@ -1033,27 +1031,42 @@ def print_summary_table(developers, quick=False):
10331031
new_line.insert(-1, v["recently_assigned"])
10341032
lines.append(new_line)
10351033

1036-
1037-
# add a "total" line
10381034
lines.append(SEPARATING_LINE)
10391035

1036+
# add summary lines (total bugs for the team, for external team members, for sdn team bot)
10401037
num = sum(ordered_by_points[dev]["number_of_bugs"] for dev in ordered_by_points)
10411038
num_new = sum(ordered_by_points[dev]["bugs_in_new"] for dev in ordered_by_points)
10421039
num_assigned = sum(ordered_by_points[dev]["bugs_in_assigned"] for dev in ordered_by_points)
10431040
num_post = sum(ordered_by_points[dev]["bugs_in_post"] for dev in ordered_by_points)
10441041
num_backports = sum(ordered_by_points[dev]["backport_bugs"] for dev in ordered_by_points)
10451042
num_scan = sum(ordered_by_points[dev]["scan_bugs"] for dev in ordered_by_points)
1046-
num_total = num + num_backports + num_scan
1047-
total_line = ["", "TOTAL", None, num, num_new, num_assigned, num_post, num_backports, num_scan, num_total]
1043+
num_team = num + num_backports + num_scan
1044+
team_line = ["", "team", None, num, num_new, num_assigned, num_post, num_backports, num_scan, num_team]
10481045
if not quick:
10491046
num_recently_assigned = sum(ordered_by_points[dev]["recently_assigned"] for dev in ordered_by_points)
1050-
total_line.insert(-1, num_recently_assigned)
1051-
1052-
lines.append(total_line)
1047+
team_line.insert(-1, num_recently_assigned)
10531048

1054-
lines = add_extra_line(lines, external_data, "external", quick=quick)
1055-
lines = add_extra_line(lines, sdn_team_bot_data, "sdn-team-bot", quick=quick)
1049+
external_line = prepare_extra_line(external_data, "external", quick=quick)
1050+
bot_line = prepare_extra_line(sdn_team_bot_data, "sdn-team-bot", quick=quick)
10561051

1052+
# add total line (team + external + bot)
1053+
total_line = ["", "TOTAL", None]
1054+
for i in range(3, len(team_line)):
1055+
if i < len(external_line) and i < len(bot_line):
1056+
try:
1057+
total_val = team_line[i] + external_line[i] + bot_line[i]
1058+
except:
1059+
# not an int, just add a blank
1060+
total_val = None
1061+
1062+
total_line.append(total_val)
1063+
1064+
lines.append(team_line)
1065+
lines.append(external_line)
1066+
lines.append(bot_line)
1067+
lines.append(SEPARATING_LINE)
1068+
lines.append(total_line)
1069+
10571070
print(tabulate(lines, headers=headers))
10581071

10591072
explanation_message = """

0 commit comments

Comments
 (0)