Skip to content

[Fix] Label workflow strips has-conflicts when mergeability is unknown - #2028

Merged
edelauna merged 2 commits into
mainfrom
fix/keep-has-conflicts-unknown-mergeability-3prtzvy93b920
Oct 13, 2026
Merged

edelauna merged 2 commits into
mainfrom
fix/keep-has-conflicts-unknown-mergeability-3prtzvy93b920

Conversation

@ghost

@ghost ghost commented Oct 12, 2026

Copy link
Copy Markdown

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

Related GitHub Issue

Fixes #2025

Description

The "Label PR review state" workflow removed has-conflicts from 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, including has-conflicts.

The fix stays inside the CI pending/failed branch of the reconcile script in .github/workflows/label-pr-review-state.yml:

  • The branch now detects unknown mergeability (mergeable === null or mergeable_state === 'unknown').
  • When mergeability is unknown and the PR already carries has-conflicts, the branch keeps that label and strips only the other state labels. The label is never added by this branch.
  • When mergeability is known clean, the branch strips has-conflicts as before.
  • When mergeability is known dirty, the earlier conflict check runs first and labels has-conflicts, unchanged.
  • The log line notes when has-conflicts is 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:

  1. Unknown mergeability with missing required CI: has-conflicts is kept, not re-added, and other state labels are stripped.
  2. Known-clean mergeability with missing required CI: has-conflicts is stripped per the existing rules.
  3. Known-dirty mergeability with missing required CI: the conflict path adds has-conflicts.

Run pnpm exec vitest run services/__tests__/pr-review-state-workflow.test.ts from src/. All 198 tests pass. Full pnpm test passes (10,438 tests). ESLint and tsc --noEmit pass on the changed files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Visual Snapshot (UI changes only): If a user would notice this change at a glance (layout, theme tokens, brand elements, empty/error states), I added or updated a *.visual.tsx snapshot in webview-ui/. See webview-ui/AGENTS.md → "When a UI change needs a snapshot".
  • Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required. The change is internal workflow behavior; no user-facing documentation covers this label reconciliation logic.

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.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: Zoo-Code-Org/Zoo-Code/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 92e8f7c9-3ff6-49e8-95bb-fd147103b066

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review status

This 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. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@edelauna
edelauna marked this pull request as ready for review October 12, 2026 23:48
@edelauna
edelauna enabled auto-merge October 12, 2026 23:49
@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Oct 13, 2026
@edelauna
edelauna added this pull request to the merge queue Oct 13, 2026
Merged via the queue into main with commit af28417 Oct 13, 2026
29 of 30 checks passed
@edelauna
edelauna deleted the fix/keep-has-conflicts-unknown-mergeability-3prtzvy93b920 branch October 13, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Label workflow strips has-conflicts when mergeability is unknown

2 participants