feat(issues): Expose mergeable_state on group pull requests#120170
Draft
jshchnz wants to merge 1 commit into
Draft
feat(issues): Expose mergeable_state on group pull requests#120170jshchnz wants to merge 1 commit into
jshchnz wants to merge 1 commit into
Conversation
The endpoint already fetches the provider PR as a status fallback and discarded its merge-readiness fields. Now open PRs always consult the provider (behind a short-lived cache) and the response gains mergeableState — GitHub's clean/unstable/blocked/dirty/behind, normalized, unknown for unrecognized values, null for terminal PRs or when the provider is unavailable. Stored lifecycle fields still answer merged/closed without a round-trip and back the status up when the provider fetch fails. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
mergeableStateto the group pull-requests endpoint (/issues/{id}/pull-requests/) so the UI can tell whether a linked PR is actually ready to squash-and-merge or blocked.What
client.get_pull_request()as a status fallback and discarded the merge-readiness fields in the response. Those fields are now parsed:mergeableStateis GitHub'smergeable_state, lowercased —clean(ready to merge),unstable(checks failing but mergeable),blocked(required checks/reviews outstanding),dirty(conflicts),behind(needs rebase) — with unrecognized values collapsing tounknownandnullfor terminal PRs or when the provider is unavailable.LinkedPullRequestResponsegains the typed field;LinkedPullRequestSerializertakes the new mapping as an optional keyword, so other callers are unaffected.Why
The Seer Autofix overview (#120163) shows runs whose last step is "review and merge the PR" — a merge-readiness badge next to the PR link needs this field. Frontend consumption lands separately once this deploys.
🤖 Generated with Claude Code