Skip to content

[#7552] feat(policy): Add policy entity and POConverters (part-2) #7361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 9, 2025

Conversation

mchades
Copy link
Contributor

@mchades mchades commented Jun 9, 2025

What changes were proposed in this pull request?

Add policy entity and POConverters

Why are the changes needed?

Fix: #7552

Does this PR introduce any user-facing change?

no

How was this patch tested?

tests added

@mchades mchades changed the title [#7360] feat(policy): support CURD ops for policy in backend storage [#7360] feat(policy): support CURD ops for policy in backend storage (part-2) Jun 9, 2025
.withName(policyPO.getPolicyName())
.withNamespace(namespace)
.withType(policyPO.getPolicyType())
.withComment(policyPO.getPolicyVersionPO().getPolicyComment())
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think it should check if the policyVersion is null here?

Copy link
Contributor Author

@mchades mchades Jun 9, 2025

Choose a reason for hiding this comment

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

unnecessary, because PolicyPO.Builder already did the validation

@jerryshao
Copy link
Contributor

This PR is too big, can you please split into several small PRs for better review?

@mchades mchades force-pushed the policy-backend-2 branch from d2adf3c to e02d681 Compare July 2, 2025 12:45
@mchades mchades changed the title [#7360] feat(policy): support CURD ops for policy in backend storage (part-2) [#7360] feat(policy): Add policy entity and POConverters Jul 2, 2025
@mchades mchades changed the title [#7360] feat(policy): Add policy entity and POConverters [#7360] feat(policy): Add policy entity and POConverters (part-2) Jul 2, 2025
@mchades mchades requested a review from jerryshao July 2, 2025 12:47
@mchades
Copy link
Contributor Author

mchades commented Jul 2, 2025

This PR is too big, can you please split into several small PRs for better review?

Split done in this PR, plz help to review when you have time, thx! @jerryshao

@mchades mchades changed the title [#7360] feat(policy): Add policy entity and POConverters (part-2) [#7552] feat(policy): Add policy entity and POConverters (part-2) Jul 2, 2025
@mchades mchades force-pushed the policy-backend-2 branch from e02d681 to 964aa49 Compare July 2, 2025 13:42
@mchades mchades force-pushed the policy-backend-2 branch from 964aa49 to 39ec625 Compare July 7, 2025 12:40
@mchades mchades requested a review from jerryshao July 7, 2025 15:49
@@ -112,20 +236,48 @@ public interface Policy extends Auditable {
*
* @throws IllegalPolicyException if the policy is not valid.
*/
void validate() throws IllegalPolicyException;
default void validate() throws IllegalPolicyException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Who will call this validate() method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, it's called by PolicyEntity.valiate()

Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to move this method to PolicyEntity, this seems is not a user-facing interface, or should user be aware of.

@mchades mchades requested a review from jerryshao July 8, 2025 11:10
@mchades mchades requested a review from jerryshao July 9, 2025 06:56
@jerryshao jerryshao merged commit 5de0772 into apache:main Jul 9, 2025
30 checks passed
vishnu-chalil pushed a commit to vishnu-chalil/gravitino that referenced this pull request Jul 14, 2025
…2) (apache#7361)

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

Add policy entity and POConverters

### Why are the changes needed?

Fix: apache#7552 

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

no

### How was this patch tested?

tests added
hdygxsj pushed a commit to hdygxsj/gravitino that referenced this pull request Jul 15, 2025
…2) (apache#7361)

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

Add policy entity and POConverters

### Why are the changes needed?

Fix: apache#7552 

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

no

### How was this patch tested?

tests added
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.

[Subtask] Add policy entity and POConverters (part-2)
3 participants