Skip to content

workflows/pr: block merging PRs when jobs have been cancelled#433060

Merged
wolfgangwalther merged 1 commit intoNixOS:masterfrom
wolfgangwalther:ci-required-status-checks
Aug 12, 2025
Merged

workflows/pr: block merging PRs when jobs have been cancelled#433060
wolfgangwalther merged 1 commit intoNixOS:masterfrom
wolfgangwalther:ci-required-status-checks

Conversation

@wolfgangwalther
Copy link
Contributor

This currently happens, for still unknown reasons, for the "check cherry picks" job. The job gets cancelled by GHA mid-way. This should be the same as an error, because an important check didn't run: Merging should be blocked and auto-merge should not succeed.

This only fixes the symptoms of #433053 (comment), will look into the actual cause next.

Things done


Add a 👍 reaction to pull requests you find important.

This currently happens, for still unknown reasons, for the "check cherry
picks" job. The job gets cancelled by GHA mid-way. This should be the
same as an error, because an important check didn't run: Merging should
be blocked and auto-merge should not succeed.
@nixpkgs-ci nixpkgs-ci 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. 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: policy discussion Discuss policies to work in and around Nixpkgs backport release-25.05 labels Aug 12, 2025
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we'll discover this isn't what we need, but it's worth the experiment.

@wolfgangwalther wolfgangwalther merged commit a5486fd into NixOS:master Aug 12, 2025
51 of 53 checks passed
@wolfgangwalther wolfgangwalther deleted the ci-required-status-checks branch August 12, 2025 12:31
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Aug 12, 2025

Successfully created backport PR for release-25.05:

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 12, 2025
@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Aug 12, 2025
@wolfgangwalther
Copy link
Contributor Author

I suspect we'll discover this isn't what we need, but it's worth the experiment.

What makes you believe this?

It seems it indeed doesnt work, but I don't know why. In https://github.com/NixOS/nixpkgs/actions/runs/16909083566?pr=433053, the check cherry picks job is cancelled due to timeout, but the "no PR failures" job is still skipped. It should not be, according to the new condition.

@wolfgangwalther
Copy link
Contributor Author

I suspect we'll discover this isn't what we need, but it's worth the experiment.

What makes you believe this?

Reading the docs carefully:

cancelled

Returns true if the workflow was canceled.

and

failure

Returns true when any previous step of a job fails. If you have a chain of dependent jobs, failure() returns true if any ancestor job fails.

OK, that's clearly a difference. I had assumed cancelled() to work the same way as failure()... but it does not.

@philiptaron
Copy link
Contributor

It's a probabilistic belief. GHA's semantics are knowable but not obvious at every turn, and this turn -- what happens on timeout? what happens on cancel? what happens on re-run? -- are likely to be no different.

I'm approving because I buy your intent in the PR headmatter and this looks like it will accomplish it. I just have low faith in GHA and given that we can't read the source, we'll have to muddle through with experiments in production.

Experiments I am very glad you're running.

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 Discuss policies to work in and around Nixpkgs 8.has: port to stable This PR already has a backport to the stable release. 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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants