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

Compute public advertised prefixes #7682

Merged
merged 9 commits into from
Apr 13, 2023

Conversation

slevenick
Copy link
Contributor

@slevenick slevenick commented Apr 10, 2023

Adds PublicAdvertisedPrefix and PublicDelegatedPrefix resources. These are immutable though they have a PATCH method in the API because the PATCH method is only allowed to act on members of the publicDelegatedPrefixs field which are better represented as their own resources.

Creating a PAP requires reverse DNS verification, so we use a special loopback IP range and special description (encrypted so as not to publicize this test-only value) to create a test resource. Because we use a specific IP range and quotas for PAPs are very low the tests are handwritten and run in serial to prevent conflict.

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_compute_public_advertised_prefix`
`google_compute_public_delegated_prefix`

@slevenick slevenick requested a review from a team as a code owner April 10, 2023 21:55
@slevenick slevenick requested review from shuyama1 and removed request for a team April 10, 2023 21:55
@modular-magician
Copy link
Collaborator

Oops! It looks like you're using unknown release-note types in your changelog entries:

  • new_resource
  • new_resource

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@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 ( 9 files changed, 1515 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 9 files changed, 1515 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))
TF Validator: Diff ( 4 files changed, 219 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_public_advertised_prefix (0 total tests)
Untested fields: dns_verification_ip, ip_cidr_range, name, description

Please add acceptance tests which include these fields.
Resource: google_compute_public_delegated_prefix (0 total tests)
Untested fields: ip_cidr_range, description, is_live_migration, region, name, parent_prefix

Please add acceptance tests which include these fields.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests 0
Skipped tests: 0
Affected tests: 0

Errors occurred during REPLAYING mode. Please fix them to complete your PR
View the build log

@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 ( 9 files changed, 1345 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 9 files changed, 1345 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))
TF Validator: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_public_advertised_prefix (0 total tests)
Untested fields: dns_verification_ip, ip_cidr_range, name, description

Please add acceptance tests which include these fields.
Resource: google_compute_public_delegated_prefix (0 total tests)
Untested fields: ip_cidr_range, name, parent_prefix, region, description, is_live_migration

Please add acceptance tests which include these fields.

@shuyama1
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 0
Passed tests 0
Skipped tests: 0
Affected tests: 0

Errors occurred during REPLAYING mode. Please fix them to complete your PR
View the build log

@slevenick
Copy link
Contributor Author

As noted, tested fields aren't being captured correctly due to the handwritten tests.

is_live_migration is not tested because I was unable to correctly set up a PDP with that flag configured. There are restrictions on enabling it, projects must be opted-in explicitly

@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 ( 9 files changed, 1345 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 9 files changed, 1345 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))
TF Validator: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_public_advertised_prefix (0 total tests)
Untested fields: name, description, dns_verification_ip, ip_cidr_range

Please add acceptance tests which include these fields.
Resource: google_compute_public_delegated_prefix (0 total tests)
Untested fields: description, is_live_migration, ip_cidr_range, name, parent_prefix, region

Please add acceptance tests which include these fields.

@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 ( 9 files changed, 1345 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 9 files changed, 1345 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))
TF Validator: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_public_advertised_prefix (0 total tests)
Untested fields: name, description, dns_verification_ip, ip_cidr_range

Please add acceptance tests which include these fields.
Resource: google_compute_public_delegated_prefix (0 total tests)
Untested fields: name, parent_prefix, region, description, is_live_migration, ip_cidr_range

Please add acceptance tests which include these fields.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2565
Passed tests 2286
Skipped tests: 275
Affected tests: 4

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputePublicPrefixes|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example|TestAccDataSourceGoogleFirebaseAndroidAppConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccComputePublicPrefixes[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example[Debug log]
TestAccDataSourceGoogleFirebaseAndroidAppConfig[Debug log]

All tests passed
View the build log or the debug log for each test

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

LGTM! Only small comments

name: 'region'
description: 'A region where the prefix will reside.'
url_param_only: true
immutable: true
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to set it explicitly, given the resource is immutable?

name: 'parentPrefix'
description: The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix.
required: true
immutable: true
Copy link
Member

Choose a reason for hiding this comment

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

also here

@rileykarson
Copy link
Member

@shuyama1: Want to pick this up while Sam's OOO? I can review the delta.

@shuyama1
Copy link
Member

@shuyama1: Want to pick this up while Sam's OOO? I can review the delta.

Sure! Taking a look now

@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 ( 9 files changed, 1345 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 9 files changed, 1345 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))
TF Validator: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_public_advertised_prefix (0 total tests)
Untested fields: dns_verification_ip, ip_cidr_range, name, description

Please add acceptance tests which include these fields.
Resource: google_compute_public_delegated_prefix (0 total tests)
Untested fields: description, is_live_migration, ip_cidr_range, name, parent_prefix, region

Please add acceptance tests which include these fields.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2615
Passed tests 2335
Skipped tests: 277
Affected tests: 3

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
TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example|TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample|TestAccDataSourceGoogleFirebaseAndroidAppConfig

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests passed during RECORDING mode:
TestAccApigeeKeystoresAliasesPkcs12_ApigeeKeystoresAliasesPkcs12Example[Debug log]
TestAccApigeeKeystoresAliasesKeyCertFile_apigeeKeystoresAliasesKeyCertFileTestExample[Debug log]
TestAccDataSourceGoogleFirebaseAndroidAppConfig[Debug log]

All tests passed
View the build log or the debug log for each test

@rileykarson
Copy link
Member

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

Successfully merging this pull request may close these issues.

4 participants