Skip to content

Fix early return in GroupMetaService.updateGroup ignoring non-role changes - #8255

Merged
justinmclean merged 2 commits into
apache:mainfrom
JeonDaehong:main
Aug 23, 2025
Merged

justinmclean merged 2 commits into
apache:mainfrom
JeonDaehong:main

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?
In GroupMetaService.java, the updateGroup method had an early return when there were no role changes (insertRoleIds.isEmpty() && deleteRoleIds.isEmpty()), which caused other group changes like name updates or audit info modifications to be ignored. This PR removes the early return logic and ensures that group metadata is always updated, while role-specific operations are only performed when necessary.

Why are the changes needed?
Without this fix, updating a group's name or other non-role properties would be silently ignored if there were no role changes, leading to inconsistent behavior. Users expecting group renames or audit info updates would find their changes were not persisted to the database.

Fixes #8201

Does this PR introduce any user-facing change?
No. Valid requests now behave correctly where they previously failed silently. Group updates that don't involve role changes will now work as expected.

How was this patch tested?

  • Added unit test updateGroupWithoutRoleChange() to verify that group name changes work without role modifications
  • Verified that the test fails with the old code and passes with the fix
  • Confirmed that existing role-based update functionality remains unchanged
  • All existing tests continue to pass, ensuring no regression in role management features

@JeonDaehong

JeonDaehong commented Aug 22, 2025 •

Copy link
Copy Markdown
Contributor Author

@justinmclean
Hello! The tests have passed, so if everything looks good, could you please merge?

@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 bfddf5c into apache:main Aug 23, 2025
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

@justinmclean

I’ve adjusted the formatting locally and successfully built the core,
but the tests are currently failing.
Is this okay?

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

@justinmclean Hello! The tests have passed, so if everything looks good, could you please merge?

I left a comment asking to merge if the tests pass,
but I think the English translation might not be quite correct

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

@justinmclean

#8261

It seems there was an issue with the test code, so I have reopened the PR.
I believe we may need to rebase this part and merge again.
I would like to hear your thoughts on this, maintainer.

@justinmclean

justinmclean commented Aug 24, 2025 •

Copy link
Copy Markdown
Member

The failing test just updates the audit information. In this case, I think the test is correct as the audit info is what to apply when a change occurs. Thanks for your work here, and apologies for raising the unnecessary issue. The original code is fine after all.

justinmclean added a commit that referenced this pull request Aug 24, 2025
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

The failing test just updates the audit information. In this case, I think the test is correct as the audit info is what to apply when a change occurs. Thanks for your work here, and apologies for raising the unnecessary issue. The original code is fine after all.

@justinmclean

Thank you for the clarification.
I’ll go ahead and close the PR I submitted.

I also have a question—are there any specific requirements to become a committer? I really like the Gravitino project and would love to contribute actively and engage in more discussions.

If there are any conditions for committer promotion, or a community space (such as Discord) where I could communicate with committers, I’d greatly appreciate it if you could let me know

@justinmclean

Copy link
Copy Markdown
Member

We don’t have strict rules for becoming a committer. The main requirement is to make meaningful contributions to the project. Once your contributions have been consistent and sustained over time, the Project Management Committee (PMC) may invite you to become a committer. See https://github.com/apache/gravitino/blob/main/CONTRIBUTING.md#-growing-your-involvement

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

We don’t have strict rules for becoming a committer. The main requirement is to make meaningful contributions to the project. Once your contributions have been consistent and sustained over time, the Project Management Committee (PMC) may invite you to become a committer. See https://github.com/apache/gravitino/blob/main/CONTRIBUTING.md#-growing-your-involvement

Thank you for your response.

I will continue to contribute to resolving issues and strive to become a committer.

groupMetaService.getGroupByIdentifier(
AuthorizationUtils.ofGroup(metalakeName, "group_renamed"));
Assertions.assertEquals("group_renamed", updated.name());
}

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.

This test does not test multiple header values or parameters at all. Instead, it creates one header string at a time. It needs to test multiple values, e.g., "application/vnd.gravitino.v1+json, application/json" or "application/vnd.gravitino.v1+json; q=0.9," which is the main point of #8053.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test does not test multiple header values or parameters at all. Instead, it creates one header string at a time. It needs to test multiple values, e.g., "application/vnd.gravitino.v1+json, application/json" or "application/vnd.gravitino.v1+json; q=0.9," which is the main point of #8053.

I understand the comment. It seems the current test does not cover multi-header values or parameters, which is the core issue.

Would it be okay if I submit a new PR with the necessary updates for this?

@justinmclean justinmclean Aug 25, 2025 •

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.

Sorry, I'm not having a good day today I need more coffee. That was intended for another issue (#8133).

@JeonDaehong JeonDaehong Aug 25, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I'm not having a good day today I need more coffee. That was intended for another issue.

Thank you for your hard work~ 😀

I’m not sure what time it is there, but if it’s evening, I hope you get some good rest.
If it’s daytime, enjoy a nice cup of coffee!

Wishing you a great day!

FANNG1 pushed a commit that referenced this pull request Aug 25, 2025
### What changes were proposed in this pull request?

"Fix early return in GroupMetaService.updateGroup ignoring non-role
changes (#8255)"

This reverts commit bfddf5c.

### Why are the changes needed?

As this broke a test.

Fix: #N/A

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

N/A

### How was this patch tested?

Tested locally.
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Sep 15, 2025
…anges (apache#8255)

**What changes were proposed in this pull request?**
In `GroupMetaService.java`, the `updateGroup` method had an early return
when there were no role changes (`insertRoleIds.isEmpty() &&
deleteRoleIds.isEmpty()`), which caused other group changes like name
updates or audit info modifications to be ignored. This PR removes the
early return logic and ensures that group metadata is always updated,
while role-specific operations are only performed when necessary.

**Why are the changes needed?**
Without this fix, updating a group's name or other non-role properties
would be silently ignored if there were no role changes, leading to
inconsistent behavior. Users expecting group renames or audit info
updates would find their changes were not persisted to the database.

Fixes apache#8201

**Does this PR introduce any user-facing change?**
No. Valid requests now behave correctly where they previously failed
silently. Group updates that don't involve role changes will now work as
expected.

**How was this patch tested?**
* Added unit test `updateGroupWithoutRoleChange()` to verify that group
name changes work without role modifications
* Verified that the test fails with the old code and passes with the fix
* Confirmed that existing role-based update functionality remains
unchanged
* All existing tests continue to pass, ensuring no regression in role
management features
diqiu50 pushed a commit to diqiu50/gravitino that referenced this pull request Sep 15, 2025
### What changes were proposed in this pull request?

"Fix early return in GroupMetaService.updateGroup ignoring non-role
changes (apache#8255)"

This reverts commit bfddf5c.

### Why are the changes needed?

As this broke a test.

Fix: #N/A

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

N/A

### How was this patch tested?

Tested locally.
bharos pushed a commit to bharos/gravitino that referenced this pull request Oct 3, 2025
…anges (apache#8255)

**What changes were proposed in this pull request?**
In `GroupMetaService.java`, the `updateGroup` method had an early return
when there were no role changes (`insertRoleIds.isEmpty() &&
deleteRoleIds.isEmpty()`), which caused other group changes like name
updates or audit info modifications to be ignored. This PR removes the
early return logic and ensures that group metadata is always updated,
while role-specific operations are only performed when necessary.

**Why are the changes needed?**
Without this fix, updating a group's name or other non-role properties
would be silently ignored if there were no role changes, leading to
inconsistent behavior. Users expecting group renames or audit info
updates would find their changes were not persisted to the database.

Fixes apache#8201

**Does this PR introduce any user-facing change?**
No. Valid requests now behave correctly where they previously failed
silently. Group updates that don't involve role changes will now work as
expected.

**How was this patch tested?**
* Added unit test `updateGroupWithoutRoleChange()` to verify that group
name changes work without role modifications
* Verified that the test fails with the old code and passes with the fix
* Confirmed that existing role-based update functionality remains
unchanged
* All existing tests continue to pass, ensuring no regression in role
management features
bharos pushed a commit to bharos/gravitino that referenced this pull request Oct 3, 2025
### What changes were proposed in this pull request?

"Fix early return in GroupMetaService.updateGroup ignoring non-role
changes (apache#8255)"

This reverts commit bfddf5c.

### Why are the changes needed?

As this broke a test.

Fix: #N/A

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

N/A

### How was this patch tested?

Tested locally.
bharos pushed a commit to bharos/gravitino that referenced this pull request Oct 7, 2025
…anges (apache#8255)

**What changes were proposed in this pull request?**
In `GroupMetaService.java`, the `updateGroup` method had an early return
when there were no role changes (`insertRoleIds.isEmpty() &&
deleteRoleIds.isEmpty()`), which caused other group changes like name
updates or audit info modifications to be ignored. This PR removes the
early return logic and ensures that group metadata is always updated,
while role-specific operations are only performed when necessary.

**Why are the changes needed?**
Without this fix, updating a group's name or other non-role properties
would be silently ignored if there were no role changes, leading to
inconsistent behavior. Users expecting group renames or audit info
updates would find their changes were not persisted to the database.

Fixes apache#8201

**Does this PR introduce any user-facing change?**
No. Valid requests now behave correctly where they previously failed
silently. Group updates that don't involve role changes will now work as
expected.

**How was this patch tested?**
* Added unit test `updateGroupWithoutRoleChange()` to verify that group
name changes work without role modifications
* Verified that the test fails with the old code and passes with the fix
* Confirmed that existing role-based update functionality remains
unchanged
* All existing tests continue to pass, ensuring no regression in role
management features
bharos pushed a commit to bharos/gravitino that referenced this pull request Oct 7, 2025
### What changes were proposed in this pull request?

"Fix early return in GroupMetaService.updateGroup ignoring non-role
changes (apache#8255)"

This reverts commit bfddf5c.

### Why are the changes needed?

As this broke a test.

Fix: #N/A

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

N/A

### How was this patch tested?

Tested locally.
danhuawang pushed a commit to danhuawang/gravitino that referenced this pull request Jun 9, 2026
…anges (apache#8255)

**What changes were proposed in this pull request?**
In `GroupMetaService.java`, the `updateGroup` method had an early return
when there were no role changes (`insertRoleIds.isEmpty() &&
deleteRoleIds.isEmpty()`), which caused other group changes like name
updates or audit info modifications to be ignored. This PR removes the
early return logic and ensures that group metadata is always updated,
while role-specific operations are only performed when necessary.

**Why are the changes needed?**
Without this fix, updating a group's name or other non-role properties
would be silently ignored if there were no role changes, leading to
inconsistent behavior. Users expecting group renames or audit info
updates would find their changes were not persisted to the database.

Fixes apache#8201

**Does this PR introduce any user-facing change?**
No. Valid requests now behave correctly where they previously failed
silently. Group updates that don't involve role changes will now work as
expected.

**How was this patch tested?**
* Added unit test `updateGroupWithoutRoleChange()` to verify that group
name changes work without role modifications
* Verified that the test fails with the old code and passes with the fix
* Confirmed that existing role-based update functionality remains
unchanged
* All existing tests continue to pass, ensuring no regression in role
management features
danhuawang pushed a commit to danhuawang/gravitino that referenced this pull request Jun 9, 2026
### What changes were proposed in this pull request?

"Fix early return in GroupMetaService.updateGroup ignoring non-role
changes (apache#8255)"

This reverts commit bfddf5c.

### Why are the changes needed?

As this broke a test.

Fix: #N/A

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

N/A

### How was this patch tested?

Tested locally.
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] Ingored changes in GroupMetaService.java updateGroup

2 participants