Retry transient read-only GraphQL failures beyond HTTP 502
Environment details
- OS: macOS 26.5 for the reproduction; Ubuntu 24.04 in CI
- Node.js version: 24.19.0 for the reproduction; Node 24 action runtime in CI
- npm version: 11.17.0 for the reproduction; not used by the bundled action
release-pleaseversion: 17.6.0, also bundled bygoogleapis/[email protected]
Steps to reproduce
Commit-history queries intermittently fail in CI with Something went wrong while executing your query or We couldn't respond to your request in time. The original HTTP status was not logged. The isolated reproduction below injects an HTTP 200 GraphQL error followed by a successful response; it requires no token, repository access or network requests.
- Using Node 24, create an empty directory and run
npm init -y, thennpm install --save-exact [email protected]. - Save the following snippet as
repro.cjsin that directory. - Run
node repro.cjs, thennode repro.cjs 502as a control. Dependency installation needs network access; running the reproduction does not.
const {GitHub} = require('release-please');
async function main() {
const status = Number(process.argv[2] || 200);
const message = process.argv[3] || 'Something went wrong while executing your query.';
let requests = 0;
const history = {
nodes: [],
pageInfo: {hasNextPage: false, endCursor: null},
};
const success = {data: {repository: {ref: {target: {history}}}}};
const github = await GitHub.create({
owner: 'example',
repo: 'example',
defaultBranch: 'main',
fetch: async () => {
requests++;
const body = requests === 1
? {data: null, errors: [{message}]}
: success;
return new Response(JSON.stringify(body), {
status: requests === 1 ? status : 200,
headers: {'content-type': 'application/json'},
});
},
});
try {
await github.mergeCommitIterator('main', {batchSize: 5}).next();
console.log('History query succeeded');
} catch (error) {
console.log(`${error.name}: ${error.message}`);
}
console.log(`Requests: ${requests}`);
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});Actual: the HTTP 200 case throws GraphqlResponseError after one request, without reaching the queued successful response. The 502 control retries and succeeds after two requests. Injected HTTP 500, 503 and 504 responses also stop after one request.
Expected: a bounded retry with backoff for recognized transient errors on read-only GraphQL queries, including GitHub's internal-error and timeout responses. Authentication, rate-limit and query-validation errors should retain their existing handling, including Retry-After and exhausted rate limits. Retry exhaustion should still fail; mutations and release/PR creation should not be replayed.
The 502-only guard in GitHub and the equivalent guard in GitHubApi remain in 17.11.2. That version was checked by source inspection; the reproduction above was run on 17.6.0.
Related: googleapis/release-please-action#1203 already identifies this retry gap alongside action-level output handling. This report isolates the library retry behavior. #2265 covers query-size timeouts, and #2783 adds adaptive page sizing for 502 responses. This reproduction still fails with a five-commit page size.
Source: googleapis/release-please