-
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
respect new variable property in gitlab_group_variable and gitlab_project_variable #5667
respect new variable property in gitlab_group_variable and gitlab_project_variable #5667
Conversation
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Rework done. gitlab_project_variable gitlab_group_variable |
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Nejc Habjan <[email protected]>
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 think it looks good. But I'm not using this module, so maybe someone who does and/or knows it better should also take a look :)
Co-authored-by: Felix Fontein <[email protected]>
|
||
def filter_returned_variables(gitlab_variables): | ||
# pop properties we don't know | ||
existing_variables = [dict(x.attributes) for x in gitlab_variables] |
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.
Just a note, x.attributes
is already a dict (https://github.com/python-gitlab/python-gitlab/blob/b6c08725042380d20ef5f09979bc29f2f6c1ab6f/gitlab/base.py#L139-L149) (and I agree the list comprehension looked a bit more concise). But feel free to ignore this comment.
Probably outside of the scope of this PR but I'm starting to think at some point there could be 1 source of truth for the KNOWN
list (the same is used to construct the dicts in the modules).
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.
If x
is a dict, dict(x)
creates a copy of it. You could also write x.copy()
.
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.
Ah yes I totally missed that part of the discussion, ignore this :)
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, just left a non-blocking comment :)
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #5678 🤖 @patchback |
…ject_variable (#5667) * draft * add changelog fragment * rework * rework group variables * add new line at end of file * Update plugins/module_utils/gitlab.py Co-authored-by: Nejc Habjan <[email protected]> * rename * revert * return a copy * Update plugins/modules/gitlab_project_variable.py Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Nejc Habjan <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit c3bc172)
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #5679 🤖 @patchback |
…ject_variable (#5667) * draft * add changelog fragment * rework * rework group variables * add new line at end of file * Update plugins/module_utils/gitlab.py Co-authored-by: Nejc Habjan <[email protected]> * rename * revert * return a copy * Update plugins/modules/gitlab_project_variable.py Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Nejc Habjan <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit c3bc172)
…in gitlab_group_variable and gitlab_project_variable (#5678) respect new variable property in gitlab_group_variable and gitlab_project_variable (#5667) * draft * add changelog fragment * rework * rework group variables * add new line at end of file * Update plugins/module_utils/gitlab.py Co-authored-by: Nejc Habjan <[email protected]> * rename * revert * return a copy * Update plugins/modules/gitlab_project_variable.py Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Nejc Habjan <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit c3bc172) Co-authored-by: Markus Bergholz <[email protected]>
…in gitlab_group_variable and gitlab_project_variable (#5679) respect new variable property in gitlab_group_variable and gitlab_project_variable (#5667) * draft * add changelog fragment * rework * rework group variables * add new line at end of file * Update plugins/module_utils/gitlab.py Co-authored-by: Nejc Habjan <[email protected]> * rename * revert * return a copy * Update plugins/modules/gitlab_project_variable.py Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Nejc Habjan <[email protected]> Co-authored-by: Felix Fontein <[email protected]> (cherry picked from commit c3bc172) Co-authored-by: Markus Bergholz <[email protected]>
SUMMARY
fixes #5666
ISSUE TYPE
COMPONENT NAME
gitlab_project_variable
gitlab_group_variable
ADDITIONAL INFORMATION