Skip to content

Module deprecation warning system#5229

Open
vikramvs-gg wants to merge 1 commit intoGoogleCloudPlatform:developfrom
vikramvs-gg:deprecation-warning
Open

Module deprecation warning system#5229
vikramvs-gg wants to merge 1 commit intoGoogleCloudPlatform:developfrom
vikramvs-gg:deprecation-warning

Conversation

@vikramvs-gg
Copy link
Contributor

@vikramvs-gg vikramvs-gg commented Feb 12, 2026

feat: Add Module Deprecation Warning System
This pull request introduces validations in gcluster engine to automatically warn users when they are using a deprecated module in a blueprint.

Why is it needed
This change provides a clear, in-tool mechanism to notify users about a module's deprecation status, allowing for smoother migrations and empowering users to plan migrations proactively.

How It Works
The system operates through metadata-driven checks integrated into the toolkit's core blueprint validation process:

  1. Module Metadata:

    • A ghpc block in each module's metadata.yaml can now include a deprecation_date (in YYYY-MM-DD format) and an alternative_module suggestion.
  2. Automated Checks:

    • During blueprint processing, the tool checks each module's deprecation metadata.
    • If a deprecation_date is present and valid, a warning is issued, indicating if the module's deprecation date is in the future (planned removal) or in the past (no longer supported).
    • If the deprecation_date is malformed (e.g., "tomorrow"), a fatal error is immediately triggered, stopping the blueprint validation to prevent deployment with invalid configurations.
    • If no deprecation_date is specified, the module is considered non-deprecated, and no warning is issued.

Testing

  • Validated scenarios of warnings and errors for deprecated and non deprecated modules
  • Unit tests for go code changes running successfully.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vikramvs-gg, 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 implements a robust module deprecation warning system within the gcluster engine. It enables proactive user notification about module deprecation status, facilitating planned migrations and preventing the use of unsupported components. The system integrates seamlessly into the existing blueprint validation process, leveraging metadata to provide clear, actionable feedback to users.

Highlights

  • Module Deprecation Warning System: Introduced a new system to automatically warn users when a deprecated module is used in a blueprint, providing in-tool notifications for smoother migrations.
  • Metadata-Driven Checks: The system uses deprecation_date and alternative_module fields within a ghpc block in metadata.yaml to determine module deprecation status.
  • Automated Validation: During blueprint processing, the tool checks module deprecation metadata, issuing warnings for valid deprecations (future or past) and fatal errors for malformed deprecation_date entries.
  • New Logging Functionality: Added a Warn function to the logging package to output warning messages without halting program execution.
Changelog
  • pkg/config/deprecation_validate.go
    • Added validateDeprecation function to check module deprecation status based on metadata.
    • Implemented logic to parse deprecation_date and generate appropriate warning messages.
    • Included error handling for malformed deprecation_date strings.
  • pkg/config/deprecation_validate_test.go
    • Added unit tests for the validateDeprecation function.
    • Covered test cases for no deprecation, future deprecation, past deprecation, and malformed dates.
  • pkg/config/validate.go
    • Integrated the validateDeprecation function into the validateModule function's validation chain.
  • pkg/logging/logging.go
    • Added a new Warn function to print warning messages to stderr without exiting the program.
  • pkg/modulereader/metadata.go
    • Extended the MetadataGhpc struct with DeprecationDate and AlternativeModule fields to support deprecation metadata.
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.

@vikramvs-gg vikramvs-gg added the release-key-new-features Added to release notes under the "Key New Features" heading. label Feb 12, 2026
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 introduces a module deprecation warning system, which is a great feature for notifying users about outdated modules. The implementation is solid, with new logic for validation, testing, and logging. I have a couple of suggestions to improve code maintainability and test coverage. Specifically, I've recommended refactoring the message construction in deprecation_validate.go to be more DRY, and enhancing the tests in deprecation_validate_test.go to verify the content of the warning logs.

@vikramvs-gg vikramvs-gg marked this pull request as ready for review February 13, 2026 06:43
@vikramvs-gg vikramvs-gg requested review from a team and samskillman as code owners February 13, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant