forked from RazTamir/bugzilla-reports-tool
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtracking_dashboard.py
134 lines (121 loc) · 4.26 KB
/
tracking_dashboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/env python
import time
from helpers import *
import datetime
now = datetime.datetime.now()
g = gapi.GoogleSpreadSheetAPI(SPREADSHEET_NAME, "QE tracking dashboard")
blockers_list = get_blockers_list()
for idx, bug in enumerate(blockers_list):
row = 6 + idx
column = 2
g.update_sheet(
row,
column,
(
f'=HYPERLINK("https://bugzilla.redhat.com/show_bug'
f'.cgi?id={bug.bug_id}", "{bug.bug_id}")'
)
)
g.update_sheet(row, column+1, bug.summary)
g.update_sheet(row, column+6, bug.status)
g.update_sheet(row, column+7, bug.component)
flags = ''
for flag in bug.flags:
flags += flag.get('name') + flag.get('status') + ' '
g.update_sheet(row, column+8, flags)
g.update_sheet(row, column+9, ' '.join(bug.keywords))
time.sleep(5)
g.clean_rows(2, 6 + len(blockers_list), 25)
# Sleep to ensure no exception will raise from Google API due to writes limit
time.sleep(30)
urgent_list = get_urgent_list()
for idx, bug in enumerate(urgent_list):
row = 28 + idx
column = 2
g.update_sheet(
row,
column,
(
f'=HYPERLINK("https://bugzilla.redhat.com/show_bug'
f'.cgi?id={bug.bug_id}", "{bug.bug_id}")'
)
)
g.update_sheet(row, column+1, bug.summary)
g.update_sheet(row, column+6, bug.status)
g.update_sheet(row, column+7, bug.component)
flags = ''
for flag in bug.flags:
flags += flag.get('name') + flag.get('status') + ' '
g.update_sheet(row, column+8, flags)
g.update_sheet(row, column+9, ' '.join(bug.keywords))
time.sleep(5)
g.clean_rows(2, 28 + len(urgent_list), 38)
# Sleep to ensure no exception will raise from Google API due to writes limit
# deployment_blockers = sort_by_pm_score(get_deployment_blockers())
# for idx, bug in enumerate(deployment_blockers):
# row = 6 + idx
# column = 2
# g.update_sheet(
# row,
# column,
# (
# f'=HYPERLINK("https://bugzilla.redhat.com/show_bug'
# f'.cgi?id={bug.bug_id}", "{bug.bug_id}")'
# )
# )
# g.update_sheet(row, column+1, bug.summary)
# g.update_sheet(row, column+6, bug.status)
# g.update_sheet(row, column+7, bug.component)
# g.update_sheet(row, column+8, bug.severity)
# converted = datetime.datetime.strptime(
# bug.creation_time.value, "%Y%m%dT%H:%M:%S"
# )
# g.update_sheet(row, column + 9, (now - converted).days)
# g.clean_rows(2, 6 + len(deployment_blockers), 15)
# # Sleep to ensure no exception will raise from Google API due to writes limit
# time.sleep(40)
# feature_blockers = sort_by_pm_score(get_feature_blockers())
# for idx, bug in enumerate(feature_blockers):
# row = 19 + idx
# column = 2
# g.update_sheet(
# row,
# column,
# (
# f'=HYPERLINK("https://bugzilla.redhat.com/show_bug'
# f'.cgi?id={bug.bug_id}", "{bug.bug_id}")'
# )
# )
# g.update_sheet(row, column+1, bug.summary)
# g.update_sheet(row, column+6, bug.status)
# g.update_sheet(row, column+7, bug.component)
# g.update_sheet(row, column+8, bug.severity)
# converted = datetime.datetime.strptime(
# bug.creation_time.value, "%Y%m%dT%H:%M:%S"
# )
# g.update_sheet(row, column + 9, (now - converted).days)
# g.clean_rows(2, 19 + len(feature_blockers), 28)
# # Sleep to ensure no exception will raise from Google API due to writes limit
# time.sleep(60)
# stability_bugs = sort_by_pm_score(get_stability_bugs())
# for idx, bug in enumerate(stability_bugs):
# row = 32 + idx
# column = 2
# g.update_sheet(
# row,
# column,
# (
# f'=HYPERLINK("https://bugzilla.redhat.com/show_bug'
# f'.cgi?id={bug.bug_id}", "{bug.bug_id}")'
# )
# )
# g.update_sheet(row, column+1, bug.summary)
# g.update_sheet(row, column+6, bug.status)
# g.update_sheet(row, column+7, bug.component)
# g.update_sheet(row, column+8, bug.severity)
# converted = datetime.datetime.strptime(
# bug.creation_time.value, "%Y%m%dT%H:%M:%S"
# )
# g.update_sheet(row, column + 9, (now - converted).days)
# g.clean_rows(2, 32 + len(stability_bugs), 46)
g.update_sheet(1, 1, f'Last update: {now.strftime("%Y-%m-%d %H:%M")}')