forked from RazTamir/bugzilla-reports-tool
-
Notifications
You must be signed in to change notification settings - Fork 2
/
release_readiness_criteria.py
64 lines (51 loc) · 1.82 KB
/
release_readiness_criteria.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
#!/usr/bin/env python
import time
import google_api as gapi
from helpers import *
import datetime
now = datetime.datetime.now()
g = gapi.GoogleSpreadSheetAPI(SPREADSHEET_NAME, "Release Readiness Criteria")
qe_backlog = len(get_qe_backlog())
g.update_sheet(6, 3, qe_backlog)
dev_backlog = len(get_dev_backlog())
g.update_sheet(6, 4, dev_backlog)
blockers = len(get_open_blockers())
g.update_sheet(6, 5, blockers)
candidate_blockers = len(get_open_candidate_blockers())
g.update_sheet(6, 6, candidate_blockers)
critical_bugs = len(get_critical_bugs())
g.update_sheet(6, 7, critical_bugs)
regressions = len(get_regression_bugs_targeted())
g.update_sheet(6, 8, regressions)
untriaged = len(get_untriaged_bugs())
g.update_sheet(6, 9, untriaged)
untargeted = len(get_untargeted_bugs())
g.update_sheet(6,10, untargeted)
doc_bugs = len(get_doc_bugs())
g.update_sheet(6, 11, doc_bugs)
overall_backlog = len(get_overall_backlog())
g.update_sheet(6, 12, overall_backlog)
# Sleep to ensure no exception will raise from Google API due to writes limit
time.sleep(40)
bugs_for_pm_score = filter_only_bugs(get_dev_backlog(""))
top_10_bugs = sort_by_pm_score(bugs_for_pm_score)[:10]
for idx, bug in enumerate(top_10_bugs):
row = 10 + idx
column = 7
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.update_sheet(1, 1, f'Last update: {now.strftime("%Y-%m-%d %H:%M")}')