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

Refactor ToTerraformValue to return a tftypes.Value. #231

Merged
merged 3 commits into from
Dec 20, 2021

Conversation

paddycarver
Copy link
Contributor

Refactor the attr.Value.ToTerraformValue to return a tftypes.Value,
which simplifies a bunch of code and makes the interface safer by
allowing it to be type checked by the compiler. It did require quite a
bit of refactoring of internal code, however.

This also simplifies checking whether an arbitrary attr.Value is null
or unknown considerably.

Fixes #171.

@paddycarver paddycarver added the tech-debt Issues tracking technical debt that we're carrying. label Dec 3, 2021
@paddycarver paddycarver requested a review from a team December 3, 2021 14:18
@bflad bflad self-assigned this Dec 6, 2021
@paddycarver paddycarver force-pushed the paddy_toterraformvalue branch from 4a6afc2 to 10e0034 Compare December 7, 2021 20:23
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Much cleaner! Two things, otherwise, looks good to me 🚀

.changelog/231.txt Outdated Show resolved Hide resolved
types/number.go Outdated Show resolved Hide resolved
Refactor the `attr.Value.ToTerraformValue` to return a `tftypes.Value`,
which simplifies a bunch of code and makes the interface safer by
allowing it to be type checked by the compiler. It did require quite a
bit of refactoring of internal code, however.

This also simplifies checking whether an arbitrary `attr.Value` is null
or unknown considerably.

Fixes #171.
@paddycarver paddycarver force-pushed the paddy_toterraformvalue branch from 10e0034 to 182a41c Compare December 15, 2021 09:20
Co-authored-by: Brian Flad <bflad417@gmail.com>
@paddycarver
Copy link
Contributor Author

Fixes look good?

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀

@paddycarver paddycarver merged commit 88f0847 into main Dec 20, 2021
@paddycarver paddycarver deleted the paddy_toterraformvalue branch December 20, 2021 07:48
ewbankkit added a commit to hashicorp/terraform-provider-awscc that referenced this pull request Jan 4, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tech-debt Issues tracking technical debt that we're carrying.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider making attr.Value.ToTerraformValue return a tftypes.Value
2 participants