feat(tbd_ship): gate auto-merge on the risk tier; unclassified is not low (#63) (#73)
CD / Lint / Test / Vet (push) Successful in 11s
CD / Build & Import (push) Successful in 4s
CD / Deploy via GitOps (push) Skipped

Co-authored-by: Mathias <mthbqv@gmail.com>
This commit was merged in pull request #73.
This commit is contained in:
2026-10-08 06:02:34 +00:00
committed by mathias
parent dbf78a3b34
commit d3faffc4c4
4 changed files with 273 additions and 21 deletions
+7
View File
@@ -125,6 +125,13 @@ by area:
| Search / Templates | code_search, create_project_from_template |
| Composite | tbd_ship (trunk-based ship helper) |
**`tbd_ship` merge gate (gitea-mcp#63).** A PR is squash-merged only when ALL of: the head commit's CI is fully green,
the base branch is not review-protected, and the issue named in `issue` carries **exactly one** `risk/` label, `risk/low`.
No `issue`, no `risk/` label, several, an unknown value (`risk/lowish`), `risk/medium`, `risk/high`, or an issue that
cannot be read all fail closed: the PR is opened, `merged:false`, with a `reason` and the `risk` tier in the result.
Unclassified is not low. Limit: the gate enforces the tier of the issue the caller names; it cannot prove that issue is
the one the change belongs to, so the link is the caller's claim (the convention in local-dev rule 5 still applies).
Shared tool-layer hygiene (`internal/tools/tool.go`):
- **Alias normalization** — `repo`↔`name` and `number`↔`index` are reconciled so
a tool works whichever spelling a caller sends (an explicit canonical wins).