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

workflows/eval: Make sure to compare against the push run #360274

Merged
merged 1 commit into from
Nov 30, 2024

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Nov 30, 2024

For PRs whose commits end up as HEAD of master like bcc5c14, there might be workflow runs associated with both PRs and pushes.

Only the push event is the one that will run fully and should be used to compare against. So far it didn't distinguish between the two events, causing it to sometimes pick the wrong one and then fail to download non-existent artifacts: https://github.com/NixOS/nixpkgs/actions/runs/12092053414/job/33721377179

This commit fixes that by ensuring that the push event result is compared against

Having a hard time testing this, but for the above commit, this returns a push and a pull request event:

gh api /repos/NixOS/nixpkgs/actions/workflows/eval.yml/runs --method GET \
  -f head_sha=bcc5c141bf43460909b83740e96ceeea6d0f7e12 

with the pull request one being more recent (that's what eval.yml orders it by) and therefore being used here: https://github.com/NixOS/nixpkgs/actions/runs/12092053414/job/33721377179. Adding -f event=push makes it only return the one push event.

Follow-up to #359704


This work is funded by Tweag and Antithesis

Add a 👍 reaction to pull requests you find important.

For PRs whose commits end up as HEAD of master like
NixOS@bcc5c14,
there might be workflow runs associated with both PRs and pushes.

Only the push event is the one that will run fully and should be used to compare against.
So far it didn't distinguish between the two events, causing it to
sometimes pick the wrong one and then fail to download non-existent
artifacts: https://github.com/NixOS/nixpkgs/actions/runs/12092053414/job/33721377179

This commit fixes that by ensuring that the push event result is
compared against
@github-actions github-actions bot added 6.topic: policy discussion 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions labels Nov 30, 2024
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 30, 2024
@drupol drupol merged commit 46fba61 into NixOS:master Nov 30, 2024
20 of 21 checks passed
@JohnRTitor JohnRTitor added the backport release-24.11 Backport PR automatically label Nov 30, 2024
Copy link
Contributor

Git push to origin failed for release-24.11 with exitcode 1

@drupol
Copy link
Contributor

drupol commented Nov 30, 2024

Git push to origin failed for release-24.11 with exitcode 1

@infinisil ^^ oops :(

@infinisil infinisil deleted the gha-eval-fix-comparison branch December 2, 2024 18:02
@infinisil
Copy link
Member Author

Manual backport: #361168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: policy discussion 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants