-
Notifications
You must be signed in to change notification settings - Fork 18
/
tracking_dashboard.py
107 lines (96 loc) · 3.3 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
#!/usr/bin/env python
import time
from helpers import *
import datetime
now = datetime.datetime.now()
g = gapi.GoogleSpreadSheetAPI(SPREADSHEET_NAME, "QE tracking dashboard")
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)
time.sleep(60)
stability_bugs = sort_by_pm_score(get_testing_blockers())
for idx, bug in enumerate(stability_bugs):
row = 51 + 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, 61 + len(stability_bugs), 65)
g.update_sheet(1, 1, f'Last update: {now.strftime("%Y-%m-%d %H:%M")}')