Commit Graph

1494 Commits

Author SHA1 Message Date
Ulrik Strid
69ff903493 nixos/rke2: merge code with nixos/k3s (#447847) 2025-11-17 12:00:34 +00:00
Leona Maroni
95dbbedeee .github/periodic-merge-24h: add staging-next-25.11 and staging-25.11
For now merge master->staging-next-25.11 until branchoff happened.
2025-11-14 11:01:20 +01:00
dependabot[bot]
9d60cddaee build(deps): bump cachix/install-nix-action from 31.8.2 to 31.8.3
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.8.2 to 31.8.3.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](456688f15b...7ec16f2c06)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-12 14:17:48 +00:00
Wolfgang Walther
ab49ff2169 workflows: run build & check in the merge queue; never push to cachix in PRs (#460726) 2025-11-12 14:08:49 +00:00
Wolfgang Walther
3bc31e0474 workflows: invalidate cachix cache
Since it was previously possible, in theory, to extract the
CACHIX_AUTH_TOKEN via Nix eval on untrusted inputs, this rotates the
token and clears the cache - and while on it moves to a new cache, that
is owned by a newly created nixpkgs-ci org instead of an individual.
2025-11-11 19:03:42 +01:00
Wolfgang Walther
5d6dd23117 workflows/pull-request-target: never write to cachix from PRs
Evaluating untrusted code in the presence of secrets is unsafe in
general, thus we only provide the cachix auth token when these jobs run
in the merge queue. This is enough for all practical purposes, PRs will
be able to pull stuff from cachix that was built in the Merge Queue
previously.
2025-11-11 19:03:41 +01:00
Wolfgang Walther
c2cb4e916b workflows/build: run trusted nix-build-uncached
This was previously run from the untrusted checkout, which would allow
extracting the cachix secret easily.
2025-11-11 19:03:40 +01:00
Wolfgang Walther
e18eeeb441 workflows/merge-queue: run owners check job 2025-11-11 19:03:39 +01:00
Wolfgang Walther
ec50d453b6 workflows/merge-queue: run build jobs 2025-11-11 18:58:30 +01:00
Wolfgang Walther
4147f97f9e workflows/merge-group: refactor prepare step to github-script
Less Bash, more JavaScript - it's policy!
2025-11-11 18:34:45 +01:00
Markus S. Wamser
694cb8ac10 workflows/teams: restrict to NixOS org
without the restriction the workflow would trigger on all forks,
but it is only relevant on NixOS/nixpkgs
2025-11-10 22:36:24 +01:00
Wolfgang Walther
1742aef1e9 workflows/teams: use single token in team sync
The nixpkgs-ci app now has all the privileges needed to see the member
lists anyway, so no need for two apps / tokens anymore.
2025-11-06 12:11:34 +01:00
Wolfgang Walther
c58139723a workflows/pull-request-target: remove leftover secret
This was used for reviewers.yml, which has been removed.
2025-11-06 12:11:00 +01:00
Wolfgang Walther
a23d0ab24c ci/github-script/bot: request reviewers
This migrates the bash code to request reviewers to github-script. This
will allow multiple nice improvements later on, but at this stage it's
mostly a reduction in code and complexity.
2025-11-05 21:58:56 +01:00
Wolfgang Walther
74d6ba3ab4 Revert "wprkflows/bot: increase frequency to every 5 minutes"
This partially reverts commit 1197fe48da.

GitHub just doesn't schedule these narrow intervals. 10 minutes is
alright in practice.
2025-11-04 19:49:07 +01:00
Wolfgang Walther
1197fe48da wprkflows/bot: increase frequency to every 5 minutes
This makes reactions to merge comments and all the labeling a bit
quicker. Lower the number of backlog items to process per run
accordingly, so that we don't really need more API requests for it.
2025-11-04 16:13:41 +01:00
Wolfgang Walther
8f6dc56cc7 build(deps): bump cachix/install-nix-action from 31.8.1 to 31.8.2 (#458072) 2025-11-03 11:26:13 +00:00
Wolfgang Walther
5cfe736140 workflows/bot: touch cron schedule
The last user to touch the schedule will be notified about errors in the
scheduled run. I used to be that, but somehow when renaming the workflow
this didn't happen anymore, so I didn't noticed the workflow failing for
quite some time.
2025-11-03 12:17:20 +01:00
dependabot[bot]
17425ff327 build(deps): bump cachix/install-nix-action from 31.8.1 to 31.8.2
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.8.1 to 31.8.2.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](fd24c48048...456688f15b)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 11:03:56 +00:00
Wolfgang Walther
91c4d9236b workflows/bot: allow maintainers to merge backports
All other conditions equal, there is no reason to prevent maintainers
from backporting changes to their packages. Maintainers are probably in
the *best* position to tell whether a certain change is backportable or
not - because they know the package well.
2025-11-02 17:26:01 +01:00
Wolfgang Walther
1774ef870d ci/request-reviews: untangle owner-related bash code (#457503) 2025-11-02 15:41:16 +00:00
Wolfgang Walther
436876e070 workflows/pull-request-target: increase retries for prepare step
We still get plenty of errors in the prepare step for the diff requests
to take way too long - let's increase the number of retries massively
now. These are repeated with exponential backoff, so hopefully they will
succeed with some cooldown, when GitHub had time to compute the right
diff in the background.
2025-11-01 19:44:30 +01:00
Wolfgang Walther
77a3b006cd workflows/test: trigger on some github-scripts as well
Changes in these files can easily cause the Test workflow to break, so
they should be tested as well.
2025-11-01 18:49:19 +01:00
Wolfgang Walther
a5296ec9d5 workflows/bot: request read permissions for members
The nixpkgs-ci token used in CI doesn't have permissions to read the
member list of the nixpkgs-committers team, yet. Let's request this
permission and see whether that fixes the errors we get so far.
2025-11-01 16:29:27 +01:00
Wolfgang Walther
eea09eb9d3 workflows/bot: migrate nixpkgs-merge-bot to GHA
Running the nixpkgs-merge-bot in GitHub Actions instead of a separate
workflow has multiple advantages:
- A much better development workflow, with improved testability.
- The ability to label PRs with a "merge-bot eligible" label from the
same codebase.
- Using more data for merge strategy decisions, for example the number
of rebuilds.

This commits re-implements most of the features from the current
nxipkgs-merge-bot directly in the bot workflow. Instead of reacting to
webhook events, this now runs on the regular 10 minute schedule. Some
merges might be delayed a few minutes, but that should not be a problem
in practice.

To give the user early feedback, there are additional workflows running
when a comment or review is posted. These react with "eyes" to make the
user aware that the comment has been recognized.

The only feature not taken over was the size check for files in the PR.
This kind of check is not really relevant for maintainer merges only -
if we want to prevent bigger files from making it into the tree, then we
need a generic CI check, which is out of scope for the merge-bot.

Other than that, everything should be implemented - any omissions are by
accident.
2025-11-01 15:54:51 +01:00
Wolfgang Walther
f1640b71d8 workflows/{review,reviewed}: rename from dismissed-review and review-dismissed
This is just a separate commit for a better diff. This workflow will be
extended with the `submitted` type in the next commit, so needs a
different naming.

While at it, also remove the useless concurrency group: This workflow is
never run in a PR context, so will never be cancelled.
2025-11-01 15:24:11 +01:00
Wolfgang Walther
d78de15627 workflows/bot: rename from labels
This workflow / script is already doing more than must labeling: it's
already auto-closing package request issues.

Since we're going to migrate the nixpkgs-merge-bot into this workflow,
we'll rename things to a more generic name.
2025-11-01 15:24:09 +01:00
Wolfgang Walther
3bef0dcf65 ci/request-reviews: move get-code-owners to eval/compare
This moves the parsing of ci/OWNERS into the Nix sandbox. We also get
rid of checking out the nixpkgs repo another time in the reviewers
workflow - we already have everything we need in the eval/compare job.

The creation of owners.txt in this way is only temporary, it should
eventually be moved further, similar to how maintainers.json is
currently migrating to a maintainer map for the whole repo stored on the
target branch as artifact.
2025-11-01 15:02:23 +01:00
Wolfgang Walther
18ab6b721e ci/request-reviews: move gh api calls out of get-code-owners
All the github related logic is now bundled in `request-reviewers.sh`.
This allows moving the `get-code-owners.sh` file into the eval/compare
step in the next commit.
2025-11-01 14:13:57 +01:00
Wolfgang Walther
b2d1946eb2 workflows/reviewers: request owners and maintainers at once
Instead of requesting owners and maintainer separately, each with their
own limit of 10 review requests, we now run this together. This unties
the logic and allows easier refactoring. Also, it gives us a consistent
threshold of when not to request reviews anymore, which I set to 15.
Before, this could have been anything between 10 and 20, depending on
how the reviewers distributed over owners and maintainers.
2025-11-01 13:44:23 +01:00
Wolfgang Walther
f66a380ea3 workflows/pr: rename to pull-request-target
To be able to disable the pr.yml workflow on GitHub, we need to rename
it to a different name. Let's use the long name for consistency with
merge-group.yml. This only affects the GitHub-internal name, not the
visible name in the PR checklist, which is still "PR". This visible name
is also used by nixpkgs-review, so that won't break.
2025-11-01 12:59:21 +01:00
Wolfgang Walther
9718f2952f workflows/check: run codeowners validator from trusted checkout
In f7d6d11e8e I wrongly assumed that
running from the untrusted checkout should be fine for the codeowners
validator, because we removed all the logic for privileged tokens.
However, this job also contains access to the cachix secret, which could
be used to push malicious code to cachix, which would then be pulled by
a more privileged workflow like reviewers.yml later.
2025-11-01 12:51:27 +01:00
Wolfgang Walther
6b5e6cbbee ci/github-script/labels: set maintainer labels from latest maintainer map
Instead of setting the maintainer-related labels based entirely on Eval
results, this uses the new maintainer map from the target branch. This
allows labeling PRs correctly, that had been created *before* a
contributor became a maintainer of the respective package.
2025-11-01 10:36:23 +01:00
Wolfgang Walther
4061fac135 workflows/eval: upload maintainer list of all packages as artifact (#456965) 2025-10-31 11:28:37 +00:00
Wolfgang Walther
498574f238 workflows/eval: upload maintainer list of all packages as artifact
This creates a simple mapping of all packages to github ids of all their
maintainers. This is uploaded as an artifact and is then available for
download on the latest commit of each branch with a merge queue. This
will allow scheduled jobs to use this information for setting
maintainer-related labels, to request reviewers and to implement the
merge-bot.

The advantage over querying this information directly via Nix in each
case: The scheduled job does not need to install Nix and does not need
to checkout the target branch.

Compared to obtaining the maintainer information just for a single PR
during Eval, this will allow retroactively changing maintainers for a
package: For example, it allows to request a new maintainer as reviewer
for a PR that was created before they became maintainer, but is still
open - and similarly for maintainer labels and merge-bot rights.

None of these extensions are implemented by this PR, yet.
2025-10-31 10:59:01 +01:00
Wolfgang Walther
6ae5f33c85 workflows/merge-group: compare eval against previous queue item
This runs the compare step in the merge queue, to get a combined diff
against the previous queue item. This can be used as a base for multiple
different features in the future, for example preventing accidental mass
rebuilds in the merge queue, or diffing of packages' meta.
2025-10-31 10:58:45 +01:00
Wolfgang Walther
089a29e00f workflows/pr: retry for 422 in prepare
I recently tried to increase retries to 3 to fix the 422 "Sorry, this
diff is taking too long to generate" errors that appear frequently as of
late. Little did I know that, this specific status code would not be
retried by default. Thus, try again.
2025-10-30 13:19:59 +01:00
Wolfgang Walther
67506595ac workflows/test: prefix artifacts
Once we start running similar jobs in the PR and Merge Queue workflows,
the Test workflow will run into a problem: Both nested workflows will
try to upload the same artifacts, which errors out.

By providing a prefix to use for artifact names, this will be a
non-issue when we later run more of Eval in the merge queue or when we
add the build jobs to the queue as well.
2025-10-30 12:16:59 +01:00
Wolfgang Walther
1fdb9eb10e .github/labeler-no-sync: backport changes to github-teams (#456426) 2025-10-28 16:18:06 +00:00
Silvan Mosberger
72d9fc32fe workflows/team: Prefix PR branch with create-pull-request
Allows better scoping of branch creation restrictions
2025-10-28 15:49:42 +01:00
Wolfgang Walther
0ace36a3da .github/labeler-no-sync: backport changes to github-teams
Changes to this auto-generated file need to be backported automatically,
to keep maintainer pings for teams functional on stable branches.
2025-10-28 12:13:54 +01:00
Wolfgang Walther
81005856bb workflows/teams: consistent style with other workflows
These are style-only formatting changes, that are not enforced via
tooling - but used consistently in the other workflow files.
2025-10-28 11:43:07 +01:00
Wolfgang Walther
42de52d21a workflows/teams: rename from team
Keeping the workflow filename in-sync with the visible name.
2025-10-28 11:39:37 +01:00
Wolfgang Walther
b5af85e10e Revert "First-class GitHub team reviews" 2025-10-28 07:38:20 +00:00
Silvan Mosberger
e6c822f51f workflows/reviewers: First-class team package maintainer review requests 2025-10-28 01:35:25 +01:00
Silvan Mosberger
c0c6684257 workflows/team-sync: init
Creates a team sync workflow that pushes the current state of teams to a
JSON file, which can then be ingested by `lib.teams` to expose member
lists.

Co-Authored-By: Alexander Bantyev <alexander.bantyev@tweag.io>
2025-10-27 19:36:57 +01:00
Wolfgang Walther
55f9ab9e87 build(deps): bump actions/download-artifact from 5.0.0 to 6.0.0 (#456178) 2025-10-27 12:13:27 +00:00
dependabot[bot]
cc8b97e2a2 build(deps): bump actions/download-artifact from 5.0.0 to 6.0.0
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](634f93cb29...018cc2cf5b)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 12:10:22 +00:00
dependabot[bot]
19d3996ff7 build(deps): bump actions/upload-artifact from 4.6.2 to 5.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](ea165f8d65...330a01c490)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 12:00:55 +00:00
Wolfgang Walther
623b33839a workflows/backport: persist credentials
This was added when introducing zizmor. It appears that the backport
action actually needs these credentials to persist, to be able to push
the branch.
2025-10-27 09:01:17 +01:00