Skip to content
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

fix: state output values are json #477

Merged
merged 2 commits into from
Jun 21, 2023
Merged

Conversation

leg100
Copy link
Owner

@leg100 leg100 commented Jun 21, 2023

State output values were being treated like a string throughout the codebase, but of course they can be one of number of different terraform data types.

Terraform types translate to JSON types, so this PR changes the output value to be a json.RawMessage. The PR would also migrate the postgres type from string to JSONB, but the go-tfe integration tests we use rely on whitespace being preserved when comparing for equality; I tried using JSON postgres type but that broke the queries we use because that type doesn't "have an equality operator". So we'll migrate it to BYTEA, which'll do just fine.

Copy link
Contributor

@fsaintjacques fsaintjacques left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@leg100 leg100 merged commit c2b60c0 into master Jun 21, 2023
@leg100 leg100 deleted the fix-stringified-state-output-values branch December 16, 2023 10:22
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.

2 participants