refactor: Introduce internal semver compare module#5411
Conversation
Summary of ChangesHello, 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 introduces a dedicated internal module for robust semantic version comparison within Terraform configurations. This refactoring aims to centralize and standardize version validation logic, making it more readable and easier to maintain across various features. The initial application of this module is to enhance the GKE version check for the slice controller, with plans for future use in other areas like Kueue version checks. Highlights
Using Gemini Code AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new internal Terraform module, semver_compare, designed to securely perform semantic version comparisons, including an optional GKE build number. This module replaces a manual version check in modules/scheduler/gke-cluster/main.tf for the GKE Slice Controller, ensuring the GKE version meets a minimum requirement. Feedback indicates that the new semver_compare module needs to be added to the modules/README.md index as per the repository's style guide. Additionally, the parsing logic for patch and GKE version components within the semver_compare module's main.tf can be simplified for improved readability and maintainability by removing redundant try() calls.
SwarnaBharathiMantena
left a comment
There was a problem hiding this comment.
- Please include license in all the files (reference: https://github.com/GoogleCloudPlatform/cluster-toolkit/tree/main/modules/internal/tpu-definition)
- Please include these lines in the README.md of the new module to auto-generate the inputs, outputs, versions info, etc.
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
e1877b1 to
8c83c7c
Compare
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
@SwarnaBharathiMantena please re run the tests once again |
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
Repository rule violations found
908e7f9
into
GoogleCloudPlatform:develop
Description
Introduce internal semver compare module to make version checks more readable and maintainable. We'll need it for super-slicing in at least two places:
enable_slice_controllergke version check and then later for checking the Kueue version.This change also changes the required gke version of
enable_slice_controllerto a more specific version than just1.35.Tests
Tested manually.