Skip to content

[24.11] workflows/get-merge-commit: support merge conflicts, run as step in main jobs#410475

Merged
Mic92 merged 4 commits intoNixOS:release-24.11from
wolfgangwalther:backport-410471-to-release-24.11
May 24, 2025
Merged

[24.11] workflows/get-merge-commit: support merge conflicts, run as step in main jobs#410475
Mic92 merged 4 commits intoNixOS:release-24.11from
wolfgangwalther:backport-410471-to-release-24.11

Conversation

@wolfgangwalther
Copy link
Contributor

Backport of #410471 without the changes to OWNERS.

Things done


Add a 👍 reaction to pull requests you find important.

…ub-script

The reason this was a separate shell script was, that this would be
included in multiple workflows separately. But a while ago this had been
changed to a re-usable workflow, so we can just as well inline the
script.

This also allows us to use actions/github-script, which makes for a much
more readable script than the bash script before.

(cherry picked from commit 277f7b9)
(cherry picked from commit 79ea708)
When a PR is having conflicts with the base branch, we used to skip most
jobs depending on the target branch. With this change, we still run
those jobs, but without actually merging the PR temporarily. That means
we compare the head of the PR with the merge-base of the PR's branch and
the target branch - i.e. the point where the PR branched off.

This is not 100% accurate, but that's not important, because after
resolving the merge conflicts, those workflows will run again anyway. It
allows to give early feedback, though, instead of just skipping all the
jobs.

(cherry picked from commit c77cfb9)
(cherry picked from commit 3e11941)
We don't need a separate workflow anymore, because we don't need to skip
dependent jobs on failures anymore. The biggest failure mode was
"conflict" previously, but we resolved that on the last commit. The
remaining failure modes are so rare, that it's OK to just fail the jobs
in this case instead of marking them as "skipped". Especially, because
the resolve-merge-commit job would have previously failed anyway.

By moving this to an action we avoid running separate jobs each time we
need the merge commit. This also makes the check list in PRs much
cleaner.

(cherry picked from commit e48d9d6)
(cherry picked from commit e2a2997)
…mit action

This makes a difference for the case of a merge conflict: In that case,
the magic `.../merge` branch actually points to the *last test merge
commit* that was successful, which might not contain the latest head
commit in any way. Running the tests on that commit is heavily
misleading. By using the get-merge-commit action, we run on the PR's
head commit in this case, which is much better.

(cherry picked from commit 039a954)
(cherry picked from commit 30b698a)
@github-actions github-actions bot added 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 4.workflow: backport This targets a stable branch 6.topic: policy discussion Discuss policies to work in and around Nixpkgs labels May 24, 2025
@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 May 24, 2025
@Mic92 Mic92 merged commit fd63ec9 into NixOS:release-24.11 May 24, 2025
28 of 32 checks passed
@wolfgangwalther wolfgangwalther deleted the backport-410471-to-release-24.11 branch May 24, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.workflow: backport This targets a stable branch 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 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants