-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add support for global application in Apphub #12017
Add support for global application in Apphub #12017
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
2 similar comments
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 14 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 14 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 14 Click here to see the affected service packages
🟢 All tests passed! View the build log |
scope_type := diff.Get("scope.0.type") | ||
|
||
if scope_type == "GLOBAL" { | ||
if location != "global" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the API give an appropriate error in this case? If so, is there a particular pressure to duplicate this validation in the Terraform provider?
Adding additional validation at this level can lead to instances where the API requirements change but the Terraform providers lag behind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API will give an appropriate error in such case. But we wanted terraform plan to perform validation and catch this error.
} | ||
} | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should cover this logic somewhere in a test. If we are going to keep it (see my previous comment), let's add an invalid config in https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/services/apphub/resource_apphub_application_test.go and use ExpectError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
'location': '"us-east1"' | ||
'scope_type': '"REGIONAL"' | ||
- name: 'application_global_basic' | ||
config_path: 'templates/terraform/examples/apphub_application_basic.tf.tmpl' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is config_path actually necessary here? This is usually just used in for private overrides. I'm assuming other examples of using this were just accidentally copied over from the private repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have updated basic and full examples to remove config_path. But for *_global_basic , we were intending to use the same config as basic with different values.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 15 Click here to see the affected service packages
Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
@c2thorn This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
Add support for global application and validation for location and scope type
FIXES hashicorp/terraform-provider-google#19252
Release Note Template for Downstream PRs (will be copied)