Repository navigation
[#8082] fix: call request.validate() in PartitionOperations.java - #8098
Merged
Merged
Conversation
…event invalid requests
Contributor
Author
|
I’m a first-time contributor to Apache Gravitino. I wanted to check if submitting my changes via a PR like this is okay. I’d really appreciate any feedback you could provide. If this approach works, I’ll also submit PRs for the other issues I’ve been assigned and resolved. Thank you! |
Contributor
Author
|
It seems like there might be an issue in the CI/CD process. |
Member
|
I'll look into the issue for you, I don't think it's related to the changes you made. |
Contributor
Author
Thank you. Please let me know once it’s confirmed! |
Contributor
Author
Thank you for the approval. |
diqiu50
pushed a commit
to diqiu50/gravitino
that referenced
this pull request
Sep 15, 2025
apache#8098) ### What changes were proposed in this pull request? In `PartitionOperations.java`, the `addPartitions` method was missing a call to `request.validate()`. This PR adds `request.validate()` to ensure that invalid requests are rejected properly. ### Why are the changes needed? Without this validation, requests with missing or null partitions could bypass checks, potentially causing unexpected errors. Adding this call ensures that invalid requests return `BAD_REQUEST` as expected. Fix: apache#8082(apache#8082) ### Does this PR introduce _any_ user-facing change? No. Existing APIs behave the same for valid requests. Invalid requests now correctly return `BAD_REQUEST`. ### How was this patch tested? - Added a unit test `testAddPartitionWithNullPartitions()` that verifies a `BAD_REQUEST` response for invalid input. - Verified locally and via CI that the test passes and validation works as expected.
danhuawang
pushed a commit
to danhuawang/gravitino
that referenced
this pull request
Jun 9, 2026
apache#8098) ### What changes were proposed in this pull request? In `PartitionOperations.java`, the `addPartitions` method was missing a call to `request.validate()`. This PR adds `request.validate()` to ensure that invalid requests are rejected properly. ### Why are the changes needed? Without this validation, requests with missing or null partitions could bypass checks, potentially causing unexpected errors. Adding this call ensures that invalid requests return `BAD_REQUEST` as expected. Fix: apache#8082(apache#8082) ### Does this PR introduce _any_ user-facing change? No. Existing APIs behave the same for valid requests. Invalid requests now correctly return `BAD_REQUEST`. ### How was this patch tested? - Added a unit test `testAddPartitionWithNullPartitions()` that verifies a `BAD_REQUEST` response for invalid input. - Verified locally and via CI that the test passes and validation works as expected.
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?
In
PartitionOperations.java, theaddPartitionsmethod was missing a call torequest.validate().This PR adds
request.validate()to ensure that invalid requests are rejected properly.Why are the changes needed?
Without this validation, requests with missing or null partitions could bypass checks, potentially causing unexpected errors.
Adding this call ensures that invalid requests return
BAD_REQUESTas expected.Fix: #8082(#8082)
Does this PR introduce any user-facing change?
No. Existing APIs behave the same for valid requests. Invalid requests now correctly return
BAD_REQUEST.How was this patch tested?
testAddPartitionWithNullPartitions()that verifies aBAD_REQUESTresponse for invalid input.