Repository navigation
[Fix] has-conflicts label flaps off while GitHub recomputes mergeability - #2048
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 |
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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #2045
Description
The label workflow removed
has-conflictsfrom PRs that still had merge conflicts. This happened when GitHub transiently reportedmergeable: null/mergeable_state: "unknown"while it recomputed mergeability after a push. Unknown mergeability was only handled in the CI-pending/CI-failed branch (#2028) and in theawaiting-maintainerrefetch. When CI passed with any other result,reconcileLabels(pr, desiredLabel)strippedhas-conflicts. The label came back on a later run, so it flapped.How this PR fixes it:
has-conflicts, the label is kept. It is never added when absent.reconcileLabelsaccepts akeepLabelsparameter. The final reconcile passeshas-conflictsthrough it when mergeability is unknown.mergeableandmergeable_state, so the next case names its cause.One deliberate deviation from the issue's proposed fix, step 2: the
awaiting-maintainerbranch keeps its refetch-time unknown-mergeability handling ("mergeability pending"). That guard is not redundant. It protects the maintainer handoff from a head change between the shard's first fetch and labeling, and existing tests depend on it (#1584). Only the truly duplicated computation was removed.Test Procedure
keeps has-conflicts while mergeability is unknown and required CI passes (#2045)insrc/services/__tests__/pr-review-state-workflow.test.ts. Verified it fails against the pre-fix workflow and passes with the fix.pnpm exec vitest run services/__tests__/pr-review-state-workflow.test.ts— 202/202 tests pass, including the [Fix] Label workflow strips has-conflicts when mergeability is unknown #2028 tests.pnpm run check-types(tsc --noEmit) passes.Pre-Submission Checklist
Visual Snapshots
Not applicable. This PR changes a GitHub Actions workflow and its test harness. There is no rendered UI.
Videos (interaction / animation only)
Not applicable. No interaction or animation changes.
Documentation Updates
Additional Notes
Behavior notes for reviewers:
has-conflictslabel is unchanged: the workflow proceeds as before.awaiting-maintainerrefetch later reports known-clean mergeability, a kepthas-conflictslabel self-corrects on the next reconciliation.Get in Touch
Roomote on Discord (thread linked above), on behalf of the issue author @edelauna.