Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ci status #9

Merged
merged 2 commits into from
Dec 21, 2023
Merged

Fix ci status #9

merged 2 commits into from
Dec 21, 2023

Conversation

ochosi
Copy link
Collaborator

@ochosi ochosi commented Dec 21, 2023

These two commits ensure that our CI status matching improves, however, it's still not perfect.
Previously, we only looked at check_runs status when the combined_status was empty. Now we look at the native GitHub actions check_runs in any case, and even avoid an API call if check runs have failed.
This means that effectively we create our own combined_status out of external CIs and check runs.

There is still a corner case I'm unsure how to handle. When a PR has checks defined, but they haven't been triggered (I presume that external contributors don't have the permissions in this case?), the API returns total_count = 0.
So while the correct state would be pending, we cannot know if there are maybe no GitHub checks defined or if they haven't been triggered.
Here's a PR that I ran into with this problem: osbuild/cloud-image-val#283
It's currently part of the queue, even though CI hasn't run.

We can of course also decide to ignore this corner case because there may not be a pretty solution to it.

Previously, we only looked at check_runs status when the combined status
was empty. Now we look at the native GitHub actions check_runs in any
case, and even avoid an API call if check runs have failed.
The API actually returns the expected amount of checks, so rely on that
vs. on len(runs).
Also, only return the short status so matching becomes more elegant
(plus we don't use that information anywhere).
@ochosi ochosi self-assigned this Dec 21, 2023
@ochosi
Copy link
Collaborator Author

ochosi commented Dec 21, 2023

@schuellerf @marusak @achilleas-k FYI, this improves CI status matching, but there's still a corner case left.

@ochosi ochosi merged commit 1ba4262 into main Dec 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant