Repository navigation
feat(ci): review gate as a reusable workflow; agent tools move to kadet-hub/ops - #12
Merged
Merged
Conversation
The review gate moves here from kadet-hub/registry#558 so every kadet-hub repository can call one copy, pinned by commit SHA (DEC-1). It counts only reviewer approvals of the head commit; neat-bot's status comment names no commit and a run that started before a push can report after it, so the comment does not count (DEC-2). The reviewer logins become an input with neat-bot as default (RG-1). Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
.github/workflows/review-gate.yml runs on workflow_call with the input reviewers (default neat-bot). It downloads review_gate.py through the contents API from job.workflow_repository at job.workflow_sha, the commit the caller pinned, and fails closed when the runner does not provide them. The job holds pull-requests: read only and checks out nothing, so a fork pull request gets nothing it could use. review_gate.py, fixtures.json and the tests come from kadet-hub/registry#558 (.github/actions/review-gate/). The decision is unchanged except that every login in reviewers must approve the head. Two fixtures cover a second reviewer, and Workflow checks the job's permissions and the pinned script. The test workflow runs them. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
mint-token, its test, the README and the session guide moved with their history to the private kadet-hub/ops, where the agent app is not installed. The tools workflow went with them, and CODEOWNERS no longer names tools/. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
…G-4) The README shows how a repository calls the review gate, pinned by commit SHA, and the name of the check a ruleset requires. It also holds a "How changes are reviewed" text for the repositories' READMEs: reviews are automated, neat-bot is an AI reviewer with a Qwen model (version tbd) and Claude Sonnet filtering its findings, and the maintainer can block a pull request with a change request. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
Shows the reusable workflow running on this pull request: job.workflow_sha, the contents download with a pull-requests: read token, and the decision. Reverted before the merge. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
|
6 finding(s), none judged useful, approved |
It ran on this pull request at 9e53e45: job.workflow_repository and job.workflow_sha resolved, the contents download worked with a pull-requests: read token, and the gate failed because neat-bot had not approved the head. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
…(RG-3a) The gate exempts a pull request by its author, which stays renovate[bot] when someone else pushes to the branch. RG-3a makes a renovate branches ruleset, Renovate and the admin role only, a condition for requiring the check; registry and recipes have one, the other repositories not yet. The README names it next to the caller. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
gh's error went into the captured stderr, and check=True ended the run with a traceback that did not say why. gh() now exits with "review gate failed: gh api <path>: <gh's message>", still failing closed. Api tests it. From neat-bot's finding on this pull request. Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
Signed-off-by: Moep90 <3042152+Moep90@users.noreply.github.com>
neat-bot
approved these changes
Nov 6, 2026
neat-bot
left a comment
There was a problem hiding this comment.
I went through this change and have nothing to flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The review gate from kadet-hub/registry#558, now a reusable workflow that each kadet-hub repository calls pinned by commit SHA.
tools/agent/leaves this repository: it moved with its history to the private kadet-hub/ops (kadet-hub/ops#1), where the agent app will not be installed. A public repository cannot call a workflow from a private one, which is why the gate lives here.Spec
docs/specs/review-gate.mdis new, prefixRG, plus a shortdocs/specs/README.mdthat points to the registry's spec format. The agent identity spec (AGT) moved to kadet-hub/ops; its AGT-11 points here for the decision rule.review-gate
.github/workflows/review-gate.ymlruns onworkflow_call. The inputreviewerstakes logins separated by spaces, defaultneat-bot, and each of them must approve. The job haspull-requests: readand nothing else, checks out nothing, and downloadsreview_gate.pythrough the contents API fromjob.workflow_repositoryatjob.workflow_sha, the commit the caller pinned. If the runner leaves those empty, the step fails instead of readingmain.The decision is the one from #558: the gate passes when every reviewer's latest review approves the head commit and nobody with write access has an open change request. Renovate's pull requests pass.
neat-bot's status comment does not count (DEC-2). I looked at how neat-bot reports on the last 60 pull requests of six repositories. "N finding(s), none judged useful" and "none above medium" come with an approval of the head only when the line ends in ", approved". Without that suffix the run posts no review at all. "no file was selected for review" means nothing was reviewed; the six such pull requests I opened changed only Markdown. The comment is a single comment rewritten by every run and names no commit, and a run that started before a push can write its result after it: in kadet-hub/examples#107 a push at about 08:21 UTC got "2 finding(s), none judged useful" seven seconds later from the run on the previous head. A time comparison would have passed the new head unreviewed, so the gate waits for an approval.
Calling it
README.md has the caller workflow. The check is named
review-gate / review-gate. No repository calls the gate yet; that is the rollout in kadet-hub/opsdocs/rollout.md, after this is merged.README.md also has the "How changes are reviewed" text for the repositories. It names neat-bot, the Qwen model it runs and Claude Sonnet, which filters its findings. The Qwen version is tbd (OQ-1); I still have to fill it in.
Verification
python3 -m unittest discover -s .github/review-gate -v: 5 tests, 13 fixture cases, pass. Nine mutations (only the first reviewer checked, head SHA or state ignored, a comment closing a change request, an extra or write permission, a checkout, the script read frommain, no empty top-level permissions) each made the suite fail.review_gate.pyagainst the live API, read-only with my token: registry#567, approved at its head, passes; registry#565, with only the status comment, fails; #567 with another SHA fails; a Renovate author passes without an API call; an emptyreviewersfails.--offline: no findings. actionlint 1.7.12 does not knowjob.workflow_repositoryandjob.workflow_shayet, and flagsubuntu-26.04as on the existing workflows.review-gate-selftest.yml) ran the gate on this pull request at 9e53e45 (run):job.workflow_repositoryandjob.workflow_sharesolved to this repository and the merge commit, the contents download worked with apull-requests: readtoken, and the gate failed because neat-bot had not approved the head. f03d449 removes the caller again.neat-bot's findings
renovate[bot]after someone else pushes to the branch. Fixed in 3a462b7: RG-3a requires arenovate branchesruleset (Renovate and the admin role) before a repository requires the check. registry and recipes have one, the other repositories don't yet; kadet-hub/ops#1 adds it to the rollout.gh's message. Fixed in df6d122: the gate now fails with the endpoint andgh's message, and the newApitest checks that.neat-bot's run on df6d122 ended with "10 finding(s), none judged useful" and again posted no review, so there is nothing left to fix, but no approval either. This pull request's own gate would stay red until neat-bot approves.