Commit Graph

346 Commits

Author SHA1 Message Date
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
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
Wolfgang Walther
0d3ebd9fae ci/github-script/commits: clarify comments
Splits the "occasionally" case into two, depending on whether the commit
has a diff or was not cherry-picked at all. Prepares the next commit,
where these are conditionally shown only.

(cherry picked from commit 2f8ed18c97)
2025-08-14 16:38:09 +00:00
Wolfgang Walther
f0dedca934 ci/github-script/commits: allow reason for not cherry-picking
This change allows giving a reason via footer of the commit message for
why this commit is not cherry-picked. This avoids having to "explain"
the automated review comment afterwards - instead, this explanation can
be given immediately when writing that commit.

For example, for an update of `xen` on the stable branch, this could be:

```
xen: 4.19.3-unstable-2025-07-09 -> 4.19.3

[... commit message ...]

Not-cherry-picked-because: unstable is on a different minor version
```

This would then be shown as part of the automated review. The severity
of this will be downgraded from "warning" to "important". We still treat
the review as "changes requested", because it would be very complicated
and noisy to handle two different categories of reviews, some with
requested changes and some with comments only.

An alternative would be to not show this review at all. However, given
that the reviewers expectation on backports should already be "if it's
not a clean backport, the automated review will tell me what to look
at", it seems better to show these and have the committer confirm by
dismissing the review. Otherwise we risk merging actually unreviewed
commits.

(cherry picked from commit bf3607aa87)
2025-08-14 16:38:09 +00:00
Wolfgang Walther
3ef8956f74 workflows/check: use regular checkout
The filtered checkout we used before was a nice idea, but only worked
for small numbers of commits in a PR. It would fetch the whole history
initially, but only fetch objects on demand. This turns out to be much
too slow in a PR with 18 commits, regularly hitting the 10 minute
timeout, even when running it locally.

The new approach uses regular checkouts again. In contrast to the old
style, before we switched to the filtered checkout, this only fetches
exactly the commits we need - and all of them at once. This is
significantly faster than both other approaches, and scales much better.
A bigger number of commits doesn't have much of an effect, if any at
all.

(cherry picked from commit 0dff5ad6c5)
2025-08-13 19:15:10 +00:00
Wolfgang Walther
f05c8ddfd7 ci/default: remove insecure Nix 2.3 config
Nix 2.3 has been removed on unstable and is not used by CI anymore, thus
we don't need the custom config for it anymore.

(cherry picked from commit fa0cba1c39)
2025-08-12 19:22:32 +02:00
Wolfgang Walther
c6efa35204 lib/tests: don't test with Nix 2.3 anymore
The `nixVersions.minimum` alias has been removed on unstable, so the
TODO is not needed anymore.

The lib tests can't be run with Nix 2.3 anymore, because this version is
not available on unstable anymore - and thus also not in the pinned
nixpkgs that CI is run with.

(cherry picked from commit cc3d2295b6)
2025-08-12 19:22:29 +02:00
Wolfgang Walther
ad0e8bc190 ci/pinned: update
This gives us a fixed `lixPackageSets.git`.

From the nixpkgs-unstable channel:
https://hydra.nixos.org/build/304569381#tabs-buildinputs

Changes for treefmt-nix:
58bd4da459...7d81f6fb2e

(cherry picked from commit 14a6d9de46)
2025-08-12 08:22:54 +00:00
Wolfgang Walther
0262bcddf2 workflows/eval: test all available versions
With this change, we start running Eval on all available Lix and Nix
versions. Because this requires a lot of resources, this complete test
is only run when `ci/pinned.json` is updated.

The resulting outpaths are checked for consistency with the target
branch. A difference will cause the `report` job to fail, thus blocking
the merge, ensuring Eval consistency for Nixpkgs across different
versions.

This implements a kind of "ratchet style" check: Since we originally
confirmed that the versions currently in Nixpkgs at the time of this
commit match Eval behavior of Nix 2.3, we can ensure consistency with
Nix 2.3 down the road, even without testing for it explicitly.

There had been one regression in Eval consistency for Nix between 2.18
and 2.24 - two tests in `tests.devShellTools` produce different results
between Lix 2.91+ (which was forked from Nix 2.18) and Nix 2.24+. I
assume it's unlikely that such a change would be "fixed" by now, thus I
added an exception for these.

As a bonus, we also present the total time in seconds it takes for Eval
to complete for every tested version in a summary table. This allows us
to easily see performance improvements for Eval due to version updates.
At this stage, this time only includes the "outpaths" step of Eval, but
not the generation of attrpaths beforehand.

(cherry picked from commit b523f257ac)
2025-08-12 08:22:54 +00:00
Wolfgang Walther
446ff34e11 ci/eval/compare: reorder step summary
Move "Packages" up, because it's much shorter and easier to scroll past.
This way both Packages and Performance are visible immediately.

(cherry picked from commit f05895fb3c)
2025-08-12 08:22:54 +00:00
Wolfgang Walther
06c8d5c918 workflows: checkout pinned nixpkgs explicitly
This is slightly faster than downloading and extracting a tarball and
additionally allows a sparse checkout. No need to download docs or nixos
for our purpose.

The data is quite noisy, but suggests improvements from anywhere between
5-15 seconds for each job using the pinned nixpkgs.

(cherry picked from commit 8a9f0b8a47)
2025-08-11 16:04:16 +00:00
Wolfgang Walther
41fff04d29 ci/eval: use sane defaults
Using these defaults makes it possible to just run `nix-build ci -A
eval.singleSystem` without passing additional arguments and get a sane
result back. Especially helpful when testing or debugging.

A `chunkSize` of 5000 is conservative to be able to run on systems with
less memory as well. Run-time is not impacted by that, as recent
benchmarks show.

(cherry picked from commit 75f40a150c)
2025-08-09 10:01:51 +00:00
Wolfgang Walther
174299e35d ci/eval: reduce closure size
`procps` pulls in 180 MB of systemd, but busybox also provides `kill`.
`busybox` also ships `time`, so no need for that extra dependency.

Using `nativeBuildInputs` pulls in all the -dev outputs of the listed
packages - which we don't need. We only need to run these tools, thus
map to their bin outputs.

Brings down the closure size from 500+ MB to 193 MB for the Eval job.
This probably saves ~10 seconds for the job.

(cherry picked from commit 5c697b8aea)
2025-08-09 10:01:51 +00:00
Wolfgang Walther
2247d44f7e ci/eval: return min memory in megabyte
No need to return bytes in these files. Also busybox has problems to
render `free -b` with sizes > 100 GB properly in the next commit,
leading to extraction errors with awk.

(cherry picked from commit cb527a04e0)
2025-08-09 10:01:51 +00:00
Wolfgang Walther
037db9a08a ci/eval: fix min-free-swap report
This was checking the wrong condition, likely from a copy&pasto.

(cherry picked from commit 0a59445722)
2025-08-09 10:01:51 +00:00
Wolfgang Walther
721e6c731f ci/eval/compare: don't treat renames as rebuilds
When a package's attrpath is renamed it is currently treated as a
rebuild, even though the outpath already exists and is already cached.

This also happens when adding new names for packagesets that already
exist, for example when starting to eval `perlPackages` in CI, which is
just the same as `perl540Packages` currently. It would also happen when
`perlPackages` is switched from `perl540Packages` to `perl999Packages`.
Assuming that `perl999Packages` had already been built before, this
doesn't really cause any rebuilds.

(cherry picked from commit c5c7cd5bc7)
2025-08-06 19:22:31 +00:00
Wolfgang Walther
370d67848b ci/treefmt: add markdown-code-runner
This was run as a test in `doc/tests/check-nix-code-blocks.nix` before,
but its DX can be improved: By including it in `treefmt` we get better
error reporting and auto-fixing, as well as running it on *all* markdown
files (including READMEs etc.) for free.

(cherry picked from commit a7b3b2584a)
2025-08-05 20:14:31 +02:00
Wolfgang Walther
2ef4c0aa1e ci/tarball: build with Nix 2.30
We had to avoid 2.28 / 2.29 due to performance regressions, but this
should work well again with Nix 2.30.

(cherry picked from commit 6884dd65da)
2025-08-05 14:05:38 +00:00
Wolfgang Walther
dfd4c4402d ci/pinned: update
This gives us Nix 2.30 as `nixVersions.latest`, which enables it for
Eval in CI automatically.

It also gives us markdown-code-runner 0.2.0, which allows it to run with
treefmt.

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

Changes for treefmt-nix:
421b56313c...58bd4da459

(cherry picked from commit 492225f4f7)
2025-08-05 14:05:38 +00:00
Martin Weinelt
7d447ae402 ci/OWNERS: reduce firefox package ownership
This reduces my codeownership to Firefox Rapid, ESR and the update
script. My hope is that will reduce my notification fatigue on Firefox
Beta/Devedition PRs that I needlessly get requested to.

(cherry picked from commit 4a59c529e5)
2025-07-30 17:45:52 +02:00
Martin Weinelt
5e5ce5fcc7 buildMozillaMach: migrate into build-support
The builder has multiple consumers, so it is fine to separate it from
Firefox, but the main motivation is to separate code ownership between
the builder and individual firefox versions.

(cherry picked from commit 0026f50279)
2025-07-30 17:45:51 +02:00
Wolfgang Walther
4801056ba2 top-level/release-outpaths-parallel: rename from top-level/release-attrpaths-parallel
This file takes attrpaths as input and returns chunks of derivations,
aka a subset of release-outpaths - while release-attrpaths-superset
returns only an attrpath, not any derivations.

Thus, as a specialization of release-outpaths, the name
release-outpaths-parallel matches much better.

(cherry picked from commit 4ad7d21c88)
2025-07-24 22:12:50 +02:00
Wolfgang Walther
7d0fe09b35 ci/eval: fail on asserts when generating attrpaths
This doesn't fail on *all* asserts, yet, because nix-env still ignores
these in the main eval step. But it already gives some converage during
the attrpath generation.

(cherry picked from commit 30f19cce69)
2025-07-24 19:36:37 +00:00
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