-
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
gitlab_group => Make most options optional #6712
Conversation
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! Can you please add a changelog fragment? Thanks.
Also, instead of having an if
for every entry, why not modify create_group()
to filter out all None
values?
+1 for checking Btw, this closes #4577 and #5806. (but as we discussed in #4577, since GitLab doesn't like receiving null attributes there will be another 15+ attributes from that API that would need to be added the same way eventually) |
I added a filter to the create_group function instead. |
This comment was marked as outdated.
This comment was marked as outdated.
@felixfontein @nejch : Are these changed good ? |
This comment was marked as outdated.
This comment was marked as outdated.
changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml
Outdated
Show resolved
Hide resolved
…s.yml Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Committed the suggestions. Thanks @felixfontein ! |
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.
LGTM
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6724 🤖 @patchback |
* Make most options optional as they should be * Add filter to create_group instead * Remove whitespace * Add changelog fragment * Added description and extension to fragment * Update changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/gitlab_group.py Co-authored-by: Felix Fontein <felix@fontein.de> * Make Python 2.6 compatible. * Another shot at compatibility. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e85b008)
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #6725 🤖 @patchback |
@Intellium thanks for your contribution! |
* Make most options optional as they should be * Add filter to create_group instead * Remove whitespace * Add changelog fragment * Added description and extension to fragment * Update changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/gitlab_group.py Co-authored-by: Felix Fontein <felix@fontein.de> * Make Python 2.6 compatible. * Another shot at compatibility. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e85b008)
…ons optional (#6725) gitlab_group => Make most options optional (#6712) * Make most options optional as they should be * Add filter to create_group instead * Remove whitespace * Add changelog fragment * Added description and extension to fragment * Update changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/gitlab_group.py Co-authored-by: Felix Fontein <felix@fontein.de> * Make Python 2.6 compatible. * Another shot at compatibility. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e85b008) Co-authored-by: Intellium <w.moeken@moeken.eu>
…ons optional (#6724) gitlab_group => Make most options optional (#6712) * Make most options optional as they should be * Add filter to create_group instead * Remove whitespace * Add changelog fragment * Added description and extension to fragment * Update changelogs/fragments/6712-gitlab_group-filtered-for-none-values.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/modules/gitlab_group.py Co-authored-by: Felix Fontein <felix@fontein.de> * Make Python 2.6 compatible. * Another shot at compatibility. --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit e85b008) Co-authored-by: Intellium <w.moeken@moeken.eu>
SUMMARY
This PR changes the gitlab_group module to make most options optional, as they should be according to the gitlab API documentation. This PR also ensures compatibility with Gitlab v16 as current module behaviour is non-functional with Gitlab v16.
Closes #4577
Closes #5806
ISSUE TYPE
COMPONENT NAME
gitlab_group
ADDITIONAL INFORMATION
Current module behaviour is to include parameters in the API call to gitlab even if they're not set. This results in the API call including 'nil' values for these parameters. This still worked up until Gitlab v15.11.4.
Gitlab v16 currently breaks on this behaviour. This pull request ensures API parameters are only included when they're actually set, or if they are mandatory.