Skip to content

[Backport release-25.05] workflows/get-merge-commit: support merge conflicts, run as step in main jobs#410471

Merged
wolfgangwalther merged 4 commits intorelease-25.05from
backport-410430-to-release-25.05
May 24, 2025
Merged

[Backport release-25.05] workflows/get-merge-commit: support merge conflicts, run as step in main jobs#410471
wolfgangwalther merged 4 commits intorelease-25.05from
backport-410430-to-release-25.05

Conversation

@nixpkgs-ci
Copy link
Contributor

@nixpkgs-ci nixpkgs-ci bot commented May 24, 2025

Bot-based backport to release-25.05, triggered by a label in #410430.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-committer, if you find that it is not acceptable, leave a comment.

…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)
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)
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)
…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)
@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 backport release-24.11 labels May 24, 2025
@nix-owners nix-owners bot requested review from LeSuisse, Mic92, azuwis, infinisil, mweinelt, philiptaron, risicle, wolfgangwalther and zowoq and removed request for infinisil May 24, 2025 10:27
@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
@wolfgangwalther wolfgangwalther merged commit a036a96 into release-25.05 May 24, 2025
28 of 32 checks passed
@wolfgangwalther wolfgangwalther deleted the backport-410430-to-release-25.05 branch May 24, 2025 10:40
@nixpkgs-ci
Copy link
Contributor Author

nixpkgs-ci bot commented May 24, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-410471-to-release-24.11 origin/release-24.11
cd .worktree/backport-410471-to-release-24.11
git switch --create backport-410471-to-release-24.11
git cherry-pick -x 79ea708cc01146a9c6557df3cdc4ece7481f6b39 3e119410bbc0545e17e557198585640ac252f4ea e2a29971275bc417570400010af4feffa38c114c 30b698a54e435d8d4d18399b14f903286facd5da

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.

1 participant