-
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_clientscope_type: sort default and optional clientscope lists before diff #9202
keycloak_clientscope_type: sort default and optional clientscope lists before diff #9202
Conversation
If nobody objects, I'll merge this on Sunday. |
unrelated to the PR, but when I opened the file to check something out, I spotted a typo (an "e" missing) in line 43, doc block. You might one to add that to this PR already ;-) |
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 believe there is a minor adjustment that could be made, other than that LGTM.
scopes_copy = scopes.copy() | ||
if isinstance(scopes_copy.get('default_clientscopes'), list): | ||
scopes_copy['default_clientscopes'] = sorted(scopes_copy['default_clientscopes']) | ||
if isinstance(scopes_copy.get('optional_clientscopes'), list): | ||
scopes_copy['optional_clientscopes'] = sorted(scopes_copy['optional_clientscopes']) |
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.
Doing the copy is a bit redundant. This could be simplified as:
scopes_copy = scopes.copy() | |
if isinstance(scopes_copy.get('default_clientscopes'), list): | |
scopes_copy['default_clientscopes'] = sorted(scopes_copy['default_clientscopes']) | |
if isinstance(scopes_copy.get('optional_clientscopes'), list): | |
scopes_copy['optional_clientscopes'] = sorted(scopes_copy['optional_clientscopes']) | |
scopes_copy = { | |
'default_clientscopes': sorted(scopes['default_clientscopes']) if scopes['default_clientscopes'] else [], | |
'optional_clientscopes': sorted(scopes['optional_clientscopes']) if scopes['optional_clientscopes'] else [], | |
} |
Backport to stable-9: 💚 backport PR created✅ Backport PR branch: Backported as #9221 🤖 @patchback |
Backport to stable-10: 💚 backport PR created✅ Backport PR branch: Backported as #9222 🤖 @patchback |
@fgruenbauer thanks for your contribution! |
…t default and optional clientscope lists before diff (#9221) keycloak_clientscope_type: sort default and optional clientscope lists before diff (#9202) * sort default and optional clientscope lists before diff * add changelog fragment (cherry picked from commit 55d714d) Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
…rt default and optional clientscope lists before diff (#9222) keycloak_clientscope_type: sort default and optional clientscope lists before diff (#9202) * sort default and optional clientscope lists before diff * add changelog fragment (cherry picked from commit 55d714d) Co-authored-by: fgruenbauer <gruenbauer@b1-systems.de>
…s before diff (ansible-collections#9202) * sort default and optional clientscope lists before diff * add changelog fragment
SUMMARY
The change sorts the default and optional clientscope lists before the diff, to make the diff more accurate.
Before:
After:
ISSUE TYPE
COMPONENT NAME
keycloak_clientscope_type