Skip to content

Fix the babysit files limitation with pagination logic#5191

Merged
SwarnaBharathiMantena merged 1 commit intoGoogleCloudPlatform:developfrom
SwarnaBharathiMantena:swarnabm/update_babysit_files_limitation
Feb 8, 2026
Merged

Fix the babysit files limitation with pagination logic#5191
SwarnaBharathiMantena merged 1 commit intoGoogleCloudPlatform:developfrom
SwarnaBharathiMantena:swarnabm/update_babysit_files_limitation

Conversation

@SwarnaBharathiMantena
Copy link
Contributor

The babysit tool was failing to find test selectors for PR 5190 because the get_pr_files function lacked pagination logic when querying the GitHub API. By default, the API only returns the first 30 files, and since the module changes in the PR were positioned later in the list, the tool didn't see them and couldn't generate the necessary m.schedmd-slurm-gcp-v6-login tags.

This PR updates tools/cloud-build/babysit/runner.py to support pagination, which ensures that all changed files are retrieved and correctly mapped to their respective test tags.

@SwarnaBharathiMantena SwarnaBharathiMantena added the release-improvements Added to release notes under the "Improvements" heading. label Feb 5, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SwarnaBharathiMantena, 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 babysit tool by addressing a critical limitation in its ability to fetch all modified files from the GitHub API. By introducing pagination, the tool can now reliably retrieve comprehensive file lists for larger pull requests, which in turn prevents failures in generating necessary test tags and ensures the integrity of the build process.

Highlights

  • Pagination Implementation: Implemented pagination logic for GitHub API calls within the babysit tool to retrieve all files associated with a pull request.
  • Bug Fix: Resolved an issue where the babysit tool would fail to find test selectors for PRs with more than 30 changed files due to the GitHub API's default response limit.
  • Improved Reliability: Ensures that all changed files are correctly identified and mapped to their respective test tags, improving the accuracy of test selector generation.
Changelog
  • tools/cloud-build/babysit/runner.py
    • Modified the get_pr_files function to iteratively fetch all pages of files from the GitHub API.
    • Introduced a while loop that continues fetching files as long as a 'next' pagination link is provided in the API response headers.
    • Added the per_page=100 parameter to the initial API request for more efficient data retrieval.
Activity
  • No human activity has been recorded on this pull request yet.
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
Contributor

@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 correctly addresses the file limitation issue by implementing pagination when fetching files from the GitHub API. The logic is clear and effectively solves the problem described. I have one suggestion regarding API authentication to improve the tool's robustness against rate limiting, which is a common issue in CI environments.

@SwarnaBharathiMantena SwarnaBharathiMantena merged commit 92de5ae into GoogleCloudPlatform:develop Feb 8, 2026
15 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants