Skip to content

Update and fix variable _create_attrs and _update_attrs#3379

Open
PhilipNelson5 wants to merge 2 commits intopython-gitlab:mainfrom
PhilipNelson5:fix-var-attrs
Open

Update and fix variable _create_attrs and _update_attrs#3379
PhilipNelson5 wants to merge 2 commits intopython-gitlab:mainfrom
PhilipNelson5:fix-var-attrs

Conversation

@PhilipNelson5
Copy link
Copy Markdown

Changes

  1. make value an optional attribute for variable updates

    When updating a CI/CD variable that has been marked "Masked and hidden", you likely do not have the value when updating. In this case, the value is None which the api rejects (400: {'value': ['is invalid']}).

  2. add masked_and_hidden the the list of optional attributes for creating variables

    When creating variables which you want to be hidden, you have to use the masked_and_hidden property.

    I don't think this was causing problems but for the sake completion and documentation I think it makes sense to include.

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

@PhilipNelson5
Copy link
Copy Markdown
Author

I tried running the suite of functional tests but was unable to. I got the docker containers up but they were so unstable that even adding gl = gitlab.Gitlab( ... retry_transient_errors=True) couldn't get passed the 500 errors.

I was able to run the variable tests against a live gitlab instance to demonstrate to myself the tests failed before my changes and passed after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant