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

core: Add sensitive provider attrs to JSON plan #28523

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

alisdair
Copy link
Contributor

When rendering a stored plan file as JSON, we include a data structure representing the sensitivity of the changed resource values (#28201). Prior to this commit, this was a direct representation of the sensitivity marks applied to values via mechanisms such as sensitive variables, sensitive outputs, and the sensitive function.

This commit extends this to include sensitivity based on the provider schema. This is in line with the UI rendering of the plan, which considers these two different types of sensitivity to be equivalent.

Fixes #28522.

@alisdair alisdair added core 0.15-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Apr 26, 2021
@alisdair alisdair requested a review from a team April 26, 2021 20:38
@alisdair alisdair self-assigned this Apr 26, 2021
@codecov
Copy link

codecov bot commented Apr 26, 2021

Codecov Report

Merging #28523 (d9bbc6c) into main (4997b9b) will decrease coverage by 0.00%.
The diff coverage is 62.16%.

❗ Current head d9bbc6c differs from pull request most recent head c89004d. Consider uploading reports for the commit c89004d to get more accurate results

Impacted Files Coverage Δ
command/jsonplan/plan.go 33.33% <0.00%> (-0.72%) ⬇️
configs/configschema/marks.go 77.77% <77.77%> (ø)
terraform/evaluate.go 51.30% <100.00%> (-1.88%) ⬇️
configs/configschema/implied_type.go 86.48% <0.00%> (+5.40%) ⬆️

@alisdair
Copy link
Contributor Author

I'd like to be able to add a command-package test for this, but modifying the existing tests makes an enormous mess of the diff. I'll revisit tomorrow in case I'm inspired overnight.

When rendering a stored plan file as JSON, we include a data structure
representing the sensitivity of the changed resource values. Prior to
this commit, this was a direct representation of the sensitivity marks
applied to values via mechanisms such as sensitive variables, sensitive
outputs, and the `sensitive` function.

This commit extends this to include sensitivity based on the provider
schema. This is in line with the UI rendering of the plan, which
considers these two different types of sensitivity to be equivalent.

Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com>
@alisdair alisdair force-pushed the alisdair/json-plan-sensitive-provider-attrs branch from d9bbc6c to c89004d Compare April 27, 2021 14:29
@alisdair
Copy link
Contributor Author

Thanks to @mildwonkey we now have a command package test case which covers this! 🎉 Rebased and squashed into one commit now.

@alisdair alisdair merged commit 4b1ff4e into main Apr 28, 2021
@alisdair alisdair deleted the alisdair/json-plan-sensitive-provider-attrs branch April 28, 2021 19:49
@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 May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0.15-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sensitive values from resource schema are not being exported as sensitive in JSON
2 participants