fix(resource/scalingo_scm_repo_link): don't omit attributes anymore when creating repo link with review apps disabled#159
Open
josephpage wants to merge 2 commits intoScalingo:masterfrom
Conversation
…hen creating repo link with review apps disabled
Contributor
Author
Contributor
Author
|
More than a year since this PR was created, what are you waiting for from me to be able to merge it? |
Member
|
Hello @josephpage, We are really sorry about the delay to handle this PR. Thanks for raising the question here. The reason is mostly that it went under our radar so we forgot to talk about it internally. We will get back to you as soon as possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue description
This PR solves a problem I encountered recently: when creating a repo link using the resource
scalingo_scm_repo_linkwhile thedeploy_review_apps_enabled = false, the propertiesdelete_on_close_enabled,delete_stale_enabled,hours_before_delete_on_closeandhours_before_delete_staleare not configured by the create operation, so what is configured in the Scalingo API and therefore in the Terraform state does not conform to what is written in the HCL code.Here's an example:
The
terraform plancommand will propose the creation of this repo link:Next, let's use the
terraform applycommand, then redo theterraform planto understand what happened, or rather what didn't happen as expected:It is only after a second execution of the
terraform applycommand that the properties have been properly configured:Issue resolution
This problem is due to a condition in the code, which is not necessary according to the API documentation. I therefore propose that the Terraform provider should not try to be smarter than the API, and should allow all properties to be configured, whether
deploy_review_apps_enabledis enabled or not (especially as the auto-removal features continue to work on manually deployed review apps).I look forward to seeing your feedback on this PR.