Skip to content

Conversation

@aurelien-pacaud
Copy link
Contributor

Issue

https://gravitee.atlassian.net/browse/CJ-3765

Description

Adding validation to avoid issue if an API has been migrated from v2 from v4 on APIM side and this API is managed by API Designer.
This fix is needed only in 4.9.x, DEPLOY_MODEL has been updated in 4.10 to allow v4 push/create from API Designer

@aurelien-pacaud aurelien-pacaud requested a review from a team as a code owner November 3, 2025 09:31
@gemini-code-assist
Copy link

Summary of Changes

Hello @aurelien-pacaud, 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 crucial safeguard for Gravitee APIM 4.9.x by introducing a validation step that prevents DEPLOY_MODEL operations on APIs that have been migrated from version 2 to version 4. This measure addresses a known compatibility issue with the API Designer for these specific APIs, ensuring system stability until a native V4 handling mechanism is introduced in a future release.

Highlights

  • API Migration Validation: Introduced a validation check in the DeployModelCommandHandler to prevent issues when an API, originally V2, has been migrated to V4 and is being managed by the API Designer.
  • Temporary Disablement for V4 Migrated APIs: If a DEPLOY_MODEL command targets an API that has been migrated from V2 to V4, the command will now be rejected with a specific error message indicating that updates for such APIs are not yet supported in this version (4.9.x).
  • Targeted Fix for 4.9.x: This fix is specifically implemented for the 4.9.x branch, as a more comprehensive solution for V4 push/create operations from API Designer is planned for version 4.10.
  • New Test Case: Added a new test case, updates_migrated_v2_to_v4_api, to ensure that the DeployModelCommand correctly handles and rejects updates for V4 APIs that originated from V2.
  • Updated Existing Tests: Modified several existing test cases to explicitly define the API's DefinitionVersion as V2, ensuring their continued validity and clarity after the introduction of the V4 migration check.
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 correctly implements a safeguard to prevent updates on v4 APIs from the API Designer in the 4.9.x branch. The logic added to DeployModelCommandHandler is clear and effectively addresses the issue described. The accompanying tests validate the new behavior and ensure existing functionality remains intact. My review includes a couple of suggestions for the test suite to enhance its readability and maintainability.

@aurelien-pacaud aurelien-pacaud force-pushed the cj-3765-block-deploy-model-update-migrate-api branch 2 times, most recently from 3d36bd9 to 74e36d4 Compare November 3, 2025 13:52
@aurelien-pacaud aurelien-pacaud force-pushed the cj-3765-block-deploy-model-update-migrate-api branch from 74e36d4 to 11f4770 Compare November 4, 2025 10:18
@aurelien-pacaud aurelien-pacaud merged commit ab2d7c2 into 4.9.x Nov 5, 2025
12 checks passed
@aurelien-pacaud aurelien-pacaud deleted the cj-3765-block-deploy-model-update-migrate-api branch November 5, 2025 09:27
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.

3 participants