Commit Graph

188 Commits

Author SHA1 Message Date
Aliaksandr
926237f642 ci/github-script/merge: share reviews fetch with bot.js, drop events
`bot.js` already pulls reviews via GraphQL for the approval-count
labels. Move that fetch above the `handleMerge` call, add `commit
{ oid }` to the query, and pass the result through. `handleMerge` no
longer issues its own `listReviews` REST call.

While here, the `approvals` set is now derived from the same reviews
data. Two upsides:

- A reviewer who approved and was later dismissed no longer counts
  towards the approval check; their review now surfaces with state
  DISMISSED instead of leaving a stale `reviewed` event behind.
- `events` is no longer needed by `runChecklist` (it was only feeding
  the approvals filter); the parameter is dropped from both call
  sites. `handleMerge` still uses `events` for tracking the latest
  push and merge-command comments.

Also drop the redundant `user` truthy checks (and the stale "some
users have been deleted" comment) in `runChecklist`. The GraphQL
query uses `author { ... on User { login id } }` and bot.js then
filters via `r.user?.login`, so by the time reviews reach
`runChecklist` every entry already has a populated `user`. Verified
by querying real PRs: bots surface as `{__typename: "Bot"}` (no
`login`/`id`, filtered out by bot.js), and deleted accounts surface
as the "ghost" user (login `"ghost"`, id `10137`), which passes the
filter but matches no committer - harmless for both checks.

Assisted-by: claude-code with claude-opus-4-8[1m]-high
(cherry picked from commit 0c1c3d4813)
2026-06-25 17:10:54 +00:00
Aliaksandr
e934e8a364 ci/github-script/merge: clarify Auto Merge follow-up tip
The previous tip ("Sometimes GitHub gets stuck after enabling Auto
Merge") didn't explain why nothing happens immediately after the bot's
"Enabled Auto Merge" reply, leaving maintainers unsure whether to wait
or intervene. Spell out that Auto Merge waits for required CI before
queueing, that a later CI failure leaves the PR un-queued until it is
fixed, and link to GitHub's documentation; keep the existing "leave
another approval" workaround for the rare cases where Auto Merge stalls
after CI completes.

Assisted-by: claude-code with claude-opus-4-8[1m]-high
(cherry picked from commit 6f9325fb5d)
2026-06-25 17:10:53 +00:00
Aliaksandr
86980620a2 ci/github-script/merge: refuse merge when a committer has requested changes
A "changes requested" review from a committer blocks both the merge
queue and auto-merge, but unlike approvals it isn't auto-dismissed
when new commits are pushed. Surface it as a checklist item so the
bot's reply explains the block instead of silently enabling
auto-merge that will never trigger.

Implementation pulls every review for the PR via `listReviews` and,
for each committer, takes the latest review whose state is
`APPROVED`/`CHANGES_REQUESTED`. The check fails if any committer's
latest stance is `CHANGES_REQUESTED`. Other review states fall out
naturally:

- A dismissed review surfaces as `DISMISSED`, so a committer
  dismissing their own changes-requested review unblocks the PR.
- A comment-only follow-up surfaces as `COMMENTED`, so it doesn't
  override an earlier actionable review - the prior stance still
  stands until the committer explicitly approves or requests changes
  again.

Assisted-by: claude-code with claude-opus-4-8[1m]-high
(cherry picked from commit b94b44d3f9)
2026-06-25 17:10:53 +00:00
Aliaksandr
139a66fe7e ci/github-script/merge: skip auto-merge when CI has already failed
The merge bot falls back to GitHub Auto Merge whenever the merge queue
won't accept a PR yet. That is the right move while CI is still
running, but pointless once CI has already failed: Auto Merge can never
trigger, and fixing CI requires a new push, which invalidates the merge
command anyway (the bot only acts on comments after the latest push).

Fetch the `no PR failures` commit status and, when the merge-queue
enqueue fails, branch on it. If CI has already failed
(`error`/`failure`), skip Auto Merge and reply that a fresh
`@NixOS/nixpkgs-merge-bot merge` comment is needed once CI is green
again. Otherwise (pending or missing status) enable Auto Merge as
before.

`merge()` now returns `{ reaction, messages }` so the CI-failure path
can leave a thumbs-down reaction rather than the rocket used for an
actual merge.

Closes #512554.

Assisted-by: claude-code with claude-opus-4-8[1m]-high
(cherry picked from commit da97bf8423)
2026-06-25 17:10:53 +00:00
Michael Daniels
ce0b8cc5dd ci/github-script/merge: ignore case when checking for merge bot comment
(cherry picked from commit 41876c6de2)
2026-06-06 19:21:06 +00:00
zowoq
fcf9006e23 linux: add stable staging-nixos workflow
stable counterpart to d28cc2a2f5

(cherry picked from commit 10056dd40d)
2026-05-29 22:26:23 +00:00
zowoq
c103da6a19 ci: add nixosTests.simple-container
nixosTests.simple-vm but using an nspawn container
2026-05-22 21:24:34 +10:00
zowoq
244b700403 nixosTests.simple-vm: rename from nixosTests.simple
renamed because we now have different kinds of tests
2026-05-22 21:24:28 +10:00
Michael Daniels
843634b667 Revert "ci/github-script/reviewers: revoke stale review requests"
This reverts commit 2d34258228.
2026-05-18 17:26:09 -04:00
Michael Daniels
acb7b7a38c Revert "ci/github-script/reviewers: keep team members when revoking stale requests"
This reverts commit b721b82180.
2026-05-18 17:25:58 -04:00
Harinn
b721b82180 ci/github-script/reviewers: keep team members when revoking stale requests
Fixes:
https://redirect.github.com/NixOS/nixpkgs/pull/519758#issuecomment-4478985966
2026-05-18 23:14:26 +07:00
Michael Daniels
b7c50a3b8b ci/github-script/reviewers: revoke stale review requests (#519758) 2026-05-17 20:10:05 +00:00
Michael Daniels
6acad97b9c ci/github-script: update npm versions (#520661) 2026-05-17 18:47:56 +00:00
Michael Daniels
8a89d7a286 ci/github-script: update npm versions 2026-05-17 14:41:57 -04:00
zowoq
adabcdead3 ci/github-script/check-target-branch: disable review for xanmod kernels
updates should go to master or release branches
2026-05-17 05:05:13 +00:00
Michael Daniels
5d87d9aaa0 ci/github-script: npm audit fix (#520287) 2026-05-15 23:30:33 +00:00
Harinn
2d34258228 ci/github-script/reviewers: revoke stale review requests
New feature: revoke review requests from a reviewer when the reason they
were review-requested in the first place is gone (e.g. force-pushed),
while preserving reviewers who voluntarily engaged.
2026-05-15 11:02:42 +07:00
Michael Daniels
c642405dbe ci/github-script/prepare: fix review dismissals
I broke this in 1c3e149546 (diff-9baa1b84a40210e20622eeb04bea6db28ef3ff90dea79aa54ba9d1e27c150b21).

See #520239 for an example of this not working.
2026-05-14 22:00:55 -04:00
Michael Daniels
95e34c848b ci/github-script: npm audit fix
Fixes Dependabot alerts.
2026-05-14 20:50:51 -04:00
Michael Daniels
f5ee5762f0 ci/github-script/manual-file-edits: skip on PRs from one dev branch to another
Same logic as in lint-commits.

Fixes https://matrix.to/#/!EoslJfrUGMtQOAfnht:lassul.us/$govFR3OHnME2TZh7tcDSJfXAEfnMVUevnv4l5y4qFD0?via=nixos.org&via=matrix.org&via=catgirl.cloud
2026-05-08 13:37:28 -04:00
Michael Daniels
169fe20ef5 ci/github-script/lint-commits: confirm Git names/emails are present (#516199) 2026-05-06 13:29:51 +00:00
Michael Daniels
4d776b4670 ci/github-script/lint-commits: confirm Git names/emails are present
Prevents issues reported on Matrix by Jujutsu users,
caused by people omitting these fields.
2026-05-05 17:39:22 -04:00
Michael Daniels
1c3e149546 Reapply {ci,workflows}: allow multiple blocking reviews"
A couple of bugfixes, but the problem was that the apps weren't installed.
2026-05-03 18:17:03 -04:00
Michael Daniels
cd2e5a371b Revert "{ci,workflows}: allow multiple blocking reviews" 2026-05-03 13:21:39 -04:00
Michael Daniels
636fc13366 {ci,workflows}: allow multiple blocking reviews 2026-05-02 18:09:26 -04:00
Michael Daniels
bf5b890773 ci/github-script/merge: clarify maintainership is based on target branch 2026-04-25 16:29:04 -04:00
Michael Daniels
3b14bf26b5 ci/github-script/manual-file-edits: init (#509418) 2026-04-17 01:33:15 +00:00
Kamil Monicz
8926c73f50 ci/eval/compare: Expose attrdiff by kernel and platform 2026-04-13 10:53:48 +00:00
Michael Daniels
bd7e8b992b ci/github-script/manual-file-edits: init
Blocks manual edits to github-teams.json
2026-04-12 19:57:37 -04:00
Michael Daniels
8c720affeb ci/github-script/merge: don't consider draft PRs eligible for merge bot
Fixes #499676
2026-03-14 11:09:29 -04:00
Michael Daniels
7d1f3b5df9 ci/github-script/lint-commits: fix link to commit conventions 2026-03-13 18:17:24 -04:00
Michael Daniels
3c8a2add7b ci/github-script/lint-commits: error when conventional commit format is used (#495531) 2026-03-12 22:09:37 +00:00
Michael Daniels
58f002f950 ci/github-script/lint-commits: error when conventional commit format is used
E.g. https://redirect.github.com/NixOS/nixpkgs/pull/495442
2026-03-12 18:04:33 -04:00
Michael Daniels
d03b81d689 ci/github-script: don't use GH API when getting commit info, return only subject 2026-03-12 18:04:32 -04:00
Michael Daniels
743ab29528 ci/github-script: split getting commit details for PR into its own file 2026-03-12 18:04:32 -04:00
Michael Daniels
a8fce8701c ci/github-script/merge: log when queuing/enabling merge 2026-03-10 19:33:48 -04:00
axodentally
86447ec024 ci/github-script/merge: add more documentation links to bot's comment 2026-03-09 11:57:41 +01:00
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