Commit graph

151 commits

Author SHA1 Message Date
Emily
fcb9bf6c05
ci: get supported systems from the target branch 2026-03-01 16:07:49 -05:00
luojiyin
7a91c688bc
fix: typo Enqueing -> Enqueuing in merge.js 2026-03-01 13:59:59 +08:00
Michael Daniels
3a4282bc13
ci/github-script: add instructions for dependency updates 2026-02-15 10:21:31 -05:00
Michael Daniels
d70a72500c
ci/github-script: update dependencies, npm audit fix
`@actions/artifact` and `commander` now match the versions
used in `.github/workflows/bot.yml`.
2026-02-15 09:39:57 -05:00
Michael Daniels
963f784f6d
ci/github-script/lint-commits: support PRs with over 250 commits, check for "fixup!" commits (#486796) 2026-02-14 18:56:15 +00:00
Michael Daniels
1921190502
ci/github-script/lint-commits: check for "fixup!" and friends 2026-02-11 14:13:21 -05:00
Michael Daniels
c7eee1a755
ci/github-script/lint-commits: support PRs with over 250 commits
We want to be able to check python-updates.
2026-02-11 14:13:20 -05:00
Michael Daniels
0a07e4e187
ci/github-script/lint-commits: fix development branch check
https://redirect.github.com/NixOS/nixpkgs/pull/487628 should have had this
job fail, but [didn't](https://github.com/NixOS/nixpkgs/actions/runs/21753302803/job/62756645701?pr=487628#step:3:18),
because the head branch was named `master`.
2026-02-07 19:51:41 -05:00
Silvan Mosberger
55faf59a25 ci: Fix team review requests from the bot
https://github.com/NixOS/nixpkgs/actions/runs/21782693200/job/62849125010
2026-02-07 17:34:25 +01:00
Silvan Mosberger
71e704768d ci/github-script/reviewers.js: Fix reviewer API request
It takes arrays, not sets, see https://github.com/NixOS/nixpkgs/actions/runs/21735690914/job/62700395870?pr=487491
2026-02-07 16:04:18 +01:00
Silvan Mosberger
b0b2c24be9 ci: First-class team package maintainer review requests
Co-Authored-By: Alexander Bantyev <alexander.bantyev@tweag.io>
2026-02-07 13:52:46 +01:00
Michael Daniels
e3f053a65d
ci/github-script/check-target-branch: fix kernel exemption logic
Erroneously failed to exempt because I left out an if condition.
2026-02-06 18:59:41 -05:00
Michael Daniels
0d74c65927
Revert "ci: First-class team package maintainer review requests"
This reverts commit 193deb8533.
2026-02-05 21:50:27 -05:00
Philip Taron
ba626b8a60
First-class GitHub team reviews (#456481) 2026-02-06 01:44:31 +00:00
Silvan Mosberger
193deb8533 ci: First-class team package maintainer review requests
Co-Authored-By: Alexander Bantyev <alexander.bantyev@tweag.io>
2026-02-05 14:52:47 +01:00
Michael Daniels
7a74549a85
ci/github-script/reviews: detect reviews belonging to commits.js
See comment, but TLDR this is for backwards-compatibility.

(See 479628, where it failed to dismiss after fixing.)

We don't bother with `prepare.js` because it always errors
(and so should never be dismissed).

I have simply added the needed comments to each of `check-target-branch.js`'s
pre-existing reviews, because there are so few.
2026-01-26 19:37:56 -05:00
Michael Daniels
c693894f8a
ci: make reviews sticky; ci/github-script/check-target-branch: do not "Request changes", add exemptions (#483828) 2026-01-26 23:17:38 +00:00
Michael Daniels
31876b4580
ci/github-script/bot: refine regexes 2026-01-25 20:19:18 -05:00
Michael Daniels
c9225057c9
ci/github-script/check-target-branch: do not "Request changes"
You can technically have multiple reviews requesting changes, but
there's no good way to dismiss all of the reviews requesting changes from
the same user using the UI.

This makes minimization impossible (because all but one of the reviews is not
dismissed, even though the PR is no longer blocked due to the review
in GitHub's system).

As a workaround, we will only comment.

CI will still fail when appropriate.
2026-01-25 19:46:46 -05:00
Michael Daniels
e1e5b8ad91
ci/github-script/check-target-branch: kernel updates should not need to go to staging-xx.xx 2026-01-25 19:10:51 -05:00
Michael Daniels
cd6bc04a06
ci/github-script/check-target-branch: loosen staging threshold for home-assistant 2026-01-25 19:10:50 -05:00
Michael Daniels
50590d21d5
ci/github-script/check-target-branch: simplify rebuildsAllTests variable 2026-01-25 19:10:50 -05:00
Michael Daniels
99c1a35b73
ci/github-script/check-target-branch: add type for changed-paths.json 2026-01-25 19:10:50 -05:00
Michael Daniels
4447561c05
ci/github-script/{reviews,check-target-branch,commits,prepare}: add sticky review support 2026-01-25 19:10:50 -05:00
Michael Daniels
3fb23e6837
ci/github-script/reviews: enable typescript 2026-01-25 16:53:07 -05:00
Michael Daniels
c717c98bc8
ci/github-script/bot: only look at commit subject when deciding if a package is new/updated 2026-01-25 16:11:24 -05:00
Aliaksandr
bf5645a0ed
ci(bot): auto-label package updates with '8.has: package (update)'
Checks all PR commit messages for version update pattern
like 'packagename: X.Y.Z -> A.B.C'.

Matches: 1.2.3, 0-unstable-2024-01-15, 1.3rc1, alpha, unstable
2026-01-24 01:15:36 +02:00
Aliaksandr
bb0ec76b44
ci(bot): auto-label new package PRs with '8.has: package (new)'
Checks all PR commit messages for ': init at' pattern and
requires eval to report added packages (attrdiff.added).
2026-01-24 01:15:35 +02:00
Aliaksandr
033eccc028
ci(bot): add fork compatibility for team lookups
Forks don't have NixOS teams, return empty list to avoid 404.
2026-01-24 01:15:35 +02:00
Aliaksandr
0557411308
ci(bot): add fork compatibility for maintainer map
In forks without merge-group history, return empty maintainer
map instead of throwing an error.
2026-01-24 01:15:35 +02:00
Matt Sturgeon
5c558b976c
ci/github-script/bot: handle deleted maintainer accounts gracefully (#481949) 2026-01-20 22:11:58 +00:00
Emily
742b1081c5 Revert "ci/github-script/bot: skip mergeability checks temporarily"
Apparently any effects from this change haven’t shown up noticeably
in GitHub’s metrics, to the point where they’re not sure if it
was taking effect on the backend. Our contact is going to look at
getting something into the API response to help debug whether it’s
actually working or not, but agreed that we should just revert for
now. Since they have apparently reduced replica sync issues further
through other changes on their end, there shouldn’t be any urgent
need to make any changes here anyway.

This reverts commit 18b30c8ce1.
2026-01-20 16:19:16 +00:00
Philip Taron
e6e6c544ae
ci/github-script/bot: handle deleted maintainer accounts gracefully
When a maintainer deletes their GitHub account, the bot would crash with a 404 error when trying to fetch their user info via `/user/{id}`.

This caused the scheduled bot workflow to fail repeatedly until manual intervention (e.g., closing/reopening the affected PR to clear the requested reviewer).

Fix by returning null from getUser() for 404 responses and filtering out null users when building the reviewers list.
2026-01-20 06:27:34 -08:00
Michael Daniels
a4d5f8a6b1
{workflows/eval,ci/github-script}: check for mass rebuilds targeting master/release-* branches 2026-01-19 13:02:09 -05:00
Michael Daniels
0ba1ea61e3
ci/github-script/reviews: allow leaving review comments 2026-01-19 11:29:53 -05:00
Michael Daniels
e05e984689
ci/github-script/reviews: rework dismissal/non-posting logic
Dismissals are done automatically by commits.js, even for reviews from
check-target-branches.js. This is not desirable.

The solution is
(1) do not decline to post a review because it was already dismissed
    (because it may have not been dismissed by a human, and circumstances may
    have changed), and
(2) reword the auto-dismissal message to not imply that whatever
    problems were present are fixed.
2026-01-19 11:29:47 -05:00
aleksana
c04dc5869d workflows/lint: require to contain a colon with a whitespace
This restricts github automatically merging master with commit message
"Merge branch 'NixOS:master' into ...". Although we don't explicitly
prohibit not space after colons, we don't use it in any of the examples.
It's also enforced in https://www.conventionalcommits.org/en/v1.0.0/
2026-01-09 16:40:09 +08:00
Matt Sturgeon
7cfe9b8c85
workflows/lint: fully skip the commits job in Merge Queues
Follow-up to 7cf5972410

While the JS script already returned early, we can save a few resources
by skipping the job entirely when there's no `pull_request` context.
2025-12-18 13:09:17 +00:00
Matt Sturgeon
e97d1c56ad
{workflows/lint,ci/github-script}: lint commit messages (#470523) 2025-12-18 12:41:54 +00:00
Emily
18b30c8ce1 ci/github-script/bot: skip mergeability checks temporarily
This is an experiment and can be reverted a few days from now; if
the results are positive on GitHub’s end, then we may want to make
the merge conflict checks run less frequently than the rest of the
labelling tasks.
2025-12-15 17:40:03 +00:00
Michael Daniels
7cf5972410
{workflows/lint,ci/github-script}: lint commit messages 2025-12-13 16:43:41 -05:00
Michael Daniels
3b4575c8c9
ci/github-script/commits: clarify commit hash not found message
Per matrix.
2025-11-28 18:04:01 -05:00
Michael Daniels
74c008760e
ci/github-script/bot: don't attempt to fetch pagination cursor if it's expired
I fixed this for the maintainer maps, but the artifact that was causing the
particular issue that prompted me to try to fix it was actually the
pagination cursor. So fix that too.

Related: #464046.
2025-11-22 15:36:38 -05:00
Michael Daniels
25b6c45ef4
ci/github-script/reviewers: convert all usernames to lowercase (part 2)
Context: #464046
2025-11-22 15:24:39 -05:00
Michael Daniels
a88711a02d
ci/github-script/reviewers: convert all usernames to lowercase
Should fix https://github.com/nixos/nixpkgs/pull/463686#issuecomment-3563126753
2025-11-22 15:00:42 -05:00
Michael Daniels
040aeda1e7
ci/github-script/bot: log author of pull request
Should help debug "Review cannot be requested from pull request author."
in https://github.com/NixOS/nixpkgs/actions/runs/19591357890/job/56110301046#step:6:4726.
2025-11-22 11:54:25 -05:00
Michael Daniels
ce3d550556
ci/github-script/bot: skip expired artifacts
Should prevent "Unhandled error: HttpError: Artifact has expired", as was
present in e.g. https://github.com/NixOS/nixpkgs/actions/runs/19594659032.
2025-11-22 11:39:10 -05:00
Wolfgang Walther
4cb689fd65
ci/github-script/prepare: fix with missing release- branch
The prepare script is currently failing for staging-25.11 PR's, because
it assumes that a release-25.11 exists respectively. This is not the
case in the transition phase before branch-off.

We can fix this by always including the current target branch in the
branches to check for, even if it's not a WIP branch. This means we
might check some branches twice, but that's better than erroring out
entirely when the branch is in fact correct.
2025-11-18 19:04:30 +01:00
Wolfgang Walther
28a32416fb
Revert "ci/github-script/labels: close empty PRs"
This reverts commit 402b41c125.

GitHub' API repeatedly returns wrong data which causes closed PRs when
the changes had not been merged, yet.

We have closed a bit more than 100 PRs overall, most of them initially -
the feature is not really that important overall.
2025-11-18 09:20:08 +01:00
Wolfgang Walther
d767570291
ci/github-script/bot: skip PR checks when stale
It makes not much sense to run all the checks for PRs when we can
already tell they are stale beforehand. In particular this should avoid
creating ~3.3k temporary merge commits every day, for PRs that surely
won't have had any change.

The number of merge commits *could* play a role in the growing size of
the fork network. We'll have GitHub look into the metrics before and
after this change to see whether that is any improvement.
2025-11-17 20:48:02 +01:00