-
Notifications
You must be signed in to change notification settings - Fork 319
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
resource/gitlab_project: fix waiting for default branch protection during creation #908
Conversation
…ring creation
This patch fixes waiting for the protection on the default branch in a
scenario where the project is in a group namespace which has the default
branch protection disabled.
NOTE: I've made some assumption that this can only happen for the
projects in group namespaces (e.g. project in a user namespace can't
turn the default branch protection off) and that this information about
the disabled default branch protection can always be read from the group
the project is directly assigned to.
Closes #906
f354795
to
7fa7807
Compare
@timofurrer - I tested out a couple scenarios on the GitLab API, and as far as I can tell the In the interests of defensive coding for future proofing, would we want to assume a value of |
@PatrickRice-KSC
What do you mean by "not returned from the API?" ? From the |
@timofurrer - Sorry, what I meant is if we get a valid response from I'm talking myself out of it though, because that would cause the branch to then trigger the WaitForState loop, which is exactly the behavior we'd want if it was falling back to the default. Nevermind 😄 |
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 the test! I agree with your assumptions. I did not check what happens if you have a project within a subgroup of another group, but I would assume the default branch protection settings does not cascade.
This functionality has been released in v3.11.1 of the Terraform GitLab Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue. Thank you! |
This patch fixes waiting for the protection on the default branch in a
scenario where the project is in a group namespace which has the default
branch protection disabled.
NOTE: I've made some assumption that this can only happen for the
projects in group namespaces (e.g. project in a user namespace can't
turn the default branch protection off) and that this information about
the disabled default branch protection can always be read from the group
the project is directly assigned to.
Closes #906
Caused by #862
/cc @PatrickRice-KSC @armsnyder as you can read above I've made some assumptions. Can any of you confirm these?