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

Inconsistent behaviour between SDK and plugin framework provider config code when handling region self-links #15714

Assignees
Labels

Comments

@SarahFrench
Copy link
Member

SarahFrench commented Sep 4, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

N/A

Affected Resource(s)

  • Provider configuration

Terraform Configuration Files

N/A

Debug Output

N/A

Panic Output

N/A

Expected Behavior

The SDK provider config code transforms the region value from a self link to a region name: link to unit test showing this
We'd expect the plugin framework version of that logic to behave the same way

Actual Behavior

The plugin framework version of that logic leaves the region value as a self link : link to failing unit test

I haven't checked, but I think this doesn't impact users because the GetRegion functions used in the provider can accept a self link value and change it into a region name.

Steps to Reproduce

Uncomment and run the affected unit test using the code that's currently on main branch - the test will fail

Important Factoids

The SDK and PF provider config code follow the same pattern of having one struct/variable that contains the provider configuration data in a SDK-y or Plugin Framework-y way, and that data is used to populate a struct that's specific to the Google provider. The SDK code performs this truncation of the value when copying the region data to that second struct, but the Plugin Framework code doesn't.

References

  • #0000
@c2thorn
Copy link
Collaborator

c2thorn commented Sep 21, 2023

@SarahFrench @BBBmau does GoogleCloudPlatform/magic-modules#8587 also fix this?

@SarahFrench
Copy link
Member Author

SarahFrench commented Sep 22, 2023

No it doesn't - that PR only touches helper functions used for finding location/region/zone values for resources and data sources.

This issue is super similar but is specific to the provider config code. I can put in a quick PR to fix this today, but this issue is more of a code-inconsistency issue (i.e. doesn't need to be done for 5.0.0) as I don't think this defect is user facing:

I think this doesn't impact users because the GetRegion functions used in the provider can accept a self link value and change it into a region name

@c2thorn
Copy link
Collaborator

c2thorn commented Sep 22, 2023

this issue is more of a code-inconsistency issue (i.e. doesn't need to be done for 5.0.0) as I don't think this defect is user facing

That's fair, then I will remove it from the 5.0.0 milestone just for tracking.

@c2thorn c2thorn modified the milestones: 5.0.0, Near-Term Goals Sep 22, 2023
@SarahFrench
Copy link
Member Author

👍 Thanks, I'd overlooked that I'd added it to that milestone! I'll make a PR into main and it can be released soon after 5.0.0

Copy link

github-actions bot commented Nov 3, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.