-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
keycloak_group: fix subgroup creation in Keycloak ≥23 #8979
keycloak_group: fix subgroup creation in Keycloak ≥23 #8979
Conversation
I wasn't able to run tests locally (either before or after my changes). Because they're marked Console output of test execution
|
@UKFr-DIZ This is a fix for issue #8788 . @vvanouytsel This PR might fix issue #8366 , could you confirm that the issue happened with Keycloak version 23? |
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.
Thanks for your contribution! I've added a first comment below.
Regarding the tests: unsupported
means they don't run in CI, you have to run them manually. (See also tests/integration/targets/keycloak_group/readme.adoc
in case you haven't seen it yet.) The error you are seeing seems to be a bug in ansible-core, or a problem with Docker on your machine, or a combination of your Docker and a bug in ansible-core, and are unrelated to the tests for this module.
(Did you try passing --python 3.12
explicitly? Usually if you don't provide a OS docker image like --docker ubuntu2404
, you have to specify the Python version. It could be that ansible-test picks a default Python version for the default
image, but 🤷)
Co-authored-by: Felix Fontein <[email protected]>
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.
hi @vgaudard Thanks for the contribution!
Other than my question in the changelog frag, the rest LGTM.
If nobody objects, I'll merge this in a week. CC @fgruenbauer who lately worked a lot on keycloak_* modules. |
Thank you both for your help.
I did, but I can't setup vagrant on my work computer, so I returned to classic ansible-test and fidgeting with dependencies.
I ran the tests again but on Keycloak 25, and... they failed. I forgot to change another method where we want subgroups of a group ( |
hi @vgaudard "it should be OK" is not very reassuring :-) Could you please confirm if you got the test to run successfully with kc 25? TIA |
@vgaudard ping |
Hi
Yes, I ran the tests successfully on both Keycloak 20 and 25.
|
Backport to stable-9: 💚 backport PR created✅ Backport PR branch: Backported as #9041 🤖 @patchback |
* keycloak_group: fix subgroup creation in Keycloak ≥23 * Add changelog fragment * Include issue and pull request in changelog fragment Co-authored-by: Felix Fontein <[email protected]> * Use new way to get subgroups when getting a subgroup chain * Fix indent --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 658637d)
…reation in Keycloak ≥23 (#9041) keycloak_group: fix subgroup creation in Keycloak ≥23 (#8979) * keycloak_group: fix subgroup creation in Keycloak ≥23 * Add changelog fragment * Include issue and pull request in changelog fragment Co-authored-by: Felix Fontein <[email protected]> * Use new way to get subgroups when getting a subgroup chain * Fix indent --------- Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit 658637d) Co-authored-by: Victor Gaudard <[email protected]>
SUMMARY
In Keycloak versions 23 and later, GroupRepresentation.subGroups has been replaced by GroupRepresentation.subGroupCount and another endpoint to get subgroups.
This caused community.general.keycloak_group to fail when creating a group with a parent.
We now execute this second request if needed.
Fixes #8788
See https://www.keycloak.org/docs/latest/upgrading/#grouprepresentation-changes
ISSUE TYPE
COMPONENT NAME
keycloak_group
ADDITIONAL INFORMATION
Related issue : #8788
Tested on Keycloak versions (Docker images) :