feat(poller): CI-gate review readiness (red CI resumes to fix)#140
feat(poller): CI-gate review readiness (red CI resumes to fix)#140thejustinwalsh wants to merge 1 commit into
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds CI status detection and resume gating to the dispatcher. GitHub PR check status is parsed from ChangesCI Status Detection and Resume Gating
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
A PR isn't reviewable until it builds, so CI standing now participates in the review verdict (the spec note from the reconcile PR, implemented): - PrSnapshot carries a collapsed `ci` (deriveCiStatus over statusCheckRollup: any failure → failing, else any unfinished → pending, else passing; no checks → none). findPrForEpic fetches it. - classifyReviewOutcome is CI-gated: explicit review feedback still wins; else failing CI resumes to fix it (CI_FAILED decision); an APPROVED/0-actionable verdict while CI is pending is held (null) so the loop never ends on an un-built PR; passing/none resolves. Absent CI is non-blocking — the pre-CI review loop is unchanged. - The resume brief branches on CI_FAILED: a fix-CI brief (pull failing checks via gh, fix the cause, push once) distinct from the address-review brief. Deferred (noted in spec): dead/stuck-CI → waiting-human needs a pending timeout.
7c3f37c to
51ace4f
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
What
Make red CI a resume trigger and gate review-resolution on green CI — a PR can't be reviewed until it builds. Implements the spec note added in #139.
How
PrSnapshot.ci— a collapsedCiStatus(passing/failing/pending/none) fromstatusCheckRollup, via the pure, unit-testedderiveCiStatus(any failure → failing; else any unfinished check → pending; else passing; no checks → none; handles both CheckRun and legacy StatusContext shapes).findPrForEpicnow fetches it.classifyReviewOutcomeis CI-gated, with clear precedence:CHANGES_REQUESTED/ label) still wins — addressing it should green CI too;CI_FAILEDdecision);APPROVED/0-actionable verdict while CI is pending is held (null) so the loop never ends on an un-built PR;passing/noneresolves.Absent CI (
undefined→none) is non-blocking, so the pre-CI review loop is unchanged.CI_FAILED— a fix-CI brief (pull the failing checks viagh pr checks/gh run view --log-failed, fix the cause, push once), distinct from the address-review brief.What to verify
deriveCiStatus: none/passing/failing/pending across CheckRun + StatusContext; failure outranks pending —packages/dispatcher/test/poller-gateway.test.ts.classifyReviewOutcomeCI gate: failing→CI_FAILED; APPROVED+pending→null; APPROVED+passing→resolved; review feedback wins over red CI; absent CI unchanged —poller.test.ts.CI_FAILEDverdict resumes with the fix-CI brief (gh pr checks, "Push once"), not the address-review brief —implementation-workflow.test.ts.Deferred (noted in spec)
Dead/stuck CI →
waiting-humanneeds a pending-past-timeout detector; v1 re-polls a pending PR (cheap — no resume fired) until it reports.Summary by CodeRabbit
Release Notes
New Features
Tests