Skip to content

[pre-push] Exponential backoff on GraphQL queries#284

Merged
joshlf merged 1 commit intomainfrom
Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f
Feb 9, 2026
Merged

[pre-push] Exponential backoff on GraphQL queries#284
joshlf merged 1 commit intomainfrom
Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f

Conversation

@joshlf
Copy link
Owner

@joshlf joshlf commented Feb 9, 2026


Latest Update: v4 — Compare vs v3

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v3 v2 v1 Base
v4 vs v3 vs v2 vs v1 vs Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base
⬇️ Download this PR

Branch

git fetch origin refs/heads/Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f && git checkout -b pr-Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f FETCH_HEAD

Checkout

git fetch origin refs/heads/Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f && git checkout FETCH_HEAD

Cherry Pick

git fetch origin refs/heads/Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f && git cherry-pick FETCH_HEAD

Pull

git pull origin refs/heads/Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link

Summary of Changes

Hello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the pre-push functionality by implementing exponential backoff for GraphQL queries. This change addresses potential issues with GitHub's resource limits when processing large batches of data, ensuring more reliable operation. Additionally, it removes an unnecessary dependency, itertools, which simplifies the project's dependency tree.

Highlights

  • Dependency Removal: The itertools crate has been removed as a direct dependency.
  • GraphQL Query Optimization: Implemented exponential backoff for GraphQL queries to handle resource limits imposed by GitHub, improving resilience and preventing failures when processing large batches.
  • Resource Limit Handling: Added logic to detect RESOURCE_LIMITS_EXCEEDED or MAX_NODE_LIMIT_EXCEEDED errors from GitHub's GraphQL API and reduce batch size accordingly.
Changelog
  • Cargo.lock
    • Removed itertools crate and its dependencies.
  • Cargo.toml
    • Removed itertools dependency.
  • src/pre_push.rs
    • Removed itertools import.
    • Implemented exponential backoff for GraphQL queries to handle GitHub resource limits.
    • Added error handling for RESOURCE_LIMITS_EXCEEDED and MAX_NODE_LIMIT_EXCEEDED GraphQL errors.
    • Adjusted batch processing logic to reduce batch size on resource limit errors.
Activity
  • The PR introduces exponential backoff for GraphQL queries to handle resource limits imposed by GitHub.
  • The PR removes the itertools dependency.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an exponential backoff mechanism for batched GraphQL queries, which is a robust improvement over the previous fixed-size chunking. This change will help avoid hitting GitHub's API resource limits. The implementation is sound, correctly handling backoff and retries. The logic for backoff, including the termination condition to prevent infinite loops, is well-thought-out. The removal of the itertools dependency is also a good cleanup. The suggestion to improve the readability of the error-checking logic is valid and has been retained.

@joshlf joshlf force-pushed the Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f branch from 5613f9e to ced400e Compare February 9, 2026 15:33
@joshlf joshlf changed the base branch from main to G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 February 9, 2026 15:33
@joshlf joshlf force-pushed the Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f branch from ced400e to b127886 Compare February 9, 2026 15:37
@joshlf joshlf force-pushed the G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 branch from 00950c2 to 33ce692 Compare February 9, 2026 15:37
Base automatically changed from G3d5c2ee786e5ab0192f326ea76ce310ca18eaaa7 to main February 9, 2026 15:40
gherrit-pr-id: Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f
@joshlf joshlf force-pushed the Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f branch from b127886 to b08a936 Compare February 9, 2026 15:43
@joshlf joshlf enabled auto-merge (squash) February 9, 2026 15:43
@joshlf joshlf merged commit 2cec13f into main Feb 9, 2026
1 check passed
@joshlf joshlf deleted the Gc0e59ffd39b0fa876f3a66dab1b0e97bb91a6f9f branch February 9, 2026 15:44
@joshlf joshlf mentioned this pull request Feb 9, 2026
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