fix: retry post-creation API calls on 422 to handle GitHub eventual consistency#4333
Open
dbeilin wants to merge 1 commit intopeter-evans:mainfrom
Open
fix: retry post-creation API calls on 422 to handle GitHub eventual consistency#4333dbeilin wants to merge 1 commit intopeter-evans:mainfrom
dbeilin wants to merge 1 commit intopeter-evans:mainfrom
Conversation
…onsistency After creating a PR, follow-up API calls (labels, milestone, assignees, reviewers) can fail with a 422 "Could not resolve to a node" error due to GitHub API eventual consistency. This adds targeted retry logic that only activates for newly created PRs, retrying 422 errors up to 2 times with a 1-second delay between attempts. Fixes peter-evans#4321 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
hi @peter-evans , this PR should address the label application issue. Let me know if you have any concerns. We're using your Action in a lot of our workflows and have been experiencing that label apply issue pretty often. Thanks |
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.
Summary
pull.created === true), up to 2 retries with 1s delay@octokit/plugin-retryconfiguration — this is scoped retry in the specific code path affected by GitHub API eventual consistencyContext
After creating a PR, follow-up REST API calls can fail with
422 Validation Failed: "Could not resolve to a node with the global id of '...'"because GitHub's API hasn't fully propagated the new PR internally. This is intermittent and timing-dependent.Fixes #4321
Test plan
retryWithBackoffutility (5 tests)npm run buildsucceeds🤖 Generated with Claude Code