Repository navigation
fix(ci): gate a draft pull request on deployment_status instead of skipping it green - #704
neromtoobad wants to merge 1 commit into
Conversation
…ipping it green ci run skipped every draft with exit 0, saying the gate runs once the PR is ready for review. That is only true for the pull_request trigger, whose types include ready_for_review. Under the deployment_status shape (Vercel and other deploy-every-PR platforms) marking a draft ready triggers no new deployment, so the skip left a passing check on the head commit that no later event replaced, and the PR could merge with no tests run. Drafts are now skipped only on pull_request/pull_request_target; on deployment_status the draft's preview, which already exists, is gated.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Event-specific draft handling src/commands/ci.ts, src/commands/ci-run.spec.ts, DOCUMENTATION.md |
The CI run skips drafts only for pull_request and pull_request_target events. A regression test checks dispatch for a draft found through a deployment_status event. The documentation describes the different draft handling for the two workflow shapes. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
TestSprite/testsprite-cli#650— The issue describes the deployment_status draft behavior addressed by this change.TestSprite/testsprite-cli#671— The change retains thepull_requestdraft skip path and does not address the reported missing JSON output.
Suggested labels: s4-cli-bonus, needs-issue
Suggested reviewers: zeshi-du
Merge Risk: 
Minimal · up to 12f51
-
The changes correctly gate drafts by event type and are ready to merge.
Pre-merge checks: 
5
-
Full details: Linked Issues check
-
Explanation
Issue
#701requires event-specific draft handling, documentation, and a regression test. The supplied PR evidence shows thatsrc/commands/ci.tsskips drafts only forpull_requestandpull_request_target, whiledeployment_statusdispatches the existing preview.src/commands/ci-run.spec.tscovers the draft deployment-status case withgithub-pr-7, andDOCUMENTATION.mddescribes the two behaviors. The reported test and type-check results also pass. The explicitly deferred no-PR-yet case is not required by#701.
Full details: Out of Scope Changes check
-
Explanation
The supplied change summary contains only the issue-related implementation, its regression test, and the related documentation update. The changes do not include the explicitly deferred no-PR-yet behavior or another unrelated feature.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Thanks for the PR, @neromtoobad! It links an issue, but that issue isn't assigned to you yet: #701 (unassigned). Per our workflow, claim the issue first by commenting |
|
🏆 Season 4 CLI Improvement Bonus: entry recorded. Thanks, @neromtoobad! To be counted, this PR needs the following by Oct 29, 11:59 PM PT:
Rewards go to merged PRs judged a genuine improvement, and up to three bonus-eligible PRs count per person. Untick the box to withdraw the entry. This comment refreshes when you edit the PR. Full rules. |
What does this PR do?
ci runskipped every draft PR with exit 0 and a notice saying the gate runs once the PR is ready for review. That only holds for thepull_requesttrigger, whosetypesincludeready_for_review. Under thedeployment_statusshape (Vercel and other platforms that deploy every PR), marking a draft ready triggers no new deployment. So the skip left a greentestsprite-testscheck on the head commit that no later event replaced, and the PR could be merged with no tests run.Drafts are now skipped only on
pull_request/pull_request_target. Ondeployment_status, the draft's preview, which already exists, is gated like any other PR. The DOCUMENTATION.md sentence that promised a re-run for both shapes now says this.Related issue
Closes #701
Season 4 CLI Improvement Bonus
Discord username: neromtoobad
Type of change
Checklist
mainbranch.(
feat(...),fix(...),docs(...), …).npm run lintandnpm run format:checkpass.npm run typecheckpasses.npm testpasses and coverage stays at or above the 80% gate.credentials required).
README.md/DOCUMENTATION.mdwhererelevant.
Notes for reviewers
src/commands/ci.ts: the draft skip checksGITHUB_EVENT_NAME. TheGithubRunContexttype is unchanged.ci-run.spec.ts. It fails onmain, where the draft is skipped and nothing is dispatched, and passes with the fix: the draft is dispatched withpreviewName: github-pr-7. The existingpull_requestdraft-skip test still passes.ci-run.spec.ts+ci.spec.ts159/159, full suite green,tsc/ Prettier clean.deployment_statusskip has the same lasting-green shape. Happy to follow up on whichever behaviour you prefer.Summary by CodeRabbit