Skip to content

fix(success): query associated PRs in smaller serial chunks - #1319

Open
mihir-kandoi wants to merge 2 commits into
semantic-release:masterfrom
mihir-kandoi:fix/associated-prs-query-timeout
Open

mihir-kandoi wants to merge 2 commits into
semantic-release:masterfrom
mihir-kandoi:fix/associated-prs-query-timeout

Conversation

@mihir-kandoi

@mihir-kandoi mihir-kandoi commented Oct 22, 2026 •

Copy link
Copy Markdown

Problem

On a large release, the success step fails before it comments on any PR.

The plugin builds one getAssociatedPRs GraphQL query per 100 commits and sends all of them in parallel. A 100-commit query takes longer than GitHub's 10 second GraphQL limit, so the API returns 502/504. Depending on the response, the step fails with HttpError 504 or with TypeError: Cannot destructure property 'repository' of '(intermediate value)' as it is undefined (lib/success.js:81).

This happens on every large release of frappe/erpnext, for example v16.52.0 (708 commits) and v15.124.0 (331 commits). The release gets published, but no PR gets a comment.

Solution

  • Query 25 commits per request instead of 100.
  • Send the chunks one at a time, as GitHub recommends.

I replayed the plugin's query against the 708 commits of erpnext v16.52.0:

Chunk size Mode Result
100 parallel (current) 6 of 8 requests failed with 502/504 after about 11 s
25 parallel flaky: one run dropped the connection, one passed
25 serial (this PR) 29 of 29 requests passed, 3 to 6 s each

Steps to reproduce

  1. In a repository with a few hundred commits since the last release, run semantic-release with @semantic-release/github.
  2. See that the release is published.
  3. See that the success step fails with a 502/504 or the repository TypeError, and no PR gets a comment.

Large releases sent one GraphQL query per 100 commits, all at once. Each
query took over GitHub's 10 second limit, so the API returned 502/504 and
the success step failed before commenting on any PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant