Commit Graph

1342 Commits

Author SHA1 Message Date
dependabot[bot]
36c667d9f4 build(deps): bump actions/github-script from 7.0.1 to 8.0.0
Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](60a0d83039...ed597411d8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 4ea8216576)
2025-09-08 12:36:31 +00:00
dependabot[bot]
0fbe222634 build(deps): bump actions/labeler from 5.0.0 to 6.0.1
Bumps [actions/labeler](https://github.com/actions/labeler) from 5.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](8558fd7429...634933edcd)

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

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit d64ece988b)
2025-09-08 12:33:13 +00:00
dependabot[bot]
ec3f65fdfd build(deps): bump cachix/install-nix-action from 31.6.0 to 31.6.1
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.6.0 to 31.6.1.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](56a7bb7b56...7be5dee142)

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

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit c4fd1f6500)
2025-09-08 12:23:32 +00:00
dependabot[bot]
f8ecf8cc37 build(deps): bump cachix/install-nix-action from 31.5.2 to 31.6.0
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.5.2 to 31.6.0.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](fc6e360bed...56a7bb7b56)

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

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit df934c4327)
2025-09-02 08:33:34 +00:00
Wolfgang Walther
792b94e753 ISSUE_TEMPLATE: revert one-sentence-per-line for package_request
We tried, but GitHub's markdown renderer will render these newlines
there, so going back to "real" paragraphs.

Also fixed the emphasis slightly, since "via Issues" is not bold, "via a
Pull Request" is also made not bold for consistency. Puts the focus more
on the "contribute" link as well.

(cherry picked from commit 57cf218357)
2025-08-29 19:31:17 +00:00
Fernando Rodrigues
d21a0c543d ISSUE_TEMPLATE: add the package request stub
This isn't an issue template; it's a stub that will be auto-closed by CI
and is meant to discourage future package requests, and encourage more
pull requests.

See the full discussion on https://github.com/NixOS/nixpkgs/issues/425040.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
(cherry picked from commit f2bb8a4dfb)
2025-08-29 19:23:05 +00:00
dependabot[bot]
150ba26d2b build(deps): bump actions/create-github-app-token from 2.1.0 to 2.1.1
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](0f859bf9e6...a8d6161485)

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

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit c1853d5ea1)
2025-08-26 12:08:31 +00:00
Wolfgang Walther
73822dcbdc [Backport release-25.05] workflows/labels: prevent error on token creation for Test workflow (#437095) 2025-08-26 12:07:56 +00:00
dependabot[bot]
9b81db86e8 build(deps): bump korthout/backport-action from 3.2.1 to 3.3.0
Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 3.2.1 to 3.3.0.
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](0193454f0c...ca4972adce)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
(cherry picked from commit 2240ad8625)
2025-08-26 12:02:14 +00:00
Wolfgang Walther
0ec83b71dd workflows/labels: prevent error on token creation for Test workflow
This only happens when the label workflow runs in pull_request context
*and* from within nixpkgs (not a fork). This is the case for dependabot
updates.

(cherry picked from commit 979687958f)
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
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
fc237c6b07 workflows/{merge-group,pr}: avoid posting "no PR failures" for pull_request trigger
The required status checks should depend on exactly one workflow,
triggered via pull_request_target or merge_group. Anything that is
triggered by pull_request is for testing purposes of the workflows
themselves only.

(cherry picked from commit 5ff32763b2)
2025-08-24 19:11:25 +00:00
Wolfgang Walther
8824c563a7 workflows/{merge-group,pr}: post "no PR failures" status manually
Posting the status manually allows us to avoid the strange "skipped ==
success" logic and properly skip the `unlock` job for pull_request
events in the next commit.

This should be much easier to understand than the previous logic.

(cherry picked from commit 2c25cb0891)
2025-08-24 19:11:25 +00:00
Wolfgang Walther
73644a2ce8 workflows/test: test merge-group workflow
Changes to the merge-group workflow should also validate that the file
is hooked up correctly and works - otherwise we risk merging CI changes
that cause the merge queue to fail consistently.

(cherry picked from commit 534d41ee9c)
2025-08-24 10:15:02 +00:00
Wolfgang Walther
2955bd942c workflows/test: run push job on correct commit
Previously, the test for the push workflow was running on the HEAD
commit of the PR only. It would be better to run it on the merged result
instead, just like any other tests we run in a PR.

(cherry picked from commit 06a0eba240)
2025-08-24 10:15:02 +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
fd91d8f556 workflows/push: remove unused permissions and secrets
These were left-over from when the eval workflow still had the labeling
and reviewer components.

(cherry picked from commit 9d4fb0c40f)
2025-08-24 10:15:01 +00:00
Wolfgang Walther
450bb67e89 workflows/eval.misc: run tasks in parallel
Both `nix flake check` and `nix-env` are single-threaded, so no reason
to serialize their calls and waste time.

This brings down the runtime for this job from ~1:51 to ~1:27 in my
tests.

(cherry picked from commit 3d9cb9f355)
2025-08-24 10:04:08 +00:00
Matt Sturgeon
135ab63e14 actions/checkout: update input descriptions
In fb32eb0f29 we moved the checked-out
worktrees into a `nixpkgs` directory. Update the input descriptions to
reflect this.

(cherry picked from commit c25dd6c655)
2025-08-22 16:49:41 +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
0807259075 actions/checkout: always checkout pinned commits
With the latest performance improvements, this only adds up to 1s, but
reduces complexity in managing pinned checkouts explicitly, especially
when we need *both* pinned checkouts in the next commit.

(cherry picked from commit c18d1e4af8)
2025-08-22 11:53:56 +00:00
Wolfgang Walther
1ca8505578 actions/checkout: use single tmpfs with subfolders
This fixes problems on darwin, where the new tmpfs folder would not be
fully empty, but git only creates worktrees on fully empty directories.

(cherry picked from commit fb32eb0f29)
2025-08-22 10:13:11 +00:00
Wolfgang Walther
27ce6ac178 actions/checkout: parallelize checkout of multiple commits on tmpfs
Instead of fetching up to 3 times on each new checkout, we now fetch all
the commits we're going to need at once. Afterwards, we checkout the
different worktrees in parallel, which doesn't give us much, yet,
because it would still be IO-bound on its own. Inconsistent IO
performance on disk is also the biggest limitation for checkout right
now, where checkout times range everywhere from 20s to 40s.

By checking out the worktrees on a tmpfs, the actual checkout only takes
1s and benefits from parallelization. The overall checkout time is now
8-11s, depending on the number of commits.

That's a reduction of 10-30s and we get this speedup for almost every
job in the PR workflow, which is huge.

This potentially has a nice side-effect for Eval, too: Because the repo
is in RAM, Eval seems to run slightly faster, up to 10 seconds less.

(cherry picked from commit 4b4aa628da)
2025-08-21 19:58:13 +00: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
Wolfgang Walther
1d5b0b9e95 actions/checkout: remove unused input types
The two as-at inputs, were not boolean anymore, but GHA didn't complain.
Input types are actually not a thing for composite actions - they are
only documented for callable workflows.

(cherry picked from commit f01b6b4754)
2025-08-20 16:58:11 +00:00
Wolfgang Walther
599c6c4e7f workflows/pr.prepare: specify cone mode explicitly
This is the default, but who's supposed to know about that? Let's make
it explicit to be clear about the availability of files in `ci/`.

(cherry picked from commit f35d1cd2cc)
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
70fc919bde actions/checkout: rename inconsistent pinned-from input
(cherry picked from commit 7ab632b30f)
2025-08-20 16:58:10 +00:00
Wolfgang Walther
7d405339b3 actions/checkout: rename from actions/get-merge-commit
This moves the logic to "check whether the PR can be merged and
determine the relevant commits" into the PR / prepare job directly -
since that's the only place where it is supposed to be used.

Because of the if condition in get-merge-commit, this logic was run
multiple times, for example in the lint workflow, where only one of
targetSha or mergedSha was provided as input. However, this input was
thrown away directly. This might not be a big problem, because this was
not expensive, so far. But with the next commit, this will become more
so.

This also separates the logic a bit cleaner - `prepare` figures out all
the parameters for the whole PR workflow, while `checkout` handles the
consistency around these checkouts.

(cherry picked from commit b51e104439)
2025-08-20 16:58:10 +00:00
Wolfgang Walther
4c5bae6e3f workflows/build: prevent pushing tarball to cachix
By definition the tarball changes on every commit, so it makes no sense
to cache it - it will just waste disk space.

(cherry picked from commit ac93865697)
2025-08-20 16:54:40 +00:00
Wolfgang Walther
0c3549113b workflows/eval: add cachix
At this stage, this only allows faster iteration when working on CI in
forks.

(cherry picked from commit 795dd01e31)
2025-08-20 16:54:40 +00:00
Wolfgang Walther
b431f97a1c workflows/lint: add cachix
For PRs targeting a fast moving branch like master, it might not
actually help because the merge commit will still be different on each
run. But on slower moving branches or when testing in a fork, it can
speed things up.

Since each of these build results is only a few hundred bytes without
any dependencies, it has essentially no cost.

Not adding this to `treefmt`, because this looks at *all* the files in
the repo, so needs to re-run even when iterating on CI only.

(cherry picked from commit 6ee40e7931)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
e3ff0fab42 workflows: never push source to cachix
Pushing the source path to cachix is pointless, because the only source
we're using is Nixpkgs - and that will always be available already via
checkout. No need to ever substitute it, so no need to push it either.

(cherry picked from commit 2400bdf0d4)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
28c86b2359 workflows: support cachix in forks
This allows setting up a custom cachix cache in a contributor's fork.
That's most valuable when working on CI itself, testing and interating
in a fork. It's required when working on cachix related features
directly.

(cherry picked from commit 025424913f)
2025-08-20 16:54:39 +00:00
Wolfgang Walther
2c86ed707c workflows/reviewers: integrate codeowner reviews
These two jobs mostly used the same code anyway, so they can easily run
in the same job. This uses fewer resources and avoids running (and
failing) the codeowners review job on Pull Requests from development
branches like staging-next or haskell-updates.

It also opens the door for more improvements later on, for example it
will be much easier to implement a shared reviewer limit for both owners
and maintainers now.

(cherry picked from commit ddf81dead6)
2025-08-20 15:16:14 +00:00
Wolfgang Walther
2746652fdc workflows/reviewers: remove pull_request trigger
Changes to this file already trigger a run of this workflow via the PR
workflow, we don't need to run this *another* time.

(cherry picked from commit 7f4dd7e2ff)
2025-08-20 15:16:14 +00:00
Wolfgang Walther
aefe360c78 workflows/check: move owners check job from codeowners
This runs the "check owners" job as part of the main PR workflow, with
multiple advantages:
- The job doesn't run anymore when undrafting a PR, where it's not
required, because the OWNERS file's contents didn't change.
- A valid OWNERS file is now a requirement to merge a PR.
- The OWNERS file is always checked on the exact same test merge commit
that the remainder of the workflows are running on as well.

(cherry picked from commit 15be04f7a2)
2025-08-20 15:16:14 +00:00
Wolfgang Walther
f27f68194a workflows/codeowners: split comment for each job
Allows splitting the workflow file in the next step.

(cherry picked from commit 368a2d6254)
2025-08-20 15:16:14 +00:00
Wolfgang Walther
4daef5d847 workflows/codeowners: move global env into jobs
Preparation to split the whole file.

(cherry picked from commit c962461556)
2025-08-20 15:16:14 +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
ea9f67944f actions/get-merge-commit: remove push branch
This action will not be called for push events anymore. For those, the
`push.yml` workflow is run instead, which hardcodes `mergedSha`.

(cherry picked from commit 2087f1be30)
2025-08-20 13:22:29 +00:00
Wolfgang Walther
19d5d69dc9 workflows/eval: run misc job with same merge commit
This was an oversight when we introduced the ability for
`get-merge-commit` to take the pre-computed sha as input.

(cherry picked from commit f5c5bc25ea)
2025-08-20 13:22:29 +00:00
Wolfgang Walther
fe1404b803 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.

(cherry picked from commit 04c039f993)
2025-08-14 07:28:44 +00:00