[#8727] Improvement(commands): Add alias/version validation and handle() tests to model version commands - #8737
Merged
Merged
Conversation
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. |
Member
|
The CI is failing because the new unit tests don't have ASF headers. |
Contributor
Author
|
I have added the headers and updated the code accordingly. Please review the changes when you get a chance. Thank you! |
justinmclean
approved these changes
Sep 30, 2025
justinmclean
left a comment
Member
There was a problem hiding this comment.
Thanks for these changes
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
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.