Skip to content

Fix merge conflict detection in pr-review-needed workflow#13884

Merged
radical merged 3 commits intojamesnk/pr-tracking-action-wipfrom
copilot/sub-pr-13862-again
Jan 13, 2026
Merged

Fix merge conflict detection in pr-review-needed workflow#13884
radical merged 3 commits intojamesnk/pr-tracking-action-wipfrom
copilot/sub-pr-13862-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 13, 2026

Description

The workflow was incorrectly detecting merge conflicts because mergeable_state is not available in the pulls.list API response—it requires fetching individual PR details via pulls.get. Additionally, the initial implementation only checked for mergeable_state === 'dirty', which missed edge cases where PRs have merge conflicts but GitHub doesn't explicitly set the state to 'dirty'.

Changes:

  • Fetch full PR details individually to access mergeable_state and mergeable fields
  • Implement comprehensive conflict detection logic:
    • Primary check: mergeable_state === 'dirty' (definitive conflicts)
    • Secondary check: mergeable === false AND state is not blocked, behind, unstable, unknown, or clean (catches edge cases)
  • Add detailed comments explaining all possible mergeable_state values and their meanings
  • Exclude non-conflict blocking states (blocked by checks/reviews, behind base branch, unstable checks, etc.)

This ensures all PRs with actual merge conflicts are correctly identified and marked with the ❌ emoji in the tracking issue, including edge cases that were previously missed.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update PR review tracking workflow for better performance Fix merge conflict detection in pr-review-needed workflow Jan 13, 2026
Copilot AI requested a review from radical January 13, 2026 17:52
@radical
Copy link
Copy Markdown
Member

radical commented Jan 13, 2026

@copilot we are still missing some cases like #11363 - the report did not have X for it.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 13, 2026

@copilot we are still missing some cases like #11363 - the report did not have X for it.

Enhanced the conflict detection logic in commit 34f00bd. The workflow now checks both mergeable_state === 'dirty' and the broader case of mergeable === false (excluding states like blocked, behind, unstable, unknown, clean which indicate non-conflict blocking reasons). This should catch edge cases where GitHub reports a PR as unmergeable due to conflicts but doesn't explicitly set the state to 'dirty'.

@radical radical marked this pull request as ready for review January 13, 2026 18:21
@radical radical merged commit a2c9316 into jamesnk/pr-tracking-action-wip Jan 13, 2026
4 of 5 checks passed
@radical radical deleted the copilot/sub-pr-13862-again branch January 13, 2026 18:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants