-
Notifications
You must be signed in to change notification settings - Fork 296
Add autoDeleteTenantAssumeRoleAssertions field handling to domain metadata API #3098
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
Add autoDeleteTenantAssumeRoleAssertions field handling to domain metadata API #3098
Conversation
Signed-off-by: Go Yakami <[email protected]>
Summary of ChangesHello @gyakami, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request completes the implementation for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly adds the missing autoDeleteTenantAssumeRoleAssertions field handling to the domain metadata API. The changes in DBService.java are consistent with how other domain metadata fields are handled. The test cases in DBServiceTest.java have been updated to cover this new field. I've added a few suggestions to improve the test coverage and robustness for this new boolean field.
| assertEquals(resDom3.getBusinessService(), "service1"); | ||
| assertEquals(resDom3.getSlackChannel(), "athenz"); | ||
| assertEquals(resDom3.getOnCall(), "athenz-oncall"); | ||
| assertTrue(resDom3.getAutoDeleteTenantAssumeRoleAssertions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For robustness and to avoid a potential NullPointerException if the getter returns null, it's safer to use assertEquals(Boolean.TRUE, ...) instead of assertTrue(...) for Boolean objects.
| assertTrue(resDom3.getAutoDeleteTenantAssumeRoleAssertions()); | |
| assertEquals(Boolean.TRUE, resDom3.getAutoDeleteTenantAssumeRoleAssertions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using assertTrue to be consistent with the other existing code.
assertTrue(resDom3.getEnabled());
| .setSignAlgorithm("ec").setServiceExpiryDays(20).setGroupExpiryDays(25) | ||
| .setBusinessService("service2").setMemberPurgeExpiryDays(120) | ||
| .setSlackChannel("coretech").setOnCall("athenz-oncall"); | ||
| .setSlackChannel("coretech").setOnCall("athenz-oncall").setAutoDeleteTenantAssumeRoleAssertions(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve test coverage for the new autoDeleteTenantAssumeRoleAssertions field, this part of the test can be updated to check for the false case. Currently, it only tests setting the value to true.
| .setSlackChannel("coretech").setOnCall("athenz-oncall").setAutoDeleteTenantAssumeRoleAssertions(true); | |
| .setSlackChannel("coretech").setOnCall("athenz-oncall").setAutoDeleteTenantAssumeRoleAssertions(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test for the false case in 5517e0d
| assertEquals(resDom4.getBusinessService(), "service2"); | ||
| assertEquals(resDom4.getSlackChannel(), "coretech"); | ||
| assertEquals(resDom4.getOnCall(), "athenz-oncall"); | ||
| assertTrue(resDom4.getAutoDeleteTenantAssumeRoleAssertions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion should be updated to check for false to match the suggested change on line 1674. Also, using assertEquals(Boolean.FALSE, ...) is safer than assertTrue(...) for Boolean objects to prevent a potential NullPointerException.
| assertTrue(resDom4.getAutoDeleteTenantAssumeRoleAssertions()); | |
| assertEquals(Boolean.FALSE, resDom4.getAutoDeleteTenantAssumeRoleAssertions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been addressed in the comment above.
Signed-off-by: Go Yakami <[email protected]>
Description
This PR adds the missing autoDeleteTenantAssumeRoleAssertions field handling to the domain metadata API interface.
In PR #3027 , we added the autoDeleteTenantAssumeRoleAssertions field to DomainMeta to support automatic cleanup functionality for delegated roles. However, the API interface implementation was inadvertently omitted from that PR.
Contribution Checklist:
Attach Screenshots (Optional)