Skip to content

[Backport release-24.11] ci/check-cherry-picks: fail without proper cherry-pick#411743

Merged
wolfgangwalther merged 9 commits intorelease-24.11from
backport-411737-to-release-24.11
May 28, 2025
Merged

[Backport release-24.11] ci/check-cherry-picks: fail without proper cherry-pick#411743
wolfgangwalther merged 9 commits intorelease-24.11from
backport-411737-to-release-24.11

Conversation

@nixpkgs-ci
Copy link
Contributor

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

Bot-based backport to release-24.11, triggered by a label in #411737.

  • 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.

The script is part of CI and changes to it should be reviewed by the CI
owners. Thus moving it to ci/ is the most sensible thing to do.

(cherry picked from commit ad4b36d)
(cherry picked from commit fc642b0)
We recently moved the $commits variable out of a "subshell in a
herestring", let's do the same for the list of branches, where errors
would be silently swallowed as well.

Also reformat the expressions slightly, we have enough line-length.

(cherry picked from commit e2a3792)
(cherry picked from commit 92ff241)
(cherry picked from commit 6cf5f9e)
(cherry picked from commit c4b8c13)
The default is to checkout a contributors fork as "origin", thus the
NixOS/nixpkgs remote is most likely named differently. But not everybody
keeps their fork's main branches up-to-date all the time. Thus the
script would fail locally.

(cherry picked from commit 2fea2bb)
(cherry picked from commit 63b1cc8)
In a small terminal window this would just stop running after each
commit until you exit the pager. That's not what we want when running it
locally.

(cherry picked from commit 245b1c1)
(cherry picked from commit 7f5b7cd)
Using a `tree:0` filter instead of `blob:none` reduces the checkout time
from over 3 minutes to about 45 seconds. The required trees/blobs will
then be fetched on-demand.

This on-demand fetching creates additional output for `git range-diff`
on stderr, so we hide that. This only happens the first time it's run,
so we don't need to adjust the other calls - which will still return any
real errors, should they happen.

(cherry picked from commit e575364)
(cherry picked from commit 331bbc4)
…python-updates

Those are protected branches, which can't be force pushed to - so the
commits will remain. Thus, we can also backport from them.

(cherry picked from commit ea636d1)
(cherry picked from commit 5f23ca9)
This makes the job significantly faster when the commit can't be found
on master or staging directly. Before this change, the script would have
had to iterate through 20+ release branches before finding the latest
one. With lazy fetching for git enabled, this would take a few minutes.

(cherry picked from commit a9b718b)
(cherry picked from commit bcf8f3f)
When cherry-picking without -x or not cherry-picking at all, the
check-cherry-picks job would usually remain green. This is annoying to
deal with for reviewers, because "all green" still needs attention -
have all commits been cherry-picked properly?

If a commit was not cherry-picked correctly, either without -x or not at
all, because it's a genuine commit to begin with, the reviewers
attention is required anyway. Thus we can also let the job fail in this
case.

(cherry picked from commit dfaefc0)
(cherry picked from commit d630bf4)
@wolfgangwalther wolfgangwalther changed the title [Backport release-24.11] [Backport release-25.05] ci/check-cherry-picks: fail without proper cherry-pick [Backport release-24.11] ci/check-cherry-picks: fail without proper cherry-pick May 28, 2025
@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 28, 2025
@wolfgangwalther wolfgangwalther merged commit 72ded1f into release-24.11 May 28, 2025
9 of 10 checks passed
@wolfgangwalther wolfgangwalther deleted the backport-411737-to-release-24.11 branch May 28, 2025 14:04
@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 28, 2025
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