-
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_instance_variable: Add support for 'raw' property #9425
gitlab_instance_variable: Add support for 'raw' property #9425
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! I've added some first comments.
@@ -160,6 +166,7 @@ def create_variable(self, var_obj): | |||
"value": var_obj.get('value'), | |||
"masked": var_obj.get('masked'), | |||
"protected": var_obj.get('protected'), | |||
"raw": var_obj.get('raw'), |
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.
What does happen if the version of python-gitlab and/or GitLab itself do not support raw
?
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.
As far as I can see python-gitlab just passes everything through from the API, so version of that would be irrelevant. If the gitlab instance is so old it doesn't support raw it's severely out of date (a couple of years) and long out of support.
That said I think what would happen is that you would get the same idempotence issue that currently exists for up to date versions.
Not sure if there is a very easy way to make this backwards compatible. And the gitlab_group_variable and gitlab_project_variable plugins do the exact same thing without trying to do any backwards compatibility handling.
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 support for these modules was added in e7d8ef4. Since the PR is doing basically the same as here, let's assume this is fine as well.
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Backport to stable-10: 💚 backport PR created✅ Backport PR branch: Backported as #9477 🤖 @patchback |
* gitlab_instance_variable: Add support for 'raw' property * Changelog fragment * Add missing punctuation Co-authored-by: Felix Fontein <felix@fontein.de> * Add version_added Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit f8bfd5d)
@KBjorndal-VizRT thanks for implementing this! |
… support for 'raw' property (#9477) gitlab_instance_variable: Add support for 'raw' property (#9425) * gitlab_instance_variable: Add support for 'raw' property * Changelog fragment * Add missing punctuation Co-authored-by: Felix Fontein <felix@fontein.de> * Add version_added Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit f8bfd5d) Co-authored-by: KBjorndal-VizRT <83645484+KBjorndal-VizRT@users.noreply.github.com>
…lections#9425) * gitlab_instance_variable: Add support for 'raw' property * Changelog fragment * Add missing punctuation Co-authored-by: Felix Fontein <felix@fontein.de> * Add version_added Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
SUMMARY
Adds support for the "raw" property on CI variables, which also makes the module idempotent when used against GitLab versions that support this property. Fixes #9424
ISSUE TYPE
COMPONENT NAME
gitlab_instance_variable