Skip to content

[#8727] Improvement(commands): Add alias/version validation and handle() tests to model version commands - #8737

Merged
justinmclean merged 3 commits into
apache:mainfrom
namest504:main
Sep 30, 2025
Merged

justinmclean merged 3 commits into
apache:mainfrom
namest504:main

Conversation

@namest504

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Added validation for alias and version presence in UpdateModelVersionComment, UpdateModelVersionUri, and UpdateModelVersionAliases classes.
  • Implemented comprehensive unit tests for validate() and handle() methods, mocking GravitinoClient, Catalog, and ModelCatalog dependencies.
  • Tests cover error scenarios when both alias and version are set or both missing, and normal execution paths.
  • verify internal method calls and printInformation output messages.

Why are the changes needed?

The changes address issue #8727 to improve validation and increase test coverage for core model version command classes. This enhances robustness and reliability in command execution by preventing invalid input parameters and ensuring internal client interactions behave as expected.

Fix: #8727

Does this PR introduce any user-facing change?

No direct API changes but improves command input validation behavior and error reporting.

How was this patch tested?

Added unit tests for all affected classes; all tests pass locally in the CI environment.

@namest504

Copy link
Copy Markdown
Contributor Author

I'm sorry, but it seems test code files are missing the required Apache license header at the top. I will add a commit to fix this.

@justinmclean

Copy link
Copy Markdown
Member

The CI is failing because the new unit tests don't have ASF headers.

@namest504

Copy link
Copy Markdown
Contributor Author

I have added the headers and updated the code accordingly. Please review the changes when you get a chance. Thank you!

@justinmclean justinmclean left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for these changes

@justinmclean
justinmclean merged commit d404879 into apache:main Sep 30, 2025
27 checks passed
bharos pushed a commit to bharos/gravitino that referenced this pull request Oct 7, 2025
… handle() tests to model version commands (apache#8737)

### What changes were proposed in this pull request?

- Added validation for alias and version presence in
UpdateModelVersionComment, UpdateModelVersionUri, and
UpdateModelVersionAliases classes.
- Implemented comprehensive unit tests for validate() and handle()
methods, mocking GravitinoClient, Catalog, and ModelCatalog
dependencies.
- Tests cover error scenarios when both alias and version are set or
both missing, and normal execution paths.
- verify internal method calls and printInformation output messages.

### Why are the changes needed?

The changes address issue apache#8727 to improve validation and increase test
coverage for core model version command classes. This enhances
robustness and reliability in command execution by preventing invalid
input parameters and ensuring internal client interactions behave as
expected.

Fix: apache#8727

### Does this PR introduce _any_ user-facing change?

No direct API changes but improves command input validation behavior and
error reporting.

### How was this patch tested?

Added unit tests for all affected classes; all tests pass locally in the
CI environment.

---------

Co-authored-by: Justin Mclean <justin@classsoftware.com>
danhuawang pushed a commit to danhuawang/gravitino that referenced this pull request Jun 8, 2026
… handle() tests to model version commands (apache#8737)

### What changes were proposed in this pull request?

- Added validation for alias and version presence in
UpdateModelVersionComment, UpdateModelVersionUri, and
UpdateModelVersionAliases classes.
- Implemented comprehensive unit tests for validate() and handle()
methods, mocking GravitinoClient, Catalog, and ModelCatalog
dependencies.
- Tests cover error scenarios when both alias and version are set or
both missing, and normal execution paths.
- verify internal method calls and printInformation output messages.

### Why are the changes needed?

The changes address issue apache#8727 to improve validation and increase test
coverage for core model version command classes. This enhances
robustness and reliability in command execution by preventing invalid
input parameters and ensuring internal client interactions behave as
expected.

Fix: apache#8727

### Does this PR introduce _any_ user-facing change?

No direct API changes but improves command input validation behavior and
error reporting.

### How was this patch tested?

Added unit tests for all affected classes; all tests pass locally in the
CI environment.

---------

Co-authored-by: Justin Mclean <justin@classsoftware.com>
danhuawang pushed a commit to danhuawang/gravitino that referenced this pull request Jun 9, 2026
… handle() tests to model version commands (apache#8737)

### What changes were proposed in this pull request?

- Added validation for alias and version presence in
UpdateModelVersionComment, UpdateModelVersionUri, and
UpdateModelVersionAliases classes.
- Implemented comprehensive unit tests for validate() and handle()
methods, mocking GravitinoClient, Catalog, and ModelCatalog
dependencies.
- Tests cover error scenarios when both alias and version are set or
both missing, and normal execution paths.
- verify internal method calls and printInformation output messages.

### Why are the changes needed?

The changes address issue apache#8727 to improve validation and increase test
coverage for core model version command classes. This enhances
robustness and reliability in command execution by preventing invalid
input parameters and ensuring internal client interactions behave as
expected.

Fix: apache#8727

### Does this PR introduce _any_ user-facing change?

No direct API changes but improves command input validation behavior and
error reporting.

### How was this patch tested?

Added unit tests for all affected classes; all tests pass locally in the
CI environment.

---------

Co-authored-by: Justin Mclean <justin@classsoftware.com>
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.

[Improvement] Improve validate in UpdateModelVersionComment.java and UpdateModelVersionAliases.java

2 participants