Commit Graph

1323 Commits

Author SHA1 Message Date
Michael Daniels
5731a33c07 .github/PULL_REQUEST_TEMPLATE.md: fix typo 2025-07-20 09:27:04 -04:00
Wolfgang Walther
03ed9b4118 .github/PULL_REQUEST_TEMPLATE: shorten (#425831) 2025-07-18 07:14:19 +00:00
Wolfgang Walther
7288dfa6c2 .github/PULL_REQUEST_TEMPLATE: shorten TODO list
This doesn't really change the items, but shortens the writing a lot,
making them much more readable, especially while still drafting the PR.

Mentioning the release notes for the previous release is not really
important, because it doesn't apply for the big majority of pull
requests.
2025-07-18 08:58:48 +02:00
Wolfgang Walther
464e0012d4 .github/PULL_REQUEST_TEMPLATE: remove mention of linking NixOS tests
This *is* important, but is a niche detail which belongs into the
contributions guidelines - and not into the PR template. It's also out
of place for "what did you test?".
2025-07-18 08:57:52 +02:00
Wolfgang Walther
76dd297d04 .github/PULL_REQUEST_TEMPLATE: avoid inlining links for readability
We expect the TODO list to be read through *on PR creation*, otherwise
the html comments would not make sense. Thus, we should make it even
only slightly readable, which was not at all the case before.

The links for release notes are removed, because the PR author has no
value from the *current* release notes. They will need to find the file
manually anyway.
2025-07-18 08:57:49 +02:00
Wolfgang Walther
0d433c5f7e .github/PULL_REQUEST_TEMPLATE: remove note about reviews
While this note is important, it's also mostly invisible at this stage.
The comment only shows while creating the PR, but at this stage the
author really has other things to worry about.

If they care, they will read the contribution guidelines and will pick
up the pieces about reviewing that way. If they don't - they won't be
bothered by this notice either.
2025-07-18 08:57:02 +02:00
Wolfgang Walther
d61ece5a95 .github/PULL_REQUEST_TEMPLATE: remove sandbox checkbox
This checkbox has been used very incosistently and its meaning is not
entirely clear: What does it mean if both checkboxes are *unchecked*?
Does that mean the sandbox was disabled? Or does it mean the checkbox
was just not handled?

Also the new nixpkgs-review-gha, which is increasingly used to test
builds on darwin platforms shows this information as part of the review
- where it's in a much better place.
2025-07-18 08:56:24 +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
7a31ddea37 .github/ISSUE_TEMPLATE: remove 24.11 references
24.11 is unmaintained now
2025-07-01 15:27:02 +02:00
Leona Maroni
e83d9fbf16 .github/labeler: remove "backport release-24.11" auto label
24.11 is unmaintained.
2025-07-01 15:27:02 +02:00
Leona Maroni
23454de455 .github/PULL_RQUEST_TEMPLATE: remove 24.11 references
24.11 is unmaintained now.
2025-07-01 15:27:02 +02: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
1eeee2bb19 .github/labeler: label changes to nixpkgs release notes as "has changelog" (#420225) 2025-06-26 17:21:35 +00: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
5466bd2e91 .github/labeler: label changes to nixpkgs release notes as "has changelog"
Previously only the NixOS release notes were taken into account.
2025-06-26 14:55:54 +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
Wolfgang Walther
579bfd48da workflows/labels: use /pulls endpoint instead of search for "all" pull requests
It's necessary to use a combination of different endpoints here, because
the /search endpoint only allows fetching the first 1000 items and will
fail with a higher page number (11+). On the flip side, the /pulls
endpoint doesn't allow counting the total number of results, so we can't
calculate the required page number with its response.

Putting both together should work, though.
2025-06-25 08:51:12 +02:00
Wolfgang Walther
ddf3480d49 workflows/labels: improve cleanup of reservoir timer
This should make sure that the timer is cleaned up, no matter what. This
didn't seem to be the case before, where it would still be stuck
sometimes, when throwing an error somewhere.
2025-06-25 08:51:07 +02:00
Wolfgang Walther
39dc87db4b workflows/labels: handle PR-creation-edge-case for merge conflict label
Explained very well by the code comment.
2025-06-25 08:51:03 +02:00
Wolfgang Walther
ed1fc4c6b3 workflows/labels: fix running in pull_request context
When running in a pull_request context, the labels job is part of the
currently running workflow - which will never have succeeded, yet.
Apparently it could be failed already, so in this case we take *any*
workflow run, no matter its state.
2025-06-24 21:00:11 +02:00
Wolfgang Walther
d5072dd344 workflows/labels: fix stale label
To set the stale label properly, we need to consider the right timeline
events only - and their respective relevant timestamps.
2025-06-24 21:00:06 +02:00
Wolfgang Walther
ea10312659 workflows: nix: 2.29.0 -> 2.29.1 2025-06-24 18:26:59 +02:00
Wolfgang Walther
0edbbfc8bb Reapply "workflows/labels: manage stale & merge conflict labels"
This reverts commit c366efa6e2.
2025-06-24 17:37:09 +02:00
Wolfgang Walther
c366efa6e2 Revert "workflows/labels: manage stale & merge conflict labels" 2025-06-24 14:00:20 +00:00
Wolfgang Walther
36e9fe9e7d workflows/labels: manage merge-conflict label for pull requests
The code comments describe much better what we do then a commit message
could ever do.
2025-06-24 14:46:59 +02:00
Wolfgang Walther
58dd9630c3 workflows/labels: manage stale label for pull requests
This manages the `2. status: stale` label for pull requests only (not
issues, yet) with the following conditions:
- The last event on the timeline of the Pull Request counts.
- Labeling and unlabeling of any kind are ignored.
- Older than 180 days are stale.
- Security labeled PRs are never stale.

To handle this label correctly, it's important to go through all pull
requests. Any approach to limit the list of PRs via search are not going
to work:
- Filtering by `updated` is not going to work, because it includes the
last time that *a label was set* on the PR. To actually find out whether
a PR is stale or not, the timeline of events needs to be looked at.
- Filtering by an existing stale label is not going to work either,
because such a label might have been added manually and thus breaking
the rules we set up here. Thus any existing label needs to be confirmed
as well.
2025-06-24 14:46:58 +02:00
Wolfgang Walther
63b9355ed8 workflows/labels: handle missing eval results gracefully
We keep working through the PR, even though we don't have any eval
results. This will allow actually managing labels for much older PRs as
well. Most importantly, it will allow merge-conflict and stale-labeling
next.
2025-06-24 14:46:57 +02:00
Wolfgang Walther
e55128a079 workflows/labels: run on every PR eventually
This replaces the manual dispatch trigger with a batched run through all
pull requests every day. This has the small benefit of not having to
worry about backfilling labeling after fixing bugs - and the much bigger
one in being able to handle merge-conflict and stale labels properly
later. For those, it's inevitable to eventually scan through all PRs.

At this stage, the vast majority of PRs will still be skipped, because
there won't be an eval run with artifact available. This will be
improved in the next step.

Technically, the workflow_dispatch trigger is kept to allow easily
testing this in forks, where the scheduled jobs are disabled. The
triggered job will behave similar to the scheduled job, though, and have
no special inputs.
2025-06-24 14:46:53 +02:00
Wolfgang Walther
d9d97fda59 workflows/labels: refactor to search instead of listing PRs
This doesn't provide much value in itself, yet, but is much more
flexible in the next step, when also looking at much older PRs.
2025-06-24 14:46:28 +02:00