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

internal/fwserver: Log detected plan value differences before unknown marking #630

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jan 20, 2023

Closes #627

This logging only contains the attribute paths to prevent showing sensitive or large values. This also promotes the marking log level from TRACE to DEBUG since the behavior may be unexpected by provider developers.

Example logging output from a provider with detected differences:

2023-01-19T20:42:44.529-0500 [DEBUG] sdk.framework: Detected value change between proposed new state and prior state: tf_resource_type=jupiterone_rule tf_req_id=fe77fac5-bdee-7fae-435e-0669566f5d6e tf_provider_addr=registry.terraform.io/hashicorp/jupiterone tf_rpc=PlanResourceChange tf_attribute_path=operations
2023-01-19T20:42:44.529-0500 [DEBUG] sdk.framework: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: tf_resource_type=jupiterone_rule tf_req_id=fe77fac5-bdee-7fae-435e-0669566f5d6e tf_provider_addr=registry.terraform.io/hashicorp/jupiterone tf_rpc=PlanResourceChange

… marking

Reference: #627

This logging only contains the attribute paths to prevent showing sensitive or large values. This also promotes the marking log level from TRACE to DEBUG since the behavior may be unexpected by provider developers.

Example logging output from a provider with detected differences:

```
2023-01-19T20:42:44.529-0500 [DEBUG] sdk.framework: Detected value change between proposed new state and prior state: tf_resource_type=jupiterone_rule tf_req_id=fe77fac5-bdee-7fae-435e-0669566f5d6e tf_provider_addr=registry.terraform.io/hashicorp/jupiterone tf_rpc=PlanResourceChange tf_attribute_path=operations
2023-01-19T20:42:44.529-0500 [DEBUG] sdk.framework: Marking Computed attributes with null configuration values as unknown (known after apply) in the plan to prevent potential Terraform errors: tf_resource_type=jupiterone_rule tf_req_id=fe77fac5-bdee-7fae-435e-0669566f5d6e tf_provider_addr=registry.terraform.io/hashicorp/jupiterone tf_rpc=PlanResourceChange
```
@bflad bflad added the enhancement New feature or request label Jan 20, 2023
@bflad bflad requested a review from a team as a code owner January 20, 2023 01:52
@bflad bflad added this to the v1.2.0 milestone Jan 20, 2023
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@bflad bflad merged commit a3497ab into main Feb 2, 2023
@bflad bflad deleted the bflad/plan-diff-logging branch February 2, 2023 15:09
@github-actions
Copy link

github-actions bot commented Mar 5, 2023

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 Mar 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Logging for Differences Between Proposed New State and Prior State During Planning
2 participants