Repository navigation
fix(success): query associated PRs in smaller serial chunks - #1319
mihir-kandoi wants to merge 2 commits into
Conversation
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.
|
Thanks for this PR and for the measurements. I looked into the same erpnext failure independently and opened #1335 before I saw this PR. My PR also runs the chunks one after another, so it includes the change in this PR. I found that 25 commits per query is not always enough. On a backport branch, one commit can link to many PRs, and the current query loads all PR fields for each link. I replayed both approaches on the v15.124.0 release (332 commits) that this PR names:
The 332 commits link to PRs 8,105 times, but there are only 124 unique PRs. My PR first loads only the PR numbers, then loads the full fields once for each unique PR. Each query stays far below GitHub's 10-second limit. My PR also fixes the pagination of If you agree, I suggest closing this PR in favour of mine. Your review there is welcome. |
Problem
On a large release, the
successstep fails before it comments on any PR.The plugin builds one
getAssociatedPRsGraphQL 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 withHttpError 504or withTypeError: 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
I replayed the plugin's query against the 708 commits of erpnext v16.52.0:
Steps to reproduce
semantic-releasewith@semantic-release/github.successstep fails with a 502/504 or therepositoryTypeError, and no PR gets a comment.