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

[gitlab] Fix gitlab constants calls #7467

Merged

Conversation

Wihrt
Copy link
Contributor

@Wihrt Wihrt commented Nov 3, 2023

docs(gitlab_user.py): Specify the version constraint for python-gitlab module

SUMMARY

Fix gitlab constants call from python-gitlab library

#7466

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

gitlab_user
gitlab_protected_branch
gitlab_group_members
gitlab_project_members

ADDITIONAL INFORMATION

@ansibullbot ansibullbot added docs docs_only module module new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Nov 3, 2023
@@ -28,7 +28,7 @@
- Stef Graces (@stgrace)
requirements:
- python >= 2.7
- python-gitlab python module
- python-gitlab python module < 4.0.0
Copy link
Contributor

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?

Copy link
Contributor Author

@Wihrt Wihrt Nov 3, 2023

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.

Copy link
Contributor

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 ?

Copy link
Contributor Author

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 :)

@ansibullbot ansibullbot removed docs_only needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR small_patch Hopefully easy to review labels Nov 3, 2023
@lgatellier
Copy link
Contributor

lgatellier commented Nov 3, 2023

Hi @Wihrt,

Thanks a lot for this contribution !

Could you add a YML changelog fragment into changelogs/fragments directory ?

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
!component +plugins/modules/gitlab_group_members.py
!component +plugins/modules/gitlab_project_members.py
!component +plugins/modules/gitlab_protected_branch.py

@Wihrt Wihrt changed the title [gitlab_user] Specify the version constraint for python-gitlab module [gitlab] Fix gitlab constants calls Nov 3, 2023
@Wihrt
Copy link
Contributor Author

Wihrt commented Nov 3, 2023

@lgatellier
I have added the changelog fragment.
I hope it complies with the standards :)

@ansibullbot ansibullbot added the bug This issue/PR relates to a bug label Nov 3, 2023
@Wihrt Wihrt force-pushed the docs/gitlab_user_patch branch from 4ecb193 to 04b69e5 Compare November 3, 2023 16:29
@lgatellier
Copy link
Contributor

lgatellier commented Nov 3, 2023

Seems good to me, LGTM !

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-7 backport-8 Automatically create a backport for the stable-8 branch labels Nov 3, 2023
@felixfontein felixfontein merged commit a366318 into ansible-collections:main Nov 3, 2023
Copy link

patchback bot commented Nov 3, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/a366318ac683303d05e14d4a7cbac9c7e2fe3077/pr-7467

Backported as #7473

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

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Nov 3, 2023
patchback bot pushed a commit that referenced this pull request Nov 3, 2023
fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318)
Copy link

patchback bot commented Nov 3, 2023

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/a366318ac683303d05e14d4a7cbac9c7e2fe3077/pr-7467

Backported as #7474

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

@felixfontein
Copy link
Collaborator

@Wihrt thanks a lot for your contribution!
@nejch @lgatellier thanks a lot for reviewing this!

patchback bot pushed a commit that referenced this pull request Nov 3, 2023
fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318)
felixfontein pushed a commit that referenced this pull request Nov 4, 2023
…calls (#7474)

[gitlab] Fix gitlab constants calls (#7467)

fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318)

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@gmail.com>
felixfontein pushed a commit that referenced this pull request Nov 4, 2023
…calls (#7473)

[gitlab] Fix gitlab constants calls (#7467)

fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318)

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@gmail.com>
Copy link

patchback bot commented Nov 4, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/a366318ac683303d05e14d4a7cbac9c7e2fe3077/pr-7467

Backported as #7475

🤖 @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 Nov 4, 2023
fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318)
felixfontein pushed a commit that referenced this pull request Nov 4, 2023
…calls (#7475)

[gitlab] Fix gitlab constants calls (#7467)

fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@conserto.pro>
(cherry picked from commit a366318)

Co-authored-by: Arnaud Hatzenbuhler <arnaud.hatzenbuhler@gmail.com>
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 bug This issue/PR relates to a bug docs module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants