Commit Graph

384 Commits

Author SHA1 Message Date
Wolfgang Walther
e654129e96 ci/eval/attrpaths: update cross stdenvs
`pkgsArocc` and `pkgsZig` had been added to `release.nix`, so should be
listed here as well.

(cherry picked from commit 8104100101)
2025-09-03 16:28:31 +00:00
Wolfgang Walther
cc8ee67459 treewide: remove __recurseIntoDerivationForReleaseJobs
This attribute was supposed to be set on derivations, to make the
release tools recurse into them. The remaining uses were all on regular
attrsets, though, so this is safe to remove.

(cherry picked from commit d0c0b875f7)
2025-09-03 16:28:30 +00:00
Wolfgang Walther
5c22b88f2b ci/eval: remove unused checkMeta argument
This should always be set anyways.

(cherry picked from commit b627d181e9)
2025-09-03 16:28:30 +00:00
Wolfgang Walther
3c6789fbed ci/eval/attrpaths: refactor
The following changes were made:
- Using `lib.` instead of `builtins.`
- Using `mapAttrsToList` instead of `mapAttrs` + `attrValues`
- Joining two of the if conditions with the same return value
- Using `traceIf` instead of `if` / `else`
- Using `showAttrPath` instead of `concatStringsSep`

(cherry picked from commit 04fcbb45e1)
2025-09-03 16:28:29 +00:00
Wolfgang Walther
d332267042 ci/eval/attrpaths: remove left-over condition
This condition doesn't make a difference anymore, ever since we removed
the tryEval code from this file and had already enabled unfree packages
earlier anyway.

(cherry picked from commit 9524a21fe0)
2025-09-03 16:28:29 +00:00
Wolfgang Walther
a24803b26f ci/eval: remove ofborg references
By now, these files have been changed enough to not need the "vendored
from" notes anymore. These links would still be there when going through
the history of the file, but today GHA CI has not many similarities
anymore to what ofborg did, so these are not really helpful.

(cherry picked from commit 2aae142529)
2025-09-03 16:28:29 +00:00
Wolfgang Walther
87af6a62ab top-level/release-outpaths: move to ci/eval
These files are tightly coupled with the code in ci/eval and not used
anywhere else. They are subject to the same backporting requirements as
the remaining CI code. They are better placed next here.

(cherry picked from commit 0d51e920d3)
2025-09-03 16:28:29 +00:00
Wolfgang Walther
4198e557f3 ci/eval/compare: handle missing packages
Not all packages that are reported as changed will actually exist on the
platform that the maintainers are colleted on.

This is the case for some attributes that are only available on Darwin
or explicitly set to `null` on Linux. By filtering out packages without
maintainers, these are ignored - and we should potentially get a small
performance improvement as well.

(cherry picked from commit f2ca5796de)
2025-09-01 16:24:43 +00:00
Wolfgang Walther
dd3e8f668a ci/eval/compare: refactor
Simplification after the last step.

(cherry picked from commit 4126ef7e00)
2025-09-01 10:19:33 +00:00
Wolfgang Walther
d766035d65 ci/eval/compare: only check changed attrpaths
It makes no sense to check newly added attrpaths for maintainers on the
target branch - by definition these attrpaths won't exist, yet. We can
avoid falling back to `null` for these etc.

(cherry picked from commit e88dd3a8b2)
2025-09-01 10:19:32 +00:00
Wolfgang Walther
f6634a6670 ci/eval/compare: remove package validity check
This should not be necessary anymore, because packages that fail to
evaluate should already be filtered out by the attrpath generation step
in main eval.

(cherry picked from commit 0753aa4580)
2025-09-01 10:19:32 +00:00
Wolfgang Walther
7dd8ed0a70 ci/eval/compare: ping maintainers of removed packages
This change pings maintainers of actually removed packages, aka where
the package's expression is deleted.

This will not ping maintainers of packages that become invisible,
because a (transitive) dependency of them is marked as insecure or
broken.

(cherry picked from commit 540e188796)
2025-09-01 10:19:32 +00:00
Wolfgang Walther
f814e824f8 ci/github-script/labels: auto close package request issues
This allows the labels workflow to support issue management in two ways:
- New package request can potentially created with a `4.workflow:
auto-close` label immediately and be closed automatically this way.
- Existing package requests can be bulk-closed by adding this label.
This has the advantage of posting the explanatory comment at the same
time, which is not possible with regular bulk operations.

(cherry picked from commit b5dee53399)
2025-08-29 19:31:18 +00:00
Jörg Thalheim
0beac304d7 ci: replace nix_2_24 with nix_2_28
This is a partial backport of the nix_2_24 removal PR, containing
only the CI testing changes that update the tested nix versions.

(cherry picked from commit 1b7637ff08)
2025-08-29 15:56:45 +02:00
Wolfgang Walther
579c4e6a60 ci/eval.full: allow local comparison with rebuilds
This allows running a full comparison between two commits locally.

What was previously `eval.full` is now called `eval.all`. The new
`eval.full` takes a `baseline` argument for the comparison.

(cherry picked from commit ccc12c839b)
2025-08-28 16:20:15 +00:00
Wolfgang Walther
d9a6405eab ci/eval: clarify README with current defaults and memory requirements
We had set a default of 5000 for local evaluation earlier for
`singleSystem`, it makes sense to also use that for `full`.

The README is also a bit outdated, because Nix 2.30 significantly
changed the memory requirements. Rewriting the README to also show the
ability to directly evaluate the current system only.

(cherry picked from commit 0e07097947)
2025-08-28 16:20:15 +00:00
Wolfgang Walther
51dee45438 ci/github-script: fix run script
Not a problem for prepare/commits, but the labels comand will remove the
temp directory again, before it actually runs the command. Nothing good
will come out of that!

(cherry picked from commit eb766e2d51)
2025-08-26 11:59:48 +00:00
Wolfgang Walther
ee1e86a5b4 ci,workflows: deal with ghost reviews
When a user deletes their account, they appear as a "ghost user". This
user is represented as `null` on API requests. If such a user had posted
a review before, this breaks a few places, which assume to be able to
access `user.login`.

(cherry picked from commit 41ae23c0e7)
2025-08-25 13:29:21 +00:00
Wolfgang Walther
91c088d3b7 ci/github-script/prepare: identify real base branch
When a contributor mistakenly sets the wrong target branch for a Pull
Request, this can lead to bad consequences for CI. Most prominent is the
mass ping of codeowners, that is already handled in
`ci/request-reviews/verify-base-branch.sh`. But there are other things
that go wrong:
- After eval, a mass ping of maintainers would still be possible, in
theory. Practically, this doesn't happen, because we have a limit of 10
reviewer requests at the same time.
- This will most often contain a change to `ci/pinned.json`, thus the
full Eval matrix of all Lix/Nix versions will be run, burning a lot of
resources.
- The PR will be labelled with almost all labels that are available.

We can improve on the current situation with some API calls to determine
the "best" merge-base for the current PR. We then consider this as the
"real base". If the current target is not the real base, we fail the
prepare step, which is early enough to prevent all other CI from
running.

(cherry picked from commit 87d9b08ffb)
2025-08-25 12:05:51 +00:00
Wolfgang Walther
8353c8c10e ci/github-script/prepare: avoid running CI when targeting channel branches
This moves the no-channel-base check into the prepare script to exit
early and prevent all of CI to run against those branches. We also
provide better output by posting a "Changes Requested" review, using the
existing infrastructure from the old cherry-picks check.

The review will be dismissed automatically once the branch has been
corrected, because the commits check will run and do it.

(cherry picked from commit 0601cf6fd0)
2025-08-25 12:05:51 +00:00
Wolfgang Walther
64fbd08045 ci/github-script/commits: split review function into separate file
This allows re-using postReview in the next commit.

(cherry picked from commit c96b0e6d3d)
2025-08-25 12:05:51 +00:00
Wolfgang Walther
59eb6387fa workflows/check: always run commits job
This is the very first step to extending the commits job to do more than
just cherry-picks in the future: It could check reverts or merge
commits, but also the commit message format and more.

Of course, cherry-picks are still just checked on the stable branches as
before. For now, this allows us to run the part that dismisses automated
reviews automatically. This helps us when we do branch related checks in
the prepare step, which would also create such a review. To avoid
cluttering multiple reviews across a PR, we'll want all of these reviews
to be handled by the same code, thus this change.

(cherry picked from commit b6bbf7b250)
2025-08-25 12:05:51 +00:00
Wolfgang Walther
78287e87be workflows/check: allow owners to fail when ci/OWNERS is untouched
The owners check is not reproducible, because it depends on the state of
the NixOS org on GitHub. Owners can rename their accounts or they can
leave the organisation and access to Nixpkgs can be removed from teams.
All of this breaks the owners check for reasons unrelated to the PR at
hand.

This PR makes the check for the owners file conditionally required: Only
when the ci/OWNERS file is actually modified a failed check will block
merging the PR. When that's not the case, the check will still fail
visibily in the checklist, but the failure can be ignored.

This is especially relevant for the Merge Queue, which should not be
entirely blocked whenever any of these events happen.

Also, it allows passing the checks in a fork when testing, where the
owners check will *always* fail, because the respective teams and
members are never part of the "user org" that a fork is.

(cherry picked from commit 956d0a744d)
2025-08-24 19:11:25 +00:00
Wolfgang Walther
9bea5d3844 workflows/test: init
This workflow runs the PR and Push workflow files on a `pull_request`
trigger. The intent is to test changes to the workflow files
immediately. Previously, these were run directly from the respective
workflow files.

The new approach allows us to move the logic to run this only when
workflow files changed from the pull_request trigger into a job. This
has the advantage that older jobs are cleaned up, when the PR changes
from a state of "workflow files changed" to "no workflow files changed".
This can happen when changing a PR's base from staging to master, in
which case changes from master would temporarily appear in the PR as
changes. When these include changes to workflow files, this would
trigger the PR workflow via `pull_request`. Once the base is changed,
the PR is closed and re-opened, so CI runs again - but since it's on the
same commit and the new run doesn't trigger `pull_request`, the results
of the previous run are still kept and displayed. These results may
include cancelled or failed jobs, which are impossible to recover from
without another force-push.

Checking this condition at run-time is only possible, because we move it
into a separate workflow, turning the `pr.yml` workflow into a re-usable
workflow. This will make sure to skip the whole workflow at once, when
no change was detected, which will prevent the "no PR failures" job from
appearing as skipped - which would imply "success" and make the PR
mergeable immediately. Instead the "no PR failures" job is not shown at
all for this trigger, which is generally what we want.

Do the same for `push.yml` for consistency.

(cherry picked from commit 443f30f811)
2025-08-24 10:15:02 +00:00
Wolfgang Walther
a387b2ed61 ci: remove python-updates from development branches
The python-updates branch is not a "development" branch in the sense of
ci/README.md's classification. That's because it allows force pushes.
When rewrites are possible, cherry-picking from this branch should not
be allowed, because the commit references will potentially end up out of
sync.

These kind of branches are now termed "Work-in-Progress" branches. Up
until recently these branches didn't work well for Pull Requests
targeting them, because Eval wouldn't run on them with a push event and
thus, Eval in the PR couldn't succeed either. That's now fixed, PRs
towards *any* WIP branch should work correctly.

(cherry picked from commit 55b046451c)
2025-08-22 15:45:29 +00:00
Wolfgang Walther
1646453f34 workflows/eval: pass outpaths via cachix instead of artifacts
Instead of uploading the outpaths as artifact, this uploads them via
cachix. Most of all, this makes CI less brittle, because Eval in PRs
will still be able to succeed, even if no workflow run for the push
event could be found on the target branch. It will just take longer.

This also makes moving Eval into the Merge Queue easier to do: When
downloading artifacts from a different run, these would always have to
match on the right event, too. By pulling from cachix, the same workflow
can support target branches with merge queue and without merge queue at
the same time. The latter would still use the push event, while the
former could use the merge_group event.

Last but not least, this should fix Eval on PRs targeting `wip-`
branches and any other branches that the push event doesn't trigger on.
These would never find an Eval result from the target branch and could
never show rebuilds accurately. Now these PRs should work at a slightly
higher runtime cost.

(cherry picked from commit c1b06db57b)
2025-08-22 11:53:56 +00:00
Wolfgang Walther
b0e0a560da ci/github-script/commits: fix logging no-cherry-pick message
This has severity "important", which is not a `core` function. Falling
back to `core.info` for all unknown values now.

(cherry picked from commit 2257beb1d0)
2025-08-22 07:33:47 +00:00
Wolfgang Walther
cafd0bbe8a ci/github-script/commits: fix not-cherry-picked-because regex
This needs the multiline flags, which enables `^` and `$` to match line
start and line end, not start and end of the whole string.

Not sure how this got past testing when initially merged.

(cherry picked from commit 8ec348d644)
2025-08-22 07:33:47 +00:00
Matt Sturgeon
13605ada4d ci: disable aliases in CI's pkgs instance
This ensures we don't accidentally use aliases in the nixpkgs shell or
other places that depend on the CI-pinned pkgs instance.

Nixpkgs generally — and CI specifically — do not use aliases, because we
want to ensure they are not load-bearing and can be removed safely.

See: https://github.com/NixOS/nixpkgs/blob/ce9979ec1c/pkgs/top-level/release-outpaths.nix#L28
(cherry picked from commit f646e56d7a)
2025-08-21 17:36:46 +00:00
Matt Sturgeon
cbb2223908 ci: explicitly define programs.nixfmt.package
Currently treefmt-nix is still defaulting `programs.nixfmt.package` to
the `nixfmt-rfc-style` alias. This makes sense, as they do not know for
certain which revision of nixpkgs is in use.

We do know, however, so we can explicitly use the non-alias name.

(cherry picked from commit e981b17a96)
2025-08-21 17:36:46 +00:00
Matt Sturgeon
2c55a15c1e ci: reformat comment
Use one sentence per line.

(cherry picked from commit 1974b7e30c)
2025-08-21 17:36:46 +00:00
Wolfgang Walther
09a3e3cf18 ci/nixpkgs-vet: use Nix 2.30+ inside sandbox
This should fix the random symlink creation errors.

(cherry picked from commit 067ca97d1d)
2025-08-21 13:01:40 +00:00
Robert Hensing
02a696bccd ci,modules: Backport additions of #431450
Reason: keep ci directory in sync
- https://github.com/NixOS/nixpkgs/pull/431450#issuecomment-3209546418

This requires that we have a modules directory, in which case the
easy and robust solution is to only port the addition parts of the refactor.
It's about as easy as a .keep file, but more useful.

This means that some duplication is created, but we avoid backporting the
changes to the documentation generation, which is a somewhat complex
component I'd rather not touch until these changes have been proven out
on unstable.
2025-08-21 11:04:19 +02:00
Wolfgang Walther
a4251b7612 [Backport release-25.05] ci/github-script/prepare: move more steps from workflow (#435325) 2025-08-20 17:51:00 +00:00
FlameFlag
3d11e6cda5 treewide: donteatoreo -> FlameFlag 2025-08-20 20:39:33 +03:00
Wolfgang Walther
1e8419b52e ci/github-script/prepare: fix logging of branch classification
Logging objects to stdout is not possible with `core.info`, so we
fallback to `console.log` instead. There's no functional difference for
these anyway.

(cherry picked from commit f94fd64d53)
2025-08-20 16:58:11 +00:00
Wolfgang Walther
9b0135b347 ci/github-script/prepare: determine changed files
(cherry picked from commit 46a1b0a7bc)
2025-08-20 16:58:11 +00:00
Wolfgang Walther
5b61337620 ci/github-script/prepare: classify branches
(cherry picked from commit 4220a03df8)
2025-08-20 16:58:11 +00:00
Wolfgang Walther
51298d2e28 ci/github-script/prepare: load systems
(cherry picked from commit 9caf455441)
2025-08-20 16:58:11 +00:00
Wolfgang Walther
16321a259b ci/nixpkgs-vet: ignore .github/ and ci/ folders
nixpkgs-vet doesn't care about our CI infrastructure, so ignoring these
files will lead to more cache hits when iterating on CI related PRs.

(cherry picked from commit 4d996cfb2f)
2025-08-20 16:54:40 +00:00
Wolfgang Walther
053b8e38d6 ci/nixpkgs-vet: memoize filesets
Speeds up evaluation a bit, because `filtered head` doesn't need to be
evaluated 3x.

(cherry picked from commit c4fa63da49)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
1304c547d8 ci/treefmt: enable biome for doc/
(cherry picked from commit f668934bfd)
2025-08-20 16:34:19 +02:00
Wolfgang Walther
4fdb135006 ci/treefmt: add biome for .js files
This excludes doc and pkgs folders, because there are way too many files
to fix at the moment.

(cherry picked from commit 9d5164bdb8)
2025-08-20 16:33:44 +02:00
Wolfgang Walther
27c0126b67 ci: apply unsafe fixes with biome
(cherry picked from commit 23b82b3228)
2025-08-20 16:33:44 +02:00
Wolfgang Walther
e6d63110df ci: apply safe formatting with biome
(cherry picked from commit 1fa55d3900)
2025-08-20 16:33:41 +02:00
Wolfgang Walther
7511af4fc5 .editorconfig: two spaces for .js files
Most other scripting languages we use in tree have the same.

(cherry picked from commit 3d4c1c0d26)
2025-08-20 16:32:36 +02:00
Wolfgang Walther
64d1d69b9f ci/github-script/prepare: refactor
Using core.info instead of console.log and simplifying the arguments for
API calls a bit.

(cherry picked from commit a8cb53611b)
2025-08-20 13:22:29 +00:00
Wolfgang Walther
0fa17a8e6c ci/github-script/prepare: run biome
This will be added to treefmt in a different commit / PR.

(cherry picked from commit f5d3e43368)
2025-08-20 13:22:29 +00:00
Wolfgang Walther
b60acc12a9 ci/github-script/prepare: init from actions/get-merge-commit
This just moves the code over to ci/github-script to make it easy to
test and iterate on locally.

The name `prepare` is chosen, because the script will be extended with
the other steps from "PR / prepare" next.

(cherry picked from commit c787c66de6)
2025-08-20 13:22:29 +00:00
Wolfgang Walther
654a1c86cd ci/github-script/commits: conditionally show comments
This only shows *some* of the additional hints, depending on what the
checks resulted in. Should hopefully reduce confusion a bit.

(cherry picked from commit 91fd9b10ac)
2025-08-14 16:38:09 +00:00