Commit Graph

86 Commits

Author SHA1 Message Date
Wolfgang Walther
e571df5faa workflows/eval: drop process job
Since process doesn't need to run on push events anymore, we can just as
well remove it entirely. The little bit of combine and comparison can be
done in the tag job, even with elevated privileges. That's because those
parts can be done entirely from the target commit, which is trusted.

This saves startup, installing nix, downloading tools and artifacts for
one job. It saves about 1 minute per run, start to finish.

(cherry picked from commit b942fb47dc)
2025-05-25 19:05:43 +00:00
Wolfgang Walther
edd12277b0 workflows/eval: diff outpaths immediately
This moves the diff of outpaths into the outpaths job, mainly as a
preparation to allow future improvements. For example, this will allow
running the purity release checks only on changed outpaths instead of
the whole eval.

This also removes the inefficiency introduced in the last commit about
uploading the intermediate paths twice. Now, only the diff is passed on.

Also, technically, the diff is now run in parallel across 4 jobs. This
should be *slightly* faster than before, where outpaths from all systems
were combined first and then diffed. It's probably only a few seconds,
though.

(cherry picked from commit 8a39ce4a48)
2025-05-25 19:05:43 +00:00
Wolfgang Walther
ff672eb37f workflows/eval: fetch target results in outpaths job
This is an intermediate step towards more efficiency. At this stage, the
outpaths job pulls the result from the matching outpaths job on the
target branch and uploads both results together. The process job then
downloads both results at once and does the comparison as usual.

This is slightly more inefficient, because the intermediate results are
essentially stored as artifacts twice. But that inefficiency will go
away in the next step, this refactor is split to make it slightly more
reviewable and testable.

On the other side, this allows us to save the process job on push events
entirely, which is a win, because most of it is setup and nix download
anyway.

(cherry picked from commit a6b659b08a)
2025-05-25 19:05:43 +00:00
Wolfgang Walther
66591fe03f workflows/eval: run trusted code in process step
We don't really need to run the combine and comparison steps from the
untrusted merge commit. By switching to the trusted target commit, we
can avoid adding another worktree - and lay the foundation to later do
those steps in the tag job, which has access to secrets.

(cherry picked from commit 13f5aa304e)
2025-05-25 19:05:42 +00:00
Wolfgang Walther
2614df1e9a workflows/eval: consistently avoid "result" in arguments
Everything is a result, especially when nix-build uses "result" as its
default output. This becomes confusing, when re-wiring the different
parts later.

Thus, consistently name those things after some of their properties and
avoid the term result.

(cherry picked from commit b2579d36ff)
2025-05-25 19:05:42 +00:00
Wolfgang Walther
a55f7ddced workflows: checkout nixpkgs into trusted/untrusted directories
By consistently checking out nixpkgs into the same location in every
workflow, it's easier to reason about the different workflows at once.
We also use crystal-clear names to make clear, which checkouts are
considered trusted, because they only contain target-branch-code and
which checkouts are untrusted, because they contain code from the head
branch. By naming the checkout directories trusted/untrusted, it's
obvious at the call-site.

One example of where we likely did the wrong thing is the nixpkgs-vet
workflow: Fetching the toolVersion from the untrusted checkout opens the
door for an injection into the download URL, thus code could be
downloaded from anywhere. This is not a problem, because this workflow
does not run with elevated privileges, but it's a scary oversight
nonetheless.

(cherry picked from commit 6720d25429)
2025-05-25 15:10:33 +00:00
Wolfgang Walther
6cddb25b5b workflows/eval: fix comparison with merge conflicts
In PRs with multiple commits and merge conflicts the logic "targetSha ==
immediate parent of mergedSha" doesn't hold anymore. The head and base
commits of the PR's branch have some commits inbetween them, instead.

Before this change, we'd get a "fatal: invalid reference" on the
"worktree add". Now, not anymore, because we fetch the right commit
directly.

(cherry picked from commit cd9a22d753)
2025-05-25 15:10:32 +00:00
Wolfgang Walther
6c95fb2548 ci/eval: improve api when calling in steps
Previously, `eval.full` organized the results for the supported systems
in a specific layout, i.e. with a folder with one subfolder per system.
Then, `eval.combine` relied on that.

When using `eval.singleSystem` and `eval.combine` directly, the caller
was responsible to recreate the same layout. This is annoying and
error-prone to do, when downloading artifacts from CI to recreate some
steps locally.

With this change, all the artifacts can be downloaded and extracted into
the same folder - because the result from `eval.singleSystem` already
contains the <system-name>/ subfolder.

(cherry picked from commit eccd9564ab)
2025-05-24 10:46:35 +00:00
Wolfgang Walther
55651d1260 workflows/{codeowners,eval}: move env before run
`env` blocks are a bit like `let` blocks in Nix. They define a few
things, which are then used in the `run` block. The workflows are
considerably easier to read, if those definitions come first, making it
crystal clear where they belong and requiring less visual jumping.

(cherry picked from commit 82396d1f48)
2025-05-24 10:46:34 +00:00
Wolfgang Walther
e2a2997127 workflows/get-merge-commit: move to composite action
We don't need a separate workflow anymore, because we don't need to skip
dependent jobs on failures anymore. The biggest failure mode was
"conflict" previously, but we resolved that on the last commit. The
remaining failure modes are so rare, that it's OK to just fail the jobs
in this case instead of marking them as "skipped". Especially, because
the resolve-merge-commit job would have previously failed anyway.

By moving this to an action we avoid running separate jobs each time we
need the merge commit. This also makes the check list in PRs much
cleaner.

(cherry picked from commit e48d9d6174)
2025-05-24 10:25:43 +00:00
Wolfgang Walther
439253015c workflows/eval: fix process job with author id argument
(cherry picked from commit 57d8274118)
2025-05-17 23:17:04 +02:00
Winter
f478418afd ci/eval/compare: manage the "by: package-maintainer" label
While OfBorg is still adding these, it takes a much longer time to do so
compared to the eval action. Since we're adding rebuild labels, I think
it'd be nice to just do it within the eval action.

(cherry picked from commit d52066e2b1)
2025-05-17 20:49:33 +00:00
Wolfgang Walther
dd1b14e890 workflows/eval: prevent tag job from failing in forks 2025-05-14 09:32:57 +02:00
Wolfgang Walther
65315e5400 workflows: self-test on change
All workflows where it's remotely useful now trigger on a pull_request
event when the workflow file itself is changed. This gives us basic
sanity testing of changes to workflow files itself and reduces the need
for manual tests in forks.
2025-05-14 08:18:38 +02:00
Wolfgang Walther
68bcd5e6f2 workflows/eval: fix missing dependency of tag job
Introduced in #406266.
2025-05-13 08:30:18 +02:00
Wolfgang Walther
af6faf8760 workflows/eval: remove attrs step
Previously, the attrs step consisted of:
- 7s queue time
- 1m 15s run time

Only 25s of this were spent preparing the attr paths. A bit more than a
minute was just spent for queuing, checking out the repo, downloading
nix, downloading dependencies, uploading the artifacts - and then
downloading them again in the next step. All of that can be avoided if
we collect the attrs as part of the outpaths job.

By running the attrs step as part of each outpaths step the attrpaths
will be collected 4x, but:
- We save a minute for each eval run to complete.
- We save a full job, giving us more free runners and *possibly* less
queue times for other jobs in the repo.
- We reduce complexity in the workflow file.
2025-05-11 22:22:48 +02:00
Wolfgang Walther
962836d4d0 workflows/get-merge-commit: return targetSha
We can fetch the targetSha directly with the mergedSha from the API.
This avoids a checkout with fetch-depth: 2 for a small performance
improvement.
2025-05-11 22:22:47 +02:00
Wolfgang Walther
456a4697b1 workflows/eval: load supportedSystems from JSON file
This is a refactor to prepare the next commit. It doesn't do much on its
own, but is separated for ease of review.
2025-05-11 22:22:45 +02:00
Jörg Thalheim
53a79ee500 workflows/check-format: add actionlint (#406114) 2025-05-11 12:55:51 +02:00
Wolfgang Walther
d3e4865b10 workflows: use ARM runners
ARM runners are supposed to be more energy efficient than x86. Also,
from limited testing, they appear to be faster for the eval jobs as
well. Average run time for the "Outpaths (x86_64-linux)" job was 4m 27s,
so far. In the first run, this job came in at 3m 9s. This effect did not
show for other jobs, yet.

The following two exceptions are made right now:
- nixpkgs-lib-tests currently fails on the ARM runner building Nix 2.3
- nixpkgs-vet is currently pinned to a x86_64-linux only binary release
2025-05-11 12:11:10 +02:00
Wolfgang Walther
8b65ba5b8e workflows/check-format: add actionlint
I added a lint-action.sh script in .github/workflows a while ago while
fixing some warnings. But I haven't run it myself ever since. This needs
to be part of CI to make any use of it.
2025-05-11 11:06:06 +02:00
Wolfgang Walther
3f004ac12c workflows/eval-aliases: split from eval
The eval-aliases job is independent of all the other eval jobs. By
splitting it into a separate workflow, we avoid running it in two cases:

1. When turning a PR "ready to review". In this case, the main eval
workflow needs to run to be able to tag reviewers - but not
eval-aliases.

2. On branches like master, staging, etc. We only need to run eval there
to have a result to compare against in PRs. eval-aliases doesn't
contribute to that.

Thus, this will avoid wasting resources.
2025-05-11 11:01:10 +02:00
Johannes Kirschbauer
c8276114ac fix(ci/eval-stats): resolve prResult symlink 2025-05-07 18:01:39 +02:00
Philip Taron
e7072d135f build(deps): bump cachix/install-nix-action from 31.2.0 to 31.3.0 (#404347) 2025-05-06 10:54:26 -07:00
dependabot[bot]
f068c68b2e build(deps): bump cachix/install-nix-action from 31.2.0 to 31.3.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.2.0 to 31.3.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](754537aaed...5261181216)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 11:37:17 +00:00
dependabot[bot]
77ea92cfca build(deps): bump actions/create-github-app-token from 2.0.2 to 2.0.6
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.0.2 to 2.0.6.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](3ff1caaa28...df432ceedc)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-05 11:36:15 +00:00
Wolfgang Walther
624010d02b build(deps): bump cachix/install-nix-action from 31.1.0 to 31.2.0 (#400521) 2025-05-02 18:11:38 +00:00
dependabot[bot]
1de4a06154 build(deps): bump cachix/install-nix-action from 31.1.0 to 31.2.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.1.0 to 31.2.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](d1ca217b38...754537aaed)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-21 12:30:12 +00:00
Wolfgang Walther
40528439f3 workflows: make requested permissions explicit for create-github-app-token
Resolves #396875
2025-04-12 19:10:26 +02:00
dependabot[bot]
4e21d3ba46 build(deps): bump actions/create-github-app-token from 1.11.7 to 2.0.2
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.7 to 2.0.2.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](af35edadc0...3ff1caaa28)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-07 11:47:12 +00:00
Cole Helbling
06b7e29907 ci/eval: check that flake outputs on all systems still evaluate 2025-04-02 12:44:41 -07:00
Cole Helbling
89a0c1b767 Revert "flake: fix nix flake check --all-systems --no-build again" 2025-04-02 12:16:51 -07:00
Cole Helbling
09a54c33e7 ci/eval: move flake eval check to eval-aliases job 2025-04-02 11:35:48 -07:00
Cole Helbling
7d2e5370e2 ci/eval: check that flake outputs on all systems still evaluate 2025-04-02 08:42:54 -07:00
dependabot[bot]
0e553a831e build(deps): bump cachix/install-nix-action from {30,31} to 31.1.0 (#394893) 2025-04-01 19:43:48 +00:00
Wolfgang Walther
8dedbb6a18 build(deps): bump actions/upload-artifact from 4.6.1 to 4.6.2 (#392700) 2025-03-24 18:18:59 +00:00
dependabot[bot]
901f146902 build(deps): bump actions/upload-artifact from 4.6.1 to 4.6.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](4cec3d8aa0...ea165f8d65)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 12:16:32 +00:00
dependabot[bot]
56de6fd33d build(deps): bump actions/create-github-app-token from 1.11.6 to 1.11.7
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.6 to 1.11.7.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](21cfef2b49...af35edadc0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-24 12:16:28 +00:00
Wolfgang Walther
3fa48f3377 Reapply "build(deps): bump cachix/install-nix-action from 30 to 31"
This reverts commit 281875261d.
2025-03-19 20:38:45 +01:00
Philip Taron
281875261d Revert "build(deps): bump cachix/install-nix-action from 30 to 31" 2025-03-17 08:05:43 -07:00
dependabot[bot]
8cad67f2a3 build(deps): bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](08dcb3a5e6...02a151ada4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-17 11:39:46 +00:00
dependabot[bot]
94816e8c96 build(deps): bump actions/create-github-app-token from 1.11.5 to 1.11.6
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.5 to 1.11.6.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](0d564482f0...21cfef2b49)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-03 11:17:16 +00:00
dependabot[bot]
a38730c806 build(deps): bump actions/upload-artifact from 4.6.0 to 4.6.1
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65c4c4a1dd...4cec3d8aa0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-24 12:19:54 +00:00
dependabot[bot]
f66585fd39 build(deps): bump actions/create-github-app-token from 1.11.3 to 1.11.5
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.3 to 1.11.5.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](67e27a7eb7...0d564482f0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-17 11:47:47 +00:00
dependabot[bot]
95e123c783 build(deps): bump actions/create-github-app-token from 1.11.1 to 1.11.3
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.1 to 1.11.3.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](c1a285145b...67e27a7eb7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-10 11:50:07 +00:00
Wolfgang Walther
93df51fa33 workflows/eval: rename BASE_SHA to TARGET_SHA
To be in line with the terminology introduced in the README.md in the
same folder.
2025-02-02 20:17:33 +01:00
Wolfgang Walther
86a38d48fb workflows/eval: fail hard without target run
Without a target run, we won't get any rebuild labels, rebuild counts or
maintainer pings. This might have been correct before #373935, but by
now we run eval on all commits on the target branch, so we should treat
it as a failure if we can't find the run.
2025-02-02 20:17:09 +01:00
Wolfgang Walther
21b5113509 workflows/eval: no maintainer reviews in draft mode 2025-01-13 20:48:05 +01:00
dependabot[bot]
c254691a5b build(deps): bump actions/upload-artifact from 4.5.0 to 4.6.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](6f51ac03b9...65c4c4a1dd)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-13 11:45:12 +00:00
Wolfgang Walther
9ea74225cc workflows: add README
This introduces some basic concepts used in these workflows and a common
terminology.

At the same time we remove some of the comments from various workflow
files, because they are assumed to be "general knowledge" through the
README.
2025-01-10 18:36:22 +01:00