Closed vgaudard closed 1 month ago
cc @eikef @mattock @ndclt @thomasbach-dev click here for bot help
I wasn't able to run tests locally (either before or after my changes). Because they're marked unsupported
, I assumed this is expected.
@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?
Details : I suspect this was caused by Keycloak returning a subGroupCount > 0
and subGroups == []
after creating the subgroup. This caused after_group
to be set to None
, and so the module failed when formatting the result message.
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.
You might want give it a try to andebox by yours truly:
I did, but I can't setup vagrant on my work computer, so I returned to classic ansible-test and fidgeting with dependencies.
I was able to run the tests before and after my changes, and both passed.
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 (get_subgroup_by_chain
), which caused sub-sub-groups to fail.
It should be OK now.
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 PR branch: patchback/backports/stable-9/658637dc700f6e795074a22071fa7a40ef7f11fb/pr-8979
Backported as https://github.com/ansible-collections/community.general/pull/9041
🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.
Thanks for the confirmation!
@vgaudard thanks for your contribution! @russoz thanks for reviewing!
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 ansible-collections/community.general#8788
See https://www.keycloak.org/docs/latest/upgrading/#grouprepresentation-changes
ISSUE TYPE
COMPONENT NAME
keycloak_group
ADDITIONAL INFORMATION
Related issue : ansible-collections/community.general#8788
Tested on Keycloak versions (Docker images) :