Skip to content
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_user_federation: sort desired and after mappers by name #8761

Conversation

fgruenbauer
Copy link
Contributor

SUMMARY

The module inconsistently sorts the mappers.

The module sorts the mappers fetched for the before state by name. The desired mappers and the mappers fetched after an update are not sorted. When comparing the desired mappers with the before mappers, changes are detected even if the mappers in both lists are the same except for the order. When diffing before with after mappers, differences are shown when the mappers are the same except for the order.

The changes add sorting by name for the desired mappers and the mappers fetched after an update, analog to the existing sorting for the before mappers. This minimizes the diff and makes the change detection more accurate.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

keycloak_user_federation

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added WIP Work in progress bug This issue/PR relates to a bug module module needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI plugins plugin (any type) small_patch Hopefully easy to review labels Aug 13, 2024
@ansibullbot ansibullbot removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI small_patch Hopefully easy to review labels Aug 13, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-8 Automatically create a backport for the stable-8 branch backport-9 Automatically create a backport for the stable-9 branch labels Aug 13, 2024
@felixfontein
Copy link
Collaborator

Is this intentionally still a draft?

@fgruenbauer fgruenbauer marked this pull request as ready for review August 20, 2024 07:41
@ansibullbot ansibullbot removed the WIP Work in progress label Aug 20, 2024
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Aug 28, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks OK to me. If nobody objects, I'll merge this on the weekend.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Sep 8, 2024
@felixfontein felixfontein merged commit 982b8d8 into ansible-collections:main Sep 8, 2024
147 checks passed
Copy link

patchback bot commented Sep 8, 2024

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/982b8d89b7373d4098020b1491ff3d5478fa9730/pr-8761

Backported as #8836

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@fgruenbauer thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Sep 8, 2024
* sort desired mappers by name

* sort mappers fetched after update by name

* only sort mapper list if there are desired mappers specified

* add fallback `''` in case `name` is not a key or `None` when sorting mappers

* add changelog fragment

(cherry picked from commit 982b8d8)
Copy link

patchback bot commented Sep 8, 2024

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/982b8d89b7373d4098020b1491ff3d5478fa9730/pr-8761

Backported as #8837

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Sep 8, 2024
* sort desired mappers by name

* sort mappers fetched after update by name

* only sort mapper list if there are desired mappers specified

* add fallback `''` in case `name` is not a key or `None` when sorting mappers

* add changelog fragment

(cherry picked from commit 982b8d8)
felixfontein pushed a commit that referenced this pull request Sep 8, 2024
… desired and after mappers by name (#8836)

keycloak_user_federation: sort desired and after mappers by name (#8761)

* sort desired mappers by name

* sort mappers fetched after update by name

* only sort mapper list if there are desired mappers specified

* add fallback `''` in case `name` is not a key or `None` when sorting mappers

* add changelog fragment

(cherry picked from commit 982b8d8)

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
felixfontein pushed a commit that referenced this pull request Sep 8, 2024
… desired and after mappers by name (#8837)

keycloak_user_federation: sort desired and after mappers by name (#8761)

* sort desired mappers by name

* sort mappers fetched after update by name

* only sort mapper list if there are desired mappers specified

* add fallback `''` in case `name` is not a key or `None` when sorting mappers

* add changelog fragment

(cherry picked from commit 982b8d8)

Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
aioue pushed a commit to aioue/community.general that referenced this pull request Oct 1, 2024
…ible-collections#8761)

* sort desired mappers by name

* sort mappers fetched after update by name

* only sort mapper list if there are desired mappers specified

* add fallback `''` in case `name` is not a key or `None` when sorting mappers

* add changelog fragment
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
…ible-collections#8761)

* sort desired mappers by name

* sort mappers fetched after update by name

* only sort mapper list if there are desired mappers specified

* add fallback `''` in case `name` is not a key or `None` when sorting mappers

* add changelog fragment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8 Automatically create a backport for the stable-8 branch backport-9 Automatically create a backport for the stable-9 branch bug This issue/PR relates to a bug module module plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants