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
commit 5529241bc9

View file

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