Skip to content

Conversation

@wolfgangwalther
Copy link
Contributor

@wolfgangwalther wolfgangwalther commented Jun 8, 2025

This series of commits introduces two wrapper workflows pr and push, which call most of the other workflows.

The primary goal here is, to give us a good base to enable "required status checks". Those work by looking for specific job names. With the old structure, we would have to add all the required jobs to the respective branch protection rule separately - and whenever we added or removed a job or just changed a required job's name, we'd risk blocking PRs from merging entirely. Those would always have to be kept in-sync. With the single "PR" workflow that is introduced here, there is another option: We can then just add a single job required-to-merge at the end of this new workflow. This would depend on all other jobs in there and thus only pass when all others do. We can then set up this single job for the branch protection rule. A loud enough comment near that job should prevent accidental renames. And we can easily add or remove jobs from the list of required jobs by adding needs to that job - without needing to touch the branch protection rules. Neither this "required to merge" job nor branch protection rules are introduced in this PR, yet.

There is also another future benefit that we can take advantage of: With this base, we can implement something to solve #406825 (comment) without artifact hackery.

On its own, this PR doesn't give us much except some cosmetics:

  • I decided to split all the jobs up into 4 main groups:

    • Check: Not looking at the code at all, just at git stuff: Right target branch? Good cherry picks? Potentially also commit messages etc.
    • Lint: Static code analysis / formatting: treefmt, nixpkgs-vet, nix parse check.
    • Eval: Everything that evals, but doesn't build, yet.
    • Build: Everything that actually builds something. Manuals, lib-tests, shell.nix.

    This split gives us a nice consistent UI (see screenshot below). The status check names are prefixed accordingly and the summary page has collapsed items.

  • In some cases, much shorter job names, which display much nicer in the graphical display in the summary page.

  • A single summary page with all artifacts and all jobs listed - much better experience for PR authors. They don't need to click on the right job details, because almost all of them will lead them to the right page. Also easier to see from those summary pages which jobs for that PR failed together.

2025-06-08T14:08:43,488858777+02:00

This also has one downside: It's harder to go through the "Actions" tab and search for failures of specific workflows. They are all grouped in the "PR" workflow now. I think this is outweighed by the ability to use required status checks, though. Heavily so.

The first commit is taken out of #414800 to ease rebasing once that's merged.

TODO:

Things done


Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 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-24.11 backport release-25.05 Backport PR automatically labels Jun 8, 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 Jun 8, 2025
@wolfgangwalther wolfgangwalther force-pushed the ci-single-build branch 2 times, most recently from dc153ab to ddaebfe Compare June 8, 2025 17:19
@philiptaron
Copy link
Contributor

philiptaron commented Jun 8, 2025 via email

Copy link
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

I haven't yet gone through the diff in detail, but the concept LGTM

@wolfgangwalther
Copy link
Contributor Author

I haven't yet gone through the diff in detail, but the concept LGTM

Cool. Once we all agree on the basic concept and also the name "PR" for the main workflow, we can go ahead with Mic92/nixpkgs-review#500, which will support both the current "Eval" and the new "PR". This will take a bit of time until released and available in nixpkgs, but should be done before merging this PR anyway.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 9, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 10, 2025
wolfgangwalther added a commit to wolfgangwalther/nixpkgs that referenced this pull request Jun 14, 2025
This gives us nixpkgs-review 3.4.0 to support NixOS#415006.

From the nixpkgs-unstable channel:
https://hydra.nixos.org/eval/1816084#tabs-inputs

Changes for treefmt-nix:
numtide/treefmt-nix@1f3f7b7...a05be41
@wolfgangwalther wolfgangwalther mentioned this pull request Jun 14, 2025
2 tasks
@github-actions github-actions bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 14, 2025
@wolfgangwalther
Copy link
Contributor Author

wolfgangwalther commented Jun 14, 2025

Rebased. The remaining pieces in here are now ready for review.

Note: Many Eval jobs will fail for the pull_request event. That's expected, because they try to fetch artifacts from the "PR" workflow, which didn't run on the target branch, yet.

nixpkgs-review 3.4.0 has been released with support for the "PR" workflow and has hit nixpkgs-unstable. Before merging this, we should wait for it to be in the pinned nixpkgs used for the dev shell and for it to be available in all channels:

nixpkgs-ci bot pushed a commit that referenced this pull request Jun 14, 2025
This gives us nixpkgs-review 3.4.0 to support #415006.

From the nixpkgs-unstable channel:
https://hydra.nixos.org/eval/1816084#tabs-inputs

Changes for treefmt-nix:
numtide/treefmt-nix@1f3f7b7...a05be41

(cherry picked from commit a9589ea)
nixpkgs-ci bot pushed a commit that referenced this pull request Jun 14, 2025
This gives us nixpkgs-review 3.4.0 to support #415006.

From the nixpkgs-unstable channel:
https://hydra.nixos.org/eval/1816084#tabs-inputs

Changes for treefmt-nix:
numtide/treefmt-nix@1f3f7b7...a05be41

(cherry picked from commit a9589ea)
@wolfgangwalther wolfgangwalther force-pushed the ci-single-build branch 2 times, most recently from c448b87 to 5799a21 Compare June 15, 2025 10:44
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 16, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 17, 2025
@wolfgangwalther
Copy link
Contributor Author

nixpkgs-review v3.4.0 is available on all channels. I rebased and did a smoke test in my fork again, all good.

I plan to merge this at some point tomorrow to be able to keep an eye open on the pipelines just in case. Unless somebody with open eyes beats me to it :)

Copy link
Contributor

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

Nothing screaming out at me in the diff, so 🤞

If there are major issues we can revert and try again, of course.

I had one documentation nit pending, from when I started reviewing the other day. Feel free to ignore.

Those two workflows bundle all the main jobs in two event-specific
wrapper workflows. This enables us to do two things later on:
- Synchronize the merge commits between most of the jobs run in a PR.
- Create a single "required" job to be targeted by GitHub's "required
status checks to pass" feature.
We previously moved this out of the main eval workflow to avoid running
it on push and/or undrafting the PR. The latter has been removed in the
meantime and the former can be checked with a simple condition. Thus we
move it back in, to make it part of the 4 main workflows, which will be
required before merge eventually.
The overall idea is to use names short enough to fit into the status
checks list without shortening. This change mostly happened in the
commits before, here we just follow the same pattern for the remaining
workflows.
@wolfgangwalther wolfgangwalther merged commit d8332aa into NixOS:master Jun 18, 2025
43 of 54 checks passed
@wolfgangwalther wolfgangwalther deleted the ci-single-build branch June 18, 2025 12:16
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jun 18, 2025

Successfully created backport PR for release-24.11:

@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jun 18, 2025

Successfully created backport PR for release-25.05:

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. backport release-25.05 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants