Skip to content

[#8082] fix: call request.validate() in PartitionOperations.java - #8098

Merged
justinmclean merged 1 commit into
apache:mainfrom
JeonDaehong:issue_8082
Aug 15, 2025
Merged

justinmclean merged 1 commit into
apache:mainfrom
JeonDaehong:issue_8082

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

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: #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?

  • 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.

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

Hi @justinmclean

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!

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

Hi @justinmclean

It seems like there might be an issue in the CI/CD process.
Is there any action I need to take on my end?

@justinmclean

Copy link
Copy Markdown
Member

I'll look into the issue for you, I don't think it's related to the changes you made.

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

I'll look into the issue for you, I don't think it's related to the changes you made.

Thank you. Please let me know once it’s confirmed!

@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 fixing this.

@justinmclean
justinmclean merged commit 5bec01a into apache:main Aug 15, 2025
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

Thanks for fixing this.

Thank you for the approval.
I’ll work on another issue as well and submit a PR.

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.
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] In PartitionOperations.java missing call to request.validate()

2 participants