OSAC-1124: Fix Keycloak Group creation per Project - #652
Conversation
|
@CrystalChun: This pull request references OSAC-1124 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Caution Review failedAn error occurred during the review process. Please try again later. WalkthroughAuthorization group paths shift from ChangesAuthorization Group Hierarchy Refactor
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Rationale: The PR introduces substantial changes to core Keycloak group hierarchy creation logic with new caching, path traversal, and 409 conflict-resolution helpers. While the path refactor is straightforward, the implementation of recursive hierarchy building with error handling, Location header extraction, and fallback lookup mechanisms demands careful review for correctness and error cases. The changes are cohesive but require understanding the complete flow from resource manager through Keycloak client to helper functions. Test coverage is extensive but complex, verifying multiple scenarios across mock HTTP endpoints. Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This creates the group hierarchy correctly. Previously, the group was a flat structure of viewers and managers, and did not have the project hierarchy. If more than one project/group was created in the same organization, this would fail with the group already existing because we only had the "viewers" and "managers" groups. This creates an actual group per project, which creates viewers and managers groups within that project. Assisted-by: Claude Code <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CrystalChun, jhernand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
Description
This creates the group hierarchy correctly.
Previously, the group was a flat structure of viewers and managers, and did not have the project hierarchy. If more than one project/group was created in the same organization, this would fail with the group already existing because we only had the "viewers" and "managers" groups.
This creates an actual group per project, which creates viewers and managers groups within that project.
Testing
go build ./...Assisted-by: Claude Code noreply@anthropic.com
/cc @jhernand
Summary by CodeRabbit
/projects/prefix segment; groups now use a flatter hierarchy (e.g.,/<project-name>/viewersinstead of/projects/<project-name>/viewers).