-
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: correctly handle push rules add and edit #838
Conversation
18acd20
to
8b65434
Compare
8b65434
to
7e3ee19
Compare
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 new test
7e3ee19
to
944a927
Compare
@armsnyder What do you think about how I solved this? I kinda dislike it and but failed to come up with something better given the constraints of the SDK v2. That exact problem is one of the things addressed in the new framework: https://www.terraform.io/plugin/which-sdk (which we shouldn't switch to just yet, but just saying :D ) |
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 didn't look too closely since I was happy with the test. Now that you mention it I see a couple things that could be simplified. 😄
944a927
to
5c3f5cd
Compare
This is a possible approach to fix #836. Even though, I am not sure if that is
really that elegant of a solution ...
The root problem here is that the SDK v2 doesn't support to check if an
attribute value was set in config, state or the plan. During creation of
push rules, we don't have a way to distinguish between the default and
if the user has set the default explicitly. This makes the behavior
working for all cases (AFAIK) (incl. changing the instance default push
rules, no automated test possible yet).
This will be possbile in the new terraform provider framework.
5c3f5cd
to
f27db8c
Compare
This functionality has been released in v3.10.0 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 is a possible approach to fix https://github.com/gitlabhq/terraform-provider-gitlab/issues/836. Even though, I am not sure if that is
really that elegant of a solution ...
The root problem here is that the SDK v2 doesn't support to check if an
attribute value was set in config, state or the plan. During creation of
push rules, we don't have a way to distinguish between the default and
if the user has set the default explicitly. This makes the behavior
working for all cases (AFAIK) (incl. changing the instance default push
rules, no automated test possible yet).
This will be possbile in the new terraform provider framework