Repository navigation
[Fix] Label workflow strips has-conflicts when mergeability is unknown - #2028
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: Required CI passed. Waiting for automated review of the latest commit. If automated review does not start, a maintainer must restart it. Review-state labels are managed by this workflow; do not edit them manually. |
Related GitHub Issue
Fixes #2025
Description
The "Label PR review state" workflow removed
has-conflictsfrom PRs while GitHub had not yet computed mergeability. A conflicting PR gets no merge-ref CI run, so its required checks are missing. The workflow read this as "CI pending" and stripped every state label, includinghas-conflicts.The fix stays inside the CI pending/failed branch of the reconcile script in
.github/workflows/label-pr-review-state.yml:mergeable === nullormergeable_state === 'unknown').has-conflicts, the branch keeps that label and strips only the other state labels. The label is never added by this branch.has-conflictsas before.has-conflicts, unchanged.has-conflictsis kept, so run logs still explain the decision.Reviewers should check that the preservation is scoped to the CI pending/failed branch only. The conflict path, the mergeability recheck before maintainer handoff, and the failure cleanup path are unchanged.
Test Procedure
The workflow script is executed by the existing harness in
src/services/__tests__/pr-review-state-workflow.test.ts. Three new tests cover the issue cases:has-conflictsis kept, not re-added, and other state labels are stripped.has-conflictsis stripped per the existing rules.has-conflicts.Run
pnpm exec vitest run services/__tests__/pr-review-state-workflow.test.tsfromsrc/. All 198 tests pass. Fullpnpm testpasses (10,438 tests). ESLint andtsc --noEmitpass on the changed files.Pre-Submission Checklist
*.visual.tsxsnapshot inwebview-ui/. Seewebview-ui/AGENTS.md→ "When a UI change needs a snapshot".Documentation Updates
Additional Notes
This is a pure bug fix with no UI surface; visual proof is not applicable. The strongest evidence is the workflow-script test harness, which executes the embedded github-script against deterministic API doubles.
Get in Touch
Available via the PR or the Roomote links above.