Commit Graph

788 Commits

Author SHA1 Message Date
Wolfgang Walther
d1bb35448a workflows/pr: fix condition for no-pr-failures job
The `cancelled()` condition seems to only apply when *the whole
workflow* was cancelled. This is not the case when a single job is
cancelled due to timeout.

We can replicate this by checking each needs.result manually.
2025-08-12 15:39:12 +02:00
Wolfgang Walther
17b1c6cb3d workflows/check: allow more time for check cherry picks job
This currently times out after 3 minutes. Give it a bit more time. 10
minutes might be excessive, but we only really want to guard against a
stuck job taking 6 hours.
2025-08-12 14:08:48 +02:00
Wolfgang Walther
06f574addf workflows/pr: block merging PRs when jobs have been cancelled
This currently happens, for still unknown reasons, for the "check cherry
picks" job. The job gets cancelled by GHA mid-way. This should be the
same as an error, because an important check didn't run: Merging should
be blocked and auto-merge should not succeed.
2025-08-12 13:06:09 +02:00
Wolfgang Walther
372d9eeeaf workflows/backport: fix token permissions (#433035) 2025-08-12 09:17:37 +00:00
Wolfgang Walther
267d5cdf64 workflows/eval: fix compare job not running
The conclusion of the `versions` job propagates from through `eval` to
`compare`, which meant the `compare` job was skipped. No rebuild labels,
no reviewer requests.

Also, we don't want to run eval when `versions` runs, but fails.
2025-08-12 10:58:45 +02:00
Wolfgang Walther
bb1529ef6a workflows/backport: fix token permissions
The additional `workflows` permissions are required to backport
Dependabot updates. The permissions had been added to the app a while
ago, but we forgot to actually use them.
2025-08-12 10:30:03 +02:00
Wolfgang Walther
b523f257ac 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.
2025-08-12 10:14:01 +02:00
Wolfgang Walther
51e6b0e40b workflows: fix actions/download-artifact hashes
The Dependabot update change the hashes to the latest main branch commit
instead of the v5.0.0 tag - also it didn't adjust the tags in the
comments accordingly. Last but not least, one of the references used a
`@v5` reference instead of the commit hash. The latter is probably what
Dependabot tripped on.
2025-08-12 10:13:55 +02:00
Wolfgang Walther
56d29bbae1 workflows/build: build shells on a single darwin runner only
Because we have Rosetta, we can use a single darwin runner to build both
shells. Most time is spent for downloading Nix and checking out Nixpkgs
anyway and this can be saved if only run once.

Also, this prepares for the deprecation of the old macos-13 runners,
which were based on x86_64 CPUs in September 2025:
https://github.blog/changelog/2025-07-11-upcoming-changes-to-macos-hosted-runners-macos-latest-migration-and-xcode-support-policy-updates/
2025-08-11 18:05:20 +02:00
Wolfgang Walther
f105ab12f6 workflows/build: avoid downloading from cachix
This avoids downloading results from cachix, when they don't need to be
rebuilt, which just wastes time and resources.
2025-08-11 18:05:18 +02:00
Wolfgang Walther
8a9f0b8a47 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.
2025-08-11 17:57:11 +02:00
Wolfgang Walther
de7aa9f213 workflows: remove extra_nix_config.sandbox
This is true by default anyway.
2025-08-11 17:54:13 +02:00
Wolfgang Walther
da4839720b build(deps): bump actions/create-github-app-token from 2.0.6 to 2.1.0 (#432840) 2025-08-11 15:43:00 +00:00
Wolfgang Walther
5e304bcc37 build(deps): bump actions/checkout from 4.2.2 to 5.0.0 (#432842) 2025-08-11 15:33:46 +00:00
Wolfgang Walther
e86d3828cf build(deps): bump actions/download-artifact from 4 to 5 (#432841) 2025-08-11 15:33:35 +00:00
dependabot[bot]
b455a0a294 build(deps): bump cachix/install-nix-action from 31.4.1 to 31.5.2
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.4.1 to 31.5.2.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](f0fe604f8a...fc6e360bed)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.5.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 15:07:05 +00:00
dependabot[bot]
593aee095f build(deps): bump actions/checkout from 4.2.2 to 5.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 15:06:58 +00:00
dependabot[bot]
c44f3e4699 build(deps): bump actions/download-artifact from 4 to 5
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 15:06:46 +00:00
dependabot[bot]
d1d2650cba build(deps): bump actions/create-github-app-token from 2.0.6 to 2.1.0
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.0.6 to 2.1.0.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](df432ceedc...0f859bf9e6)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 2.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-11 15:06:38 +00:00
Wolfgang Walther
a2a9984ed9 workflows/pr: run in pull_request context to test actions/get-merge-commit
This must run in the pull_request context, otherwise changes to the
actions are not tested.
2025-08-10 16:22:46 +02:00
Wolfgang Walther
436d54174d .github/workflows: set timeouts
None of our jobs is expected to run for 6 hours, the GitHub limit. These
limits are generous and take into accounts that some jobs need to wait
for others.

If jobs exceed these times, most likely something else is wrong and
needs investigation.
2025-08-09 17:26:03 +02:00
Wolfgang Walther
9cde368b4c Revert "workflows/eval: disable swap"
This reverts commit f2648b263b.

While the idea to never use swap was fine, in practice this meant that
when nix ran OOM, some other process was killed instead. This lead to
the job not being possible to be cancelled anymore and thus needing to
timeout, before subsequent jobs could be scheduled. This can take up to
6 hours for GitHub Actions by default.

Re-enabling the swap file to catch this case more gracefully. It's still
the goal to never actually *use* the swap file during Eval and just a
safeguard.

Keeping the changed chunkSize and not reverting it - this makes it
slightly less likely to hit the swap file when running with Lix.
2025-08-09 17:25:58 +02:00
Wolfgang Walther
f2648b263b workflows/eval: disable swap
Recent performance tests show that (a) swapping heavily slows down the
Eval job, while (b) lowering the chunkSize does not have an effect on
run-time. It does on memory usage, though - thus we can get rid of
swapping entirely by reducing chunkSize respectively.
2025-08-06 14:40:30 +02:00
Wolfgang Walther
04c039f993 workflows/merge-group: init
Introduces a basic merge queue workflow to initially only run lints.
This will avoid accidentally merging changes which break nixfmt after
its recent update to 1.0.0.
2025-08-05 15:27:45 +02:00
Wolfgang Walther
bfb20b9fea 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`.
2025-07-24 09:50:39 +02:00
Wolfgang Walther
1fbcad0434 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.
2025-07-16 15:47:17 +02:00
Wolfgang Walther
b46cb23251 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.
2025-07-16 11:50:13 +02:00
Wolfgang Walther
d11eba1e1d 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`.
2025-07-14 10:35:18 +02:00
Wolfgang Walther
6f6c625026 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.
2025-07-14 10:35:13 +02:00
Wolfgang Walther
58a3001a3a workflows/backport: fix concurrent jobs cancelling each other
When a PR is merged and labeled afterwards - with a non-backport label -
the following will happen:
- The first backport job is triggered on the merge.
- The second backport job is triggered on the label event.
- The second job will cancel the first one due to the concurrency group.
- The second job will cancel itself because the label event didn't
contain a backport label.

Both jobs end up cancelled and no backport happens.

We made the backport action idempotent upstream a while ago, so we don't
need to cancel those actions. Instead, we'll run all of them -
subsequent actions running through will just stay silent anyway.
2025-07-12 16:33:33 +02:00
Michael Daniels
261bba1fcd workflows/build: be clearer about what is being built
Committers could get the false impression from, e.g., `PR / Build / aarch64-linux` that this workflow builds the packages changed in the current PR. Such a misunderstanding could pair poorly with the "enable auto-merge" button, once that's enabled.
2025-07-11 10:25:45 -04:00
Wolfgang Walther
dd8357185a ci/labels: run in dry mode locally
To avoid mistakes when developing and testing against the upstream repo.
2025-07-08 17:05:22 +02:00
Wolfgang Walther
89ee8975ab ci/labels: init from workflows/labels
Moves the labels job into a separate ci/ subfolder to run it locally.
This eases debugging *a lot*.
2025-07-08 17:05:13 +02:00
Wolfgang Walther
e90c62d5ab workflows/labels: small refactor
To avoid having a diff when moving the file in the next commit.
2025-07-07 21:43:04 +02:00
Wolfgang Walther
7900a1618f workflows/labels: manage "needs: reviewer" label
This label allows finding pull requests which have no reviewer
requested, yet.
2025-07-04 10:25:07 +02:00
Wolfgang Walther
06a88df620 workflows/labels: paginate with cursor
Pagination via cursor is required above 10k items. To do so, we store
the current cursor as an artifact and read it back in in the next
scheduled run.
2025-07-03 09:59:18 +02:00
Wolfgang Walther
23a32c9445 Reapply "workflows/labels: label stale issues"
This reverts commit c18e94361e.
2025-07-02 16:36:58 +02:00
Wolfgang Walther
c18e94361e Revert "workflows/labels: label stale issues" 2025-07-01 19:28:31 +00:00
Wolfgang Walther
dc8047c82d workflows/labels: label stale issues (#419878) 2025-07-01 19:08:13 +00:00
Leona Maroni
30ddfbb7c6 workflows/periodic-merge: remove 24.11
24.11 is deprecated now.
2025-07-01 14:47:30 +02:00
Wolfgang Walther
3d505c0361 .github/workflows/README.md: one sentence per line 2025-06-29 21:14:34 +02:00
Wolfgang Walther
2fa1151e54 workflows/labels: label stale issues
By re-organizing the flow in `handle()` we can start labeling both
issues and pull requests, and only make the relevant API requests for
the PR-case.

At first glance, we might think that we only need to label the big batch
list of issues and not those recently updated: But that's wrong, for
recently updated issues it's important to label quickly, because the
stale label needs to be *removed*, too.
2025-06-27 12:09:41 +02:00
Wolfgang Walther
1818027916 workflows/labels: retry on transient API failures
Currently, the labels job fails a few times each day with network
failures. Retrying the requests should help.
2025-06-27 09:15:22 +02:00
Wolfgang Walther
3be9e2afc1 workflows/labels: label rebuilds on failed PR workflow
We already tried to fix this case earlier, but didn't account for all
cases: A scheduled workflow can also encounter a pull request with
failed PR workflow. This failure doesn't need to be in the Eval part, so
artifacts could *still* be available. To make sure PRs always get
rebuild labels, just ignore the status condition. Either the artifact is
there, or it is not.
2025-06-27 09:14:01 +02:00
Wolfgang Walther
4e9df2fc31 workflows/labels: slightly improve logging 2025-06-27 09:14:01 +02:00
Wolfgang Walther
10c63e5117 workflows/labels: fix processing the 100 oldest PRs
The `page` number is 1-based, but the remainder might very well be 0.
This lead to not looking at the 100 oldest PRs, ever.
2025-06-27 09:13:58 +02:00
Wolfgang Walther
de8f3e2cbf workflows/backport: korthout/backport-action: 3.2.0 -> 3.2.1
Release Notes:
https://github.com/korthout/backport-action/releases/tag/v3.2.1

This should many of the annoying, duplicated error messages that the
backport action comments.
2025-06-26 14:58:32 +02:00
Wolfgang Walther
59ac9479e4 workflows/labels: fix merge conflict label
The previous implementation had two problems:
- When switching from /search to /pulls, we disabled the additional GET
on each single pull request - which causes no test merge commit creation
for all PRs. This means, merge conflicts will not actually be detected.
- By using `item` in the pull-request triggered case, this goes back to
`context.payload.pull_request`, which is the state *at the beginning* of
the workflow run. But this renders our "let's wait 3 minutes before
checking merge_commit_sha" logic void. While we wait for 3 minutes, we
still use the *old* value afterwards...

Just making the extra request every time simplifies the logic and solves
both problems.
2025-06-25 12:30:10 +02:00
Wolfgang Walther
c9257371dc workflows/labels: fix stale label date sorting
With the help of:
https://stackabuse.com/how-to-sort-an-array-by-date-in-javascript/
2025-06-25 09:44:33 +02:00
Wolfgang Walther
75362c6510 Reapply "workflows/labels: manage stale & merge conflict labels" (#419654) 2025-06-25 07:06:15 +00:00