-
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] Fix gitlab constants calls #7467
[gitlab] Fix gitlab constants calls #7467
Conversation
plugins/modules/gitlab_user.py
Outdated
@@ -28,7 +28,7 @@ | |||
- Stef Graces (@stgrace) | |||
requirements: | |||
- python >= 2.7 | |||
- python-gitlab python module | |||
- python-gitlab python module < 4.0.0 |
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.
The constants have been defined in gitlab.const
since forever, see 1.0.0 in 2017:
https://github.com/python-gitlab/python-gitlab/blob/1.0.0/gitlab/const.py
I think it'd be better to simply import them from there rather than place artificial constraints. WDYT?
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.
The quick fix was to update the docs
The better fix is, for sure, to update the code properly.
I have checked all the gitlab module to make the same kind of modification.
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.
Great, thanks !
Would you mind also fixing gitlab_protected_branch
module, which also uses constants directly from gitlab
package ?
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.
Missed it, but fixed it :)
Hi @Wihrt, Thanks a lot for this contribution ! Could you add a YML changelog fragment into For an example, see https://github.com/ansible-collections/community.general/blob/stable-7/changelogs/fragments/3787-pass-composer-working-dir.yml !component +plugins/modules/gitlab_user.py |
@lgatellier |
4ecb193
to
04b69e5
Compare
Seems good to me, LGTM ! |
Backport to stable-7: 💚 backport PR created✅ Backport PR branch: Backported as #7473 🤖 @patchback |
fix: Fix gitlab constants calls Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro> (cherry picked from commit a366318)
Backport to stable-8: 💚 backport PR created✅ Backport PR branch: Backported as #7474 🤖 @patchback |
@Wihrt thanks a lot for your contribution! |
fix: Fix gitlab constants calls Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro> (cherry picked from commit a366318)
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #7475 🤖 @patchback |
fix: Fix gitlab constants calls Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro> (cherry picked from commit a366318)
docs(gitlab_user.py): Specify the version constraint for python-gitlab module
SUMMARY
Fix gitlab constants call from python-gitlab library
#7466
ISSUE TYPE
COMPONENT NAME
gitlab_user
gitlab_protected_branch
gitlab_group_members
gitlab_project_members
ADDITIONAL INFORMATION