Skip to content

Commit

Permalink
Fix empty stable-rt reports
Browse files Browse the repository at this point in the history
Add a check to verify if there are builds from
selected origins before generating the report.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia committed Nov 29, 2024
1 parent 3188fb9 commit cb4c9e9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions kcidb/monitor/subscriptions/linux_stable_rt.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ def match_revision(revision):
if repo_url not in revision.repo_branch_checkouts:
return ()

selected_origins = {'maestro', 'broonie'}
# If the revision is not from 'maestro' or 'broonie' origin
if not {c.origin for c in revision.checkouts} & selected_origins:
return ()

# Return if there are no builds or status is unknown for all the builds
if revision.builds_valid is None:
return ()

# If the revision is not from 'maestro' or 'broonie' origin
if not {c.origin for c in revision.checkouts} & {'maestro', 'broonie'}:
# If no builds found from 'maestro' or 'broonie' origin
builds = [build for build in revision.builds if build.origin in selected_origins]
if not builds:
return ()

# Send notification 3 hours after a revision is created/updated
Expand Down

0 comments on commit cb4c9e9

Please sign in to comment.