resource/gitlab_branch_protection: fix issue claiming that no valid access level can be found. Closes #890 #892
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't really understand yet what happens here. However, that behavior
changed from v3.9.1 to v3.10.0. Thus, I'm simply reverting it back.
We've had a brief exchange about this already when the "broken" code was
merged here: #881 (comment)
Obviously, we made the wrong call in that this situation doesn't
happen ... well, it happened.
Looking at the
gitlab_branch_protection
resource I find that it'skinda unclear what's going on, also looking at the upstream API docs
doesn't shed any lights on this as the documentation is quite sparse.
Some of this was lately raised by @beekeep in
https://github.com/gitlabhq/terraform-provider-gitlab/issues/878#issuecomment-1048902570
, that is that some fields are arguments in the provider, but optional
in the upstream API. Also the implemented logic to retrieve the set
push_access_level
andmerge_access_level
can only be guessed whentrying to understand how those values come to be from a
POST
to aGET
request of the Protected BranchesAPI.
Closes #890
Description
PR Checklist Acknowledgement
//lintignore
comments were copied from existing code. (Linter rules are meant to be enforced on new code.)