ci: pr stats: deal with trivial+hotfix PRs

deal wit the case of Trivial+Hotifx and mark it correctly in PR
dashboard.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2024-02-01 11:57:23 -05:00
parent 0bc1a2b314
commit 5529241bc9

View file

@ -92,12 +92,14 @@ def process_pr(pr):
business_days = sum(1 for day in dates if day.weekday() < 5)
prj['business_days_open'] = business_days
# less than 2 business days ...
if business_days < 2 and not ('Trivial' in labels or 'Hotfix' in labels) or \
deltah < 4 and 'Trivial' in labels:
prj['time_rule'] = "no"
else:
prj['time_rule'] = "yes"
trivial = 'Trivial' in labels
hotfix = 'Hotfix' in labels
min_review_time_rule = "no"
if hotfix or (trivial and deltah >= 4) or business_days >= 2:
min_review_time_rule = "yes"
prj['time_rule'] = min_review_time_rule
# This is all data we get easily though the Github API and serves as the basis
# for displaying some trends and metrics.