fix(sdd-execute): trigger auto-revise on all failed checks, not just required#261
Conversation
…required
The check_suite implicit-/revise path gated on classic branch
protection's required status contexts, fetched with the default
GITHUB_TOKEN. That endpoint needs administration:read, which the
token lacks, so the lookup 403'd on most repos, the error was
swallowed as 'no required contexts', and the whole path was silently
dead — no failed check ever triggered a revise. It was also blind to
repository rulesets, and even where it worked it ignored failures on
non-required checks.
- New route input revise-on-checks ('all' | 'required', default
'all'): in 'all' mode every failure-conclusion check run in the
suite is actionable with no protection lookup at all; in 'required'
mode required contexts are resolved from repository rulesets (the
rules/branches endpoint, readable with a plain read token) merged
best-effort with classic branch protection (classic-API errors are
logged, not fatal).
- New route input revise-checks-exclude: comma-separated
check-run-name globs (* wildcard); matching failed runs never count
toward firing, in either mode.
- The three sdd-execute tier wrappers map the inputs from the
SDD_REVISE_ON_CHECKS / SDD_REVISE_CHECKS_EXCLUDE repo variables,
mirroring the max-review-iterations mapping.
- docs/sdd/install.md documents both variables.
The auto-revise-check marker budget (max-review-iterations), the
head-sha staleness guard, and the directive assembly (failing check
names + run URLs) are unchanged. Routing is wrapper/action-side, so
no lock recompile.
Fixes #259
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…pe (#259) The check_suite trigger and permissions comments in the three execute wrappers still described the issue #203 required-only behavior. Reword for the SDD_REVISE_ON_CHECKS default. Also log unrecognized revise-on-checks values before falling back to all-mode, and note glob case sensitivity in the variables table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR extends the SDD routing action to control check-failure auto-revise behavior via two new inputs: a mode selector ( ChangesConfigurable check-failure revise behavior
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Closes #259
Root cause
The check_suite branch in
sdd-route-executeresolved required contexts via classicgetBranchProtectionon the defaultgithub.tokenand treated any error as "no required contexts → do not trigger". That endpoint needs administration:read, whichGITHUB_TOKENlacks, so the path 403'd and was silently dead on many repos; it was also blind to rulesets. Even where it worked, failures on non-required checks never triggered the implicit/revise.Fix
.github/actions/sdd-route-execute/action.yml:revise-on-checks(all|required), empty default resolves toall. Inallmode the protection lookup is skipped; every failure-conclusion check run is actionable after exclusions. Unrecognized values log and fall back toall.revise-checks-exclude: comma-separated check-run-name globs (*wildcard, anchored, case-sensitive); matching runs never trigger.requiredmode fixed: required contexts resolved from repository rulesets (GET /repos/{o}/{r}/rules/branches/{branch}, paginated, plain read token) merged best-effort with classic protection; lookup errors are logged and contribute nothing instead of killing the path.<!-- sdd-execute:auto-revise-check -->marker budget capped bymax-review-iterations, the head-sha staleness guard, PR resolution, directive assembly (check names + run URLs).wrappers/sdd-execute-{haiku,sonnet,opus}.yml: mapSDD_REVISE_ON_CHECKS/SDD_REVISE_CHECKS_EXCLUDErepo vars (same pattern asmax-review-iterations); stale required-only trigger/permissions comments corrected.docs/sdd/install.md: two new variables-table rows.No agent sources or fragments changed; no lock recompile.
Behavior change
Default is
all: consumers consuming the action@mainget failed-check auto-revise on every failing check with no wrapper update. Worst case for a flaky advisory check is 3 revise runs (existing cap) then a visibleneeds-human— strictly better than silence. SetSDD_REVISE_ON_CHECKS=requiredto restore the old scope,SDD_REVISE_CHECKS_EXCLUDEto carve out advisory checks. Needs a release-note line at the next tag.Acceptance
sdd/branch triggers implicit/revisewithin the iteration cap.revise-checks-excludeglob suppresses a named check in either mode.requiredmode resolves contexts from rulesets without admin scope.node --check; glob matcher exercised with 12/12 passing cases; wrappers in lockstep; allscripts/test-*validation scripts pass.🤖 Generated with Claude Code