这是indexloc提供的服务,不要输入任何密码
Skip to content

Prevent project field coercion on creation #59

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

Merged
merged 3 commits into from
Aug 24, 2022
Merged

Conversation

dglsparsons
Copy link
Collaborator

In the Vercel API the following fields are coerced to null during project creation
if they are falsy in the create-project request:

  • BuildCommand
  • DevCommand
  • InstallCommand
  • OutputDirectory
  • PublicSource

This causes an issue when they are specified, but falsy, as the
terraform configuration explicitly sets a value for them, but the Vercel
API returns a different value. This causes an inconsistent plan error.

We avoid this issue by choosing to use values from the terraform state,
but only if they are explicitly stated and they are falsy values
and the response value was Null. This is important as drift detection
would fail to work if the value was always selected.

Closes #56

In the Vercel API the following fields are coerced to null during project creation
if they are falsy:
* BuildCommand
* DevCommand
* InstallCommand
* OutputDirectory
* PublicSource

This causes an issue when they are specified, but falsy, as the
terraform configuration explicitly sets a value for them, but the Vercel
API returns a different value. This causes an inconsistent plan error.

We avoid this issue by choosing to use values from the terraform state,
but only if they are _explicitly stated_ *and* they are _falsy_ values
*and* the response value was Null. This is important as drift detection
would fail to work if the value was always selected.
@dglsparsons
Copy link
Collaborator Author

2 extra changes I'll make before this gets merged:

  • add a test
  • improve the documentation of public_source.

@dglsparsons dglsparsons merged commit d14148b into main Aug 24, 2022
@dglsparsons dglsparsons deleted the fix-api-coersion branch August 24, 2022 12:58
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.

Error: Provider produced inconsistent result after apply
2 participants