Commit Graph

313 Commits

Author SHA1 Message Date
Wolfgang Walther
03907f2e0a ci/pinned: update
This gives us Nix 2.30 and nixfmt 1.0.0.

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

Changes for treefmt-nix:
a05be418a1...421b56313c

(cherry picked from commit 6f5663940c)
2025-07-24 14:58:17 +02:00
Wolfgang Walther
06fe78d83d ci/parse: raise minimum test to Nix 2.24
Nix 2.3 is marked as insecure and thus not cached anymore.

We'll either need to patch it and cache it again or drop it.

(cherry picked from commit ea970ff3be)
2025-07-24 14:58:16 +02:00
Wolfgang Walther
d3a5485375 workflows/build: build nixpkgs tarball
This adds a build job for the tarball, which might help uncover eval
issues on attributes not normally touched by Eval, aka those added in
`pkgs/top-level/packages-config.nix`.

(cherry picked from commit bfb20b9fea)
2025-07-24 10:34:29 +00:00
Silvan Mosberger
519e9a8aa1 ci/default.nix: nixfmt-rfc-style -> nixfmt
This was changed a tad early, technically it should have been changed
with the pinned nixpkgs for CI only.

(cherry picked from commit d1a4769b38)
2025-07-21 09:25:44 +02:00
Wolfgang Walther
58846dd9b2 ci/github-script/labels: limit cutoff to max 1 day
It has only happened once, but the GitHub API suddenly returned a
workflow run from a few weeks back. This lead to quickly hitting the
rate limit for search requests.

Prevent this from happening by going back a day max for the "recently
updated" case. After roughly a day, every PR will have been touched by
the regular batch processing anyway.

Also save a few API requests, by taking bigger chunks of the search
result.

(cherry picked from commit 7f9f7a20b0)
2025-07-21 06:13:49 +00:00
Wolfgang Walther
d68bf37d63 ci/github-script/commits: harden code block rendering
To avoid rendering issues when diffing a markdown file with these
markers in context, just increase the markers length.

(cherry picked from commit 524a47b2b4)
2025-07-20 19:28:43 +00:00
Wolfgang Walther
b10389b2ce Revert "ci/github-script/commits: keep formatting for diffs of markdown blocks"
This reverts commit b19798c8b0.

It lead to messed up formatting of the diff.

(cherry picked from commit 4a0c2c58a2)
2025-07-20 19:28:42 +00:00
Wolfgang Walther
414156afc5 ci/github-script/commits: shorten and clarify review comment
Also following the one-sentence-per-line rule now.

(cherry picked from commit 486756d85c)
2025-07-17 10:12:42 +00:00
Wolfgang Walther
6d867d1b0c ci/github-script/commits: fix job_url
This broke when we moved the check-cherry-picks workflow into the bigger
PR workflow. At this time, the "workflow run" became the whole PR
workflow, which includes many more than just 1 job, thus the assumption
in `jobs[0]` doesn't hold anymore.

(cherry picked from commit c4496912fd)
2025-07-17 10:12:42 +00:00
Wolfgang Walther
ca425fc98d ci/github-script/commits: block on errors
Most of the checks we do for cherry-picks are dismissable warnings, with
one exception: When a commit hash has been found, but this hash is not
available in any of the pickable branches, we raise this with
severity=error. This should also *block* the merge and not be
dismissable. That's because this is a fixable issue in every case.

(cherry picked from commit 1fbcad0434)
2025-07-17 10:12:42 +00:00
Wolfgang Walther
e2ac5f530c ci/github-script/commits: keep formatting for diffs of markdown blocks
Previously, when the diff contained a context line with ```, this would
end the code block and entirely break the markdown rendering.

Now we use the html code blocks provided by `core.summary` and properly
escape the content, so that it never escapes via html tags.

(cherry picked from commit b19798c8b0)
2025-07-17 10:12:42 +00:00
Wolfgang Walther
a11220895f ci/github-script/commits: ignore whitespace on diff
This reduces noise that the cherry-pick reviews produce when formatting
related conflicts had to be resolved. We only do this in the
length-limited review comment, though. All changes, including
whitespace, can still be double-checked in the job log if needed.

(cherry picked from commit 40dcbb1483)
2025-07-17 10:12:42 +00:00
Wolfgang Walther
4ff7ede9c2 ci/github-script/commits: add comment about --creation-factor
(cherry picked from commit 84925b35c4)
2025-07-17 10:12:41 +00:00
Wolfgang Walther
7f19a6e408 ci/github-script/commits: init from ci/check-cherry-picks
This turns the check-cherry-pick script into a github-script based
JavaScript program. This makes it much easier to extend to check reverts
or merge commits later on.

(cherry picked from commit b46cb23251)
2025-07-16 10:26:08 +00:00
Wolfgang Walther
b028a6e7b3 ci/github-script: use real @actions/core
This allows building markdown summaries, which is hard to mock.

(cherry picked from commit 2433050fb7)
2025-07-16 10:26:08 +00:00
Wolfgang Walther
d86a012852 ci/github-script: add gh dependency to dev shell
(cherry picked from commit cdd1931ace)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
1f03cc9d69 ci/github-script: allow running without dry mode
(cherry picked from commit d71b8c3680)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
e08df86618 ci/github-script: allow running for single PR
Makes specific tests in the upstream repo easier to do.

(cherry picked from commit 97d4103946)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
383a849bd4 ci/github-script: extract common withRateLimit.js
This can and should be re-used across different scripts.

(cherry picked from commit 2192c5b6e8)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
6f32a5f04e ci/github-script: default to commonjs
Since all github-scripts need to be written in commonjs, we now default
to it by not setting package.json. Support from editors for .js files is
slightly better than .cjs. To still allow using module imports in the
test runner script, we trick node into loading the script itself as a
module again via `--import ./run`.

(cherry picked from commit d11eba1e1d)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
3d3afc9d32 ci/github-script: add commander CLI interface
This makes it easier to add additional features.

(cherry picked from commit aaaabe0cb7)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
d202219502 ci/github-script: move from ci/labels
This just moves things around to use less specific naming - `labels` is
only *one* script that can potentially be run locally while still being
written in github-script. Later, we can add more.

(cherry picked from commit 6f6c625026)
2025-07-15 12:57:57 +00:00
Wolfgang Walther
a0eb10eded workflows/labels: label rebuilds immediately
This fixes labeling in the context of the `pull_request` trigger. Of
course, this was supposed to immediately label rebuilds after eval
finishes, but we somehow lost this along the way. Rebuilds are still
labeled fairly soon, because the scheduled trigger will pick up the same
PR within 10 minutes again and then apply the rebuild labels. But of
course, immediate is better.

The reason this happened is, that we're looking at `item.pull_request`
only. This is the correct distinction between "issue items" and "pull
request items", which we both get back from the /issues endpoint. But
the payload for the `pull_request*` event doesn't contain this, so
labeling in this case was treated like an issue and skipped the whole
pull request part.

(cherry picked from commit acf5bc2417)
2025-07-12 14:37:28 +00:00
Wolfgang Walther
d27bd954e6 ci/labels: run in dry mode locally
To avoid mistakes when developing and testing against the upstream repo.

(cherry picked from commit dd8357185a)
2025-07-09 07:07:33 +00:00
Wolfgang Walther
4c421bc805 ci/labels: run prettier
This is the result of:

  prettier --no-semi --single-quote

(cherry picked from commit 9936e7d751)
2025-07-09 07:07:33 +00:00
Wolfgang Walther
79af7b5419 ci/labels: init from workflows/labels
Moves the labels job into a separate ci/ subfolder to run it locally.
This eases debugging *a lot*.

(cherry picked from commit 89ee8975ab)
2025-07-09 07:07:29 +00:00
Alyssa Ross
b5ba0055ef nixVersions.nix_2_3: add knownVulnerabilities
(cherry picked from commit a61841a597)
2025-06-30 10:39:18 +02:00
Wolfgang Walther
51f994d5b5 ci/eval/README.md: one sentence per line
(cherry picked from commit 60e35e4ded)
2025-06-29 21:35:58 +02:00
Wolfgang Walther
8d80a5164f ci/README.md: one sentence per line
(cherry picked from commit 99f2e655d9)
2025-06-29 21:35:55 +02:00
Wolfgang Walther
628b1a0d17 ci/check-cherry-picks: fix chained cherry-picks
When backporting a PR from master -> 25.05 -> 24.11 in a chain, the last
cherry-pick will have two references to different commits in it. If
there was conflict resolution in the first step, the diff will show up
again in the last step. This can be fixed by comparing against the right
hash - always the last one.

(cherry picked from commit df5b98a38c)
2025-06-27 15:04:40 +00:00
Alyssa Ross
6758d924b1 ci/OWNERS: add kernel team to relevant files
This should prevent situations like
https://github.com/NixOS/nixpkgs/pull/389291 in future where a new
kernel variant was added without any discussion with the kernel team.

(cherry picked from commit 1fa650463c)
2025-06-23 15:29:22 +00:00
Wolfgang Walther
9a42b59630 workflows/pr: refactor base/head branch decision making
Some jobs purposefully only run on certain base or head branches. By
centralizing the logic, parts of it can easily be re-used later. Also,
this gives them an explicit name and thus makes them easier to
understand.

(cherry picked from commit 7763be5a80)
2025-06-23 10:54:39 +00:00
Matt Sturgeon
114ac8bdbc ci/eval: fix comparing to null in getLabels
Check if `to` is null _before_ comparing it to `rebuildCount`.

(cherry picked from commit 7c7009a3da)
2025-06-22 19:41:57 +00:00
Wolfgang Walther
6346ef5210 workflows/labels: manage labels with a single API call
Instead of deleting each label separately and then making another call
to add new labels, this replaces all labels at once, thus saving API
calls in some cases. Also, the labels are now managed in object-style
compared to the array-style before. This allows putting all the
knowledge about each label into a single place instead of in multiple
places. For example, the rebuild labels had to be special cased in the
workflow before - and the nix code to compare had to match that. Also,
the approval labels had to be considered in the `before` and `after`
phases.

The next commit shows how easy it is to add a new label now.

(cherry picked from commit 5b5b18c875)
2025-06-22 16:37:36 +00:00
Wolfgang Walther
42fdf6c64d ci/eval/compare: fix rebuild-stdenv labels
Those have not been working since before the migration from OfBorg.
Those `rebuildsByKernel` are an attrset of lists coming from
`groupByKernel` (also see lengthy comment at the top of the file) - thus
we need `lib.elem` instead.

(cherry picked from commit 19ce5d94bc)
2025-06-21 11:39:30 +00:00
Wolfgang Walther
4884e604c3 teams/ci: init
(cherry picked from commit ec9986a919)
2025-06-20 12:00:51 +00:00
Wolfgang Walther
ff2fdeac36 OWNERS: drop security team from CI
To reduce the number of notifications.

(cherry picked from commit a2404e557b)
2025-06-20 12:00:51 +00:00
Wolfgang Walther
a37a28a4c7 ci/treefmt: add yamlfmt
Most workflow files are already well formatted, but to make it easier to
keep it that way, we can add yamlfmt.

I personally have a preference for non-indented arrays for YAML, but
wanted to avoid bigger diffs here - the status-quo clearly are indented
arrays.

Some changes are made manually to the get-merge-commit action and the
issue templates. Those would otherwise make yamlfmt misbehave on those.

(cherry picked from commit 8ec23df6f6)
2025-06-15 12:27:21 +02:00
Philip Taron
981924ba78 [Backport release-25.05] ci/pinned: update (#416803) 2025-06-14 14:24:42 -07:00
Philip Taron
df220d62fa [Backport release-25.05] arrayUtilities: init (#416144) 2025-06-14 14:23:35 -07:00
Wolfgang Walther
e1e48057d7 ci/pinned: update
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:
1f3f7b7846...a05be418a1

(cherry picked from commit a9589ea037)
2025-06-14 21:18:20 +00:00
Wolfgang Walther
c6908fc8f0 OWNERS: simplify workflow/ci owners
The current setup causes the Security team and the other owners of
.github/workflows to **not** be pinged for the
check-format/codeowners-v2/nixpkgs-vet workflows. This was highly likely
unintended when adding those additional rules, so removing them.

Also, we have some owners looking after `workflows/`, but not `ci/` -
and some the other way around. This doesn't make much sense to me, since
both parts depend on each other very much.

(cherry picked from commit b98e7bb95a)
2025-06-13 10:28:27 +00:00
Emily
b998027af5 OWNERS: add more standard environment–related libraries
I think it makes sense for the `stdenv` team to handle review of
changes to these libraries that have substantial effects on the
things in their scope, like the semantics of `stdenv.mkDerivation`,
override interfaces, `meta` handling, and so on. This is already how
`lib/systems/` is handled, and it makes sense to me to extend it.

This would hopefully have helped avoid situations
like <https://github.com/NixOS/nixpkgs/pull/403678> and
<https://github.com/NixOS/nixpkgs/pull/410179>, where the `stdenv`
team was unaware of the original change for weeks.

(cherry picked from commit 1015c45b0e)
2025-06-12 20:27:37 +00:00
Wolfgang Walther
d7722731d3 ci/nixpkgs-vet.sh: fix passing arguments
It currently fails with this:

```
error: lib.fileset.toSource: `root`
(/tmp/nix-shell-19054-0/tmp.MB62qzBqsj/base) is a string-like value, but
it should be a path instead.
   Paths in strings are not supported by `lib.fileset`, use
`lib.sources` or derivations instead.
```

Resolves #416175

(cherry picked from commit 36b76b4141)
2025-06-12 19:06:23 +00:00
Connor Baker
589dde029e arrayUtilities: init
Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
(cherry picked from commit 38a8232461)
2025-06-12 13:26:49 +00:00
Jade Lovelace
baf024b092 ci/eval: accept nix directly
Previously we were taking nixVersions and this made external use from
the Lix repo's CI annoying.

We should probably also test other nix versions than stable (i.e. also
latest and Lix), but this involves writing GitHub Actions about it and
maybe not running it on every single PR. Future work.

(cherry picked from commit 332bc64369)
2025-06-10 23:33:09 +00:00
Wolfgang Walther
db0afbb469 ci/nixpkgs-vet: add badFiles and conflictingPaths checks
Those checks are part of top-level/nixpkgs-basic-release-checks.nix, but
can be run in CI already to prevent regressions. The idea is to upstream
them into nixpkgs-vet eventually, but we can just as well run them as-is
in the same derivation already.

(cherry picked from commit 247d562379)
2025-06-10 13:20:40 +00:00
Wolfgang Walther
3b6a9f83f1 ci/check-cherry-picks: fix indent of truncation marker
This needs to be indented the same way as the remaining code-block,
otherwise the `</details>` is not rendered correctly.

(cherry picked from commit ca5775952e)
2025-06-09 11:25:21 +00:00
Wolfgang Walther
b87b33e73f ci/nixpkgs-vet: fix random errors
Every now and then, the nixpkgs-vet CI job currently fails with one of:

  error: creating symlink
'/build/.local/share/nix/root/nix/var/nix/gcroots/profiles' ->
'/build/.local/share/nix/root/nix/var/nix/profiles': File exists

  error: SQLite database
'/build/.local/share/nix/root/nix/var/nix/db/db.sqlite' is busy

It's hard to reproduce for me, so just taking a guess with the required
changes.

(cherry picked from commit 3dd14d8a51)
2025-06-02 19:50:08 +00:00
Wolfgang Walther
473f384eed ci/pinned: update
From the nixpkgs-unstable channel:
https://hydra.nixos.org/eval/1815701#tabs-inputs

(cherry picked from commit f0923df7f5)
2025-06-02 15:55:19 +00:00