Skip to content

Support future reservation in name check validator#5252

Merged
saara-tyagi27 merged 4 commits intoGoogleCloudPlatform:developfrom
saara-tyagi27:future-reservation-check-support
Mar 23, 2026
Merged

Support future reservation in name check validator#5252
saara-tyagi27 merged 4 commits intoGoogleCloudPlatform:developfrom
saara-tyagi27:future-reservation-check-support

Conversation

@saara-tyagi27
Copy link
Copy Markdown
Contributor

@saara-tyagi27 saara-tyagi27 commented Feb 17, 2026

Summary

This pr adds support for future reservation checking in test_reservation_exists validator by making an api call to future reservation.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @saara-tyagi27, 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 reservation validation logic within the cloud.go validator. It introduces support for checking "future reservations" alongside standard zonal reservations, which is essential for validating reservations for advanced hardware like A4/B200/GB200. Additionally, context.Context has been integrated into these validation functions to improve request management and enable proper cancellation and timeout handling.

Highlights

  • Enhanced Reservation Validation: The findReservationInOtherZones and TestReservationExists functions now include checks for "future reservations" in addition to standard zonal reservations. This is crucial for supporting newer hardware types like A4/B200/GB200, ensuring that the validator can correctly identify these reservations.
  • Context Propagation: context.Context has been introduced and propagated through the reservation validation functions (findReservationInOtherZones, TestReservationExists, testReservationExists). This allows for better control over request cancellation and timeouts, improving the robustness of API calls.
Changelog
  • pkg/validators/cloud.go
    • Updated findReservationInOtherZones to accept context.Context and query both standard and future reservations.
    • Modified TestReservationExists to include a fallback check for future reservations and propagate context.Context.
    • Adjusted testReservationExists to pass context.Background() to the updated TestReservationExists function.
Activity
  • The pull request description includes a submission checklist, but no human activity (comments, reviews) has been recorded 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
Copy Markdown
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 adds support for 'future reservations' to the reservation validation logic, which is a great enhancement. The changes correctly add checks for future reservations in both findReservationInOtherZones and TestReservationExists.

I've identified a couple of areas for improvement in the error handling logic:

  1. In findReservationInOtherZones, when both API calls fail, only the last error is returned, potentially losing important information from the first error.
  2. In TestReservationExists, the soft warning check is only performed on the error from the standard reservation API call, which could lead to incorrect hard failures if the future reservation call fails due to permissions.

I've left specific comments with code suggestions to address these points. Additionally, as per the repository's style guide, it would be helpful to update the pull request description to explain the purpose of the change and how it was tested.

@saara-tyagi27 saara-tyagi27 force-pushed the future-reservation-check-support branch 2 times, most recently from 3b074ff to 78d36d9 Compare March 3, 2026 05:31
@saara-tyagi27 saara-tyagi27 added release-key-new-features Added to release notes under the "Key New Features" heading. release-improvements Added to release notes under the "Improvements" heading. labels Mar 3, 2026
@saara-tyagi27 saara-tyagi27 marked this pull request as ready for review March 10, 2026 07:18
@saara-tyagi27 saara-tyagi27 requested review from a team and samskillman as code owners March 10, 2026 07:18
@saara-tyagi27 saara-tyagi27 requested a review from arpit974 March 11, 2026 05:24
@saara-tyagi27 saara-tyagi27 force-pushed the future-reservation-check-support branch 2 times, most recently from b132954 to a089a5a Compare March 17, 2026 13:16
@saara-tyagi27 saara-tyagi27 force-pushed the future-reservation-check-support branch from 3473503 to 63703ef Compare March 18, 2026 07:28
Copy link
Copy Markdown
Contributor

@Neelabh94 Neelabh94 left a comment

Choose a reason for hiding this comment

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

LGTM.
nit comment can be taken up as a follow-up.

@saara-tyagi27
Copy link
Copy Markdown
Contributor Author

All failing tests also pass the create step where the changes could have failed, so those tests are not failing as per these changes.
As for a4 custom blueprint, this test uses onspot and does not particularly need testing for reservation validator.

@saara-tyagi27 saara-tyagi27 merged commit df5f30f into GoogleCloudPlatform:develop Mar 23, 2026
73 of 76 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. release-key-new-features Added to release notes under the "Key New Features" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants