Commit Graph

342 Commits

Author SHA1 Message Date
Wolfgang Walther
78790dabd9 nixfmt[-rfc-style]: unstable -> 1.0.0 (#425068) 2025-07-18 17:40:43 +00:00
Wolfgang Walther
fa0ef8a6bb ci/github-script/commits: various fixes and improvements (#425789) 2025-07-17 10:11:59 +00:00
Wolfgang Walther
486756d85c ci/github-script/commits: shorten and clarify review comment
Also following the one-sentence-per-line rule now.
2025-07-16 15:47:19 +02:00
Wolfgang Walther
c4496912fd 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.
2025-07-16 15:47:18 +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
182184a00f ci/github-script/commits: init from ci/check-cherry-picks (#425449) 2025-07-16 10:25:30 +00:00
Wolfgang Walther
b19798c8b0 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.
2025-07-16 12:15:07 +02:00
Wolfgang Walther
40dcbb1483 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.
2025-07-16 11:59:28 +02:00
Wolfgang Walther
84925b35c4 ci/github-script/commits: add comment about --creation-factor 2025-07-16 11:58:08 +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
Silvan Mosberger
d1a4769b38 treewide: nixfmt-rfc-style -> nixfmt
Except:
- Instances in documentation, because people in older versions
  can't switch to nixfmt yet due to it having pointed to nixfmt-classic
  before
- In code that runs based on a CI Nixpkgs version, which is also a bit
  older still
- In update script shebangs, because many of them don't pin Nixpkgs, and run
  with whatever is in NIX_PATH (and it's not easy to fix this, see
  https://github.com/NixOS/nixpkgs/issues/425551)
2025-07-15 22:14:18 +02:00
Wolfgang Walther
2433050fb7 ci/github-script: use real @actions/core
This allows building markdown summaries, which is hard to mock.
2025-07-15 15:09:02 +02:00
Wolfgang Walther
13855a517b ci/github-script: move from ci/labels; allow single PR testing and non-dry mode (#424872) 2025-07-15 12:56:51 +00:00
Wolfgang Walther
cdd1931ace ci/github-script: add gh dependency to dev shell 2025-07-15 12:19:41 +02:00
Wolfgang Walther
d71b8c3680 ci/github-script: allow running without dry mode 2025-07-14 13:49:41 +02:00
Wolfgang Walther
97d4103946 ci/github-script: allow running for single PR
Makes specific tests in the upstream repo easier to do.
2025-07-14 13:49:40 +02:00
Wolfgang Walther
2192c5b6e8 ci/github-script: extract common withRateLimit.js
This can and should be re-used across different scripts.
2025-07-14 13:49:39 +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
aaaabe0cb7 ci/github-script: add commander CLI interface
This makes it easier to add additional features.
2025-07-14 10:35:17 +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
nixpkgs-ci[bot]
8287b2917e Merge master into staging-next 2025-07-12 18:05:06 +00:00
Wolfgang Walther
acf5bc2417 workflows/labels: label rebuilds immediately
This fixes labeling in the context of the `pull_request` trigger. Of
course, this was supposed to immediately label rebuilds after eval
finishes, but we somehow lost this along the way. Rebuilds are still
labeled fairly soon, because the scheduled trigger will pick up the same
PR within 10 minutes again and then apply the rebuild labels. But of
course, immediate is better.

The reason this happened is, that we're looking at `item.pull_request`
only. This is the correct distinction between "issue items" and "pull
request items", which we both get back from the /issues endpoint. But
the payload for the `pull_request*` event doesn't contain this, so
labeling in this case was treated like an issue and skipped the whole
pull request part.
2025-07-12 15:06:19 +02:00
K900
3c4bd15763 Merge remote-tracking branch 'origin/master' into staging-next 2025-07-09 16:26:35 +03: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
9936e7d751 ci/labels: run prettier
This is the result of:

  prettier --no-semi --single-quote
2025-07-08 17:05:17 +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
nixpkgs-ci[bot]
eee21ba9fa Merge staging-next into staging 2025-06-30 12:08:05 +00:00
Alyssa Ross
a61841a597 nixVersions.nix_2_3: add knownVulnerabilities 2025-06-30 10:26:29 +02:00
nixpkgs-ci[bot]
6d1ef78814 Merge staging-next into staging 2025-06-30 00:19:30 +00:00
Wolfgang Walther
60e35e4ded ci/eval/README.md: one sentence per line 2025-06-29 21:14:34 +02:00
Wolfgang Walther
99f2e655d9 ci/README.md: one sentence per line 2025-06-29 21:14:33 +02:00
K900
5985f13b69 Merge remote-tracking branch 'origin/staging-next' into staging 2025-06-27 21:07:44 +03:00
Wolfgang Walther
df5b98a38c ci/check-cherry-picks: fix chained cherry-picks
When backporting a PR from master -> 25.05 -> 24.11 in a chain, the last
cherry-pick will have two references to different commits in it. If
there was conflict resolution in the first step, the diff will show up
again in the last step. This can be fixed by comparing against the right
hash - always the last one.
2025-06-27 16:27:45 +02:00
K900
a10dfa1005 Merge remote-tracking branch 'origin/staging-next' into staging 2025-06-23 21:07:45 +03:00
Alyssa Ross
1fa650463c ci/OWNERS: add kernel team to relevant files
This should prevent situations like
https://github.com/NixOS/nixpkgs/pull/389291 in future where a new
kernel variant was added without any discussion with the kernel team.
2025-06-23 17:25:56 +02:00
Wolfgang Walther
3d4c1c0d26 .editorconfig: two spaces for .js files
Most other scripting languages we use in tree have the same.
2025-06-23 14:54:45 +02:00
Wolfgang Walther
767223d29d workflows/{check,reviewers}: don't run on staging-like PRs (#418496) 2025-06-23 10:53:34 +00:00
Matt Sturgeon
7c7009a3da ci/eval: fix comparing to null in getLabels
Check if `to` is null _before_ comparing it to `rebuildCount`.
2025-06-22 20:27:41 +01:00
Wolfgang Walther
7763be5a80 workflows/pr: refactor base/head branch decision making
Some jobs purposefully only run on certain base or head branches. By
centralizing the logic, parts of it can easily be re-used later. Also,
this gives them an explicit name and thus makes them easier to
understand.
2025-06-22 14:21:03 +02:00
Wolfgang Walther
5b5b18c875 workflows/labels: manage labels with a single API call
Instead of deleting each label separately and then making another call
to add new labels, this replaces all labels at once, thus saving API
calls in some cases. Also, the labels are now managed in object-style
compared to the array-style before. This allows putting all the
knowledge about each label into a single place instead of in multiple
places. For example, the rebuild labels had to be special cased in the
workflow before - and the nix code to compare had to match that. Also,
the approval labels had to be considered in the `before` and `after`
phases.

The next commit shows how easy it is to add a new label now.
2025-06-22 14:09:04 +02:00
Wolfgang Walther
966bc95a23 workflows/labels: various fixes (#418504) 2025-06-21 11:38:41 +00:00
Wolfgang Walther
19ce5d94bc ci/eval/compare: fix rebuild-stdenv labels
Those have not been working since before the migration from OfBorg.
Those `rebuildsByKernel` are an attrset of lists coming from
`groupByKernel` (also see lengthy comment at the top of the file) - thus
we need `lib.elem` instead.
2025-06-21 13:08:13 +02:00
Wolfgang Walther
1bec402437 teams/ci: init (#416459) 2025-06-20 11:59:16 +00:00
Wolfgang Walther
ec9986a919 teams/ci: init 2025-06-20 13:31:47 +02:00
Wolfgang Walther
a2404e557b OWNERS: drop security team from CI
To reduce the number of notifications.
2025-06-20 13:30:59 +02:00
Wolfgang Walther
8ba5040b9c ci/treefmt: add yamlfmt (#416115) 2025-06-15 10:10:02 +00:00
Wolfgang Walther
a9589ea037 ci/pinned: update
This gives us nixpkgs-review 3.4.0 to support #415006.

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

Changes for treefmt-nix:
1f3f7b7846...a05be418a1
2025-06-14 16:32:15 +02:00
Emily
53c0fdfee8 OWNERS: add more standard environment–related libraries (#410455) 2025-06-12 21:26:59 +01:00
Wolfgang Walther
36b76b4141 ci/nixpkgs-vet.sh: fix passing arguments
It currently fails with this:

```
error: lib.fileset.toSource: `root`
(/tmp/nix-shell-19054-0/tmp.MB62qzBqsj/base) is a string-like value, but
it should be a path instead.
   Paths in strings are not supported by `lib.fileset`, use
`lib.sources` or derivations instead.
```

Resolves #416175
2025-06-12 20:30:36 +02:00
Wolfgang Walther
8ec23df6f6 ci/treefmt: add yamlfmt
Most workflow files are already well formatted, but to make it easier to
keep it that way, we can add yamlfmt.

I personally have a preference for non-indented arrays for YAML, but
wanted to avoid bigger diffs here - the status-quo clearly are indented
arrays.

Some changes are made manually to the get-merge-commit action and the
issue templates. Those would otherwise make yamlfmt misbehave on those.
2025-06-12 14:47:42 +02:00