Skip to content

fix: retry addIssueLabels on 422 Issue not found#2782

Open
marcopeise wants to merge 2 commits into
googleapis:mainfrom
marcopeise:fix/retry-add-issue-labels-422
Open

fix: retry addIssueLabels on 422 Issue not found#2782
marcopeise wants to merge 2 commits into
googleapis:mainfrom
marcopeise:fix/retry-add-issue-labels-422

Conversation

@marcopeise
Copy link
Copy Markdown

@marcopeise marcopeise commented May 21, 2026

Summary

When release-please creates a release PR and immediately calls issues.addLabels, GitHub can return HTTP 422 Issue not found because the PR is not yet indexed on the replica serving label mutations (eventual consistency).

This retries addIssueLabels up to 3 times with linear backoff (1s, 2s, 3s) when that specific error occurs.

Production impact (reporter)

Reporter confirmed in a private production workflow (Apr 13, 2026) with issues: write configured. PR was created successfully; label step failed in the same second:

✔ Successfully opened pull request: 741
##[error]release-please failed: Validation Failed: {"resource":"Label","code":"unprocessable","field":"data","message":"Issue not found"} - https://docs.github.com/rest/issues/labels#add-labels-to-an-issue

Release PR was merged without autorelease: pending; no tag/release until manual recovery.

Test plan

  • isIssueNotFoundLabelError unit tests for 422 detection
  • nock integration tests: retry then success; exhausted retries throw GitHubAPIError

Fixes #2754

@marcopeise marcopeise requested review from a team as code owners May 21, 2026 23:26
@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 21, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

addIssueLabels should retry on 422 "Issue not found" after PR creation

2 participants