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

Update hashicorp/terraform-plugin-framework, terraform-plugin-mux, terraform-plugin-sdk/v2 to navigate breaking change in provider-defined functions #10109

Merged

Conversation

SarahFrench
Copy link
Collaborator

@SarahFrench SarahFrench commented Mar 4, 2024

This PR upgrades the provider functions to use Errors instead of Diagnostics - this is a breaking change introduced in plugin-framework 1.6.0 . By addressing it now I want to avoid navigating those changes after a function is released.

Impact of the change is that provider-defined functions cannot issue warnings anymore, only errors. I've replaced use of warnings with debug logs.

I wanted the debug log to include information about which function was making the log. This required some refactoring about where we set the function's name, to make it accessible in the Run logic of the individual functions.

Release Note Template for Downstream PRs (will be copied)

provider: updated all provider-defined functions to use new error reporting behaviour set by hashicorp/terraform-plugin-framework v1.6.0. Information about ambiguous input values will now be reported by debug logs, instead of warnings.

This comment was marked as resolved.

@SarahFrench SarahFrench changed the base branch from main to FEATURE-BRANCH-provider-functions March 4, 2024 20:29
@SarahFrench SarahFrench changed the title Make provider functions use errors Update hashicorp/terraform-plugin-framework, terraform-plugin-mux, terraform-plugin-sdk/v2 to navigate breaking change in provider-defined functions Mar 4, 2024
@SarahFrench SarahFrench force-pushed the make-provider-functions-use-errors branch from ad2836c to d17f21d Compare March 12, 2024 12:45
@SarahFrench
Copy link
Collaborator Author

Rebased branch to pull in latest changes from the feature branch, plus resolved merge conflicts in go.mod and go.sum

@modular-magician

This comment was marked as outdated.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 10 files changed, 144 insertions(+), 195 deletions(-))
Terraform Beta: Diff ( 10 files changed, 144 insertions(+), 195 deletions(-))

@SarahFrench SarahFrench mentioned this pull request Mar 12, 2024
@SarahFrench SarahFrench force-pushed the make-provider-functions-use-errors branch from c96e0cf to f53204e Compare March 13, 2024 18:27
@modular-magician

This comment was marked as outdated.

1 similar comment
@modular-magician

This comment was marked as outdated.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 14 files changed, 196 insertions(+), 255 deletions(-))
Terraform Beta: Diff ( 14 files changed, 196 insertions(+), 255 deletions(-))

…1.6.0`

This diff is the result of running:
* go get github.com/hashicorp/terraform-plugin-framework@v1.6.0
* go get github.com/hashicorp/terraform-plugin-mux@v0.15.0
* go get github.com/hashicorp/terraform-plugin-sdk/v2@v2.33.0
* go mod tidy
…stics. Remove use of warnings as a result, opt for debug log instead.
@SarahFrench SarahFrench force-pushed the make-provider-functions-use-errors branch from 3dd88b4 to eaef718 Compare March 15, 2024 18:22
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 17 files changed, 191 insertions(+), 274 deletions(-))
google-beta provider: Diff ( 17 files changed, 191 insertions(+), 274 deletions(-))

@SarahFrench
Copy link
Collaborator Author

SarahFrench commented Mar 15, 2024

@SarahFrench SarahFrench marked this pull request as ready for review March 15, 2024 19:05
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 17 files changed, 189 insertions(+), 274 deletions(-))
google-beta provider: Diff ( 17 files changed, 189 insertions(+), 274 deletions(-))

@SarahFrench SarahFrench requested a review from BBBmau March 15, 2024 19:22
@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3528
Passed tests: 3160
Skipped tests: 365
Affected tests: 3

Click here to see the affected service packages
all service packages are affected

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaseAndroidApp_update|TestAccNetappkmsconfig_kmsConfigCreateExample_Update|TestAccNotebooksInstance_notebookInstanceFullExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccFirebaseAndroidApp_update[Debug log]
TestAccNetappkmsconfig_kmsConfigCreateExample_Update[Debug log]
TestAccNotebooksInstance_notebookInstanceFullExample[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@SarahFrench
Copy link
Collaborator Author

@BBBmau friendly reminder 😁
Also, to help with review, I triggered the provider functions acceptance tests to run here using the GA provider branch linked to from this comment.

Also, here's a screenshot from when I ran an internal test locally to see the debug log after removing use of tflog. The log replaces the previous use of warnings (see PR description).

Screenshot 2024-03-22 at 18 42 03

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 17 files changed, 189 insertions(+), 274 deletions(-))
google-beta provider: Diff ( 17 files changed, 189 insertions(+), 274 deletions(-))

@BBBmau
Copy link
Collaborator

BBBmau commented Mar 22, 2024

@SarahFrench Thank you for the ping! I completely lost track of this. Reviewing right now.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3528
Passed tests: 3157
Skipped tests: 365
Affected tests: 6

Click here to see the affected service packages
all service packages are affected

Action taken

Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccFirebaseAppCheckServiceConfig_firebaseAppCheckServiceConfigUnenforcedExample|TestAccFirebaseAppCheckServiceConfig_firebaseAppCheckServiceConfigUpdate|TestAccFirestoreIndex_firestoreIndexBasicExample|TestAccFirestoreIndex_firestoreIndexDatastoreModeExample|TestAccWorkstationsWorkstationConfig_update|TestAccWorkstationsWorkstationConfig_updateHostDetails

Get to know how VCR tests work

@SarahFrench
Copy link
Collaborator Author

Thanks! I'll wait for checks to finish and then merge

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccFirebaseAppCheckServiceConfig_firebaseAppCheckServiceConfigUnenforcedExample[Debug log]
TestAccFirebaseAppCheckServiceConfig_firebaseAppCheckServiceConfigUpdate[Debug log]
TestAccFirestoreIndex_firestoreIndexBasicExample[Debug log]
TestAccWorkstationsWorkstationConfig_update[Debug log]
TestAccWorkstationsWorkstationConfig_updateHostDetails[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccFirestoreIndex_firestoreIndexDatastoreModeExample[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@SarahFrench
Copy link
Collaborator Author

TestAccFirestoreIndex_firestoreIndexDatastoreModeExample

This failure isn't related to the PR - merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants