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

Add google_site_verification_web_resource #11624

Merged

Conversation

SirGitsalot
Copy link
Member

@SirGitsalot SirGitsalot commented Sep 3, 2024

The adds support for the site verification API WebResource. It's step two out of three in implementing issue 5698. Step one was #10999 and step 3 will add the owners field as a fine grained resource attached to this resource.

There's two basic ways to verify ownership of a site: creating a DNS record or modifying the site's content. I've included tests for both, but the former is disabled under VCR as it requires dynamically creating a real, resolvable DNS record as part of the test. I know we have gcp.tfacc.hashicorptest.com for use in other tests, but I couldn't find an example of creating records in that zone.

Release Note Template for Downstream PRs (will be copied)

`google_site_verification_web_resource`

@github-actions github-actions bot requested a review from slevenick September 3, 2024 17:55
Copy link

github-actions bot commented Sep 3, 2024

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@slevenick, 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.

@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 ( 6 files changed, 874 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 873 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

1 similar comment
@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 ( 6 files changed, 874 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 6 files changed, 873 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3781
Passed tests: 3364
Skipped tests: 412
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteverificationDomain

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccComputeInstanceTemplate_withNamePrefix
  • TestAccNetappActiveDirectory_activeDirectory_FullUpdate
  • TestAccNetappBackup_NetappBackupFull_update
  • TestAccSiteVerificationWebResource_siteverificationBucket

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3898
Passed tests: 3481
Skipped tests: 412
Affected tests: 5

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteverificationDomain

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccComputeInstanceTemplate_withNamePrefix
  • TestAccNetappActiveDirectory_activeDirectory_FullUpdate
  • TestAccNetappBackup_NetappBackupFull_update
  • TestAccSiteVerificationWebResource_siteverificationBucket

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBackupDRBackupVault_fullUpdate[Debug log]
TestAccComputeInstanceTemplate_withNamePrefix[Debug log]
TestAccNetappActiveDirectory_activeDirectory_FullUpdate[Debug log]
$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


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

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBackupDRBackupVault_fullUpdate[Debug log]
TestAccComputeInstanceTemplate_withNamePrefix[Debug log]
TestAccNetappActiveDirectory_activeDirectory_FullUpdate[Debug log]
TestAccNetappBackup_NetappBackupFull_update[Debug log]
$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


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

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@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 ( 6 files changed, 922 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 921 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Missing test report

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

Resource: google_site_verification_web_resource (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_site_verification_web_resource" "primary" {
  site {
    identifier = # value needed
    type       = # value needed
  }
  verification_method = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3638
Passed tests: 3225
Skipped tests: 411
Affected tests: 2

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteverificationDomain

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceTemplate_withNamePrefix
  • TestAccSiteVerificationWebResource_siteverificationBucket

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Debug log]
$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


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

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@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 ( 6 files changed, 926 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 925 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Missing test report

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

Resource: google_site_verification_web_resource (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_site_verification_web_resource" "primary" {
  site {
    identifier = # value needed
    type       = # value needed
  }
  verification_method = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3774
Passed tests: 3361
Skipped tests: 411
Affected tests: 2

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteverificationDomain

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceTemplate_withNamePrefix
  • TestAccSiteVerificationWebResource_siteverificationBucket

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Debug log]
TestAccSiteVerificationWebResource_siteverificationBucket[Debug log]
$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

@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 ( 6 files changed, 926 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 925 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Missing test report

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

Resource: google_site_verification_web_resource (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_site_verification_web_resource" "primary" {
  site {
    identifier = # value needed
    type       = # value needed
  }
  verification_method = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3961
Passed tests: 3548
Skipped tests: 412
Affected tests: 1

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteverificationDomain

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBackupDRBackupVault_fullUpdate[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

Copy link

github-actions bot commented Sep 6, 2024

@slevenick This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

mmv1/products/siteverification/WebResource.yaml Outdated Show resolved Hide resolved
mmv1/products/siteverification/WebResource.yaml Outdated Show resolved Hide resolved
self_link: webResource/{{id}}
create_url: webResource?verificationMethod={{verification_method}}
delete_url: webResource/{{id}}
id_format: '{{id}}'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be webResource/{{id}}? Usually we keep this in a selfLink-ish form so we can use .id from other resources. In this case that would probably never happen, but it would keep the ID formats standardized

Copy link
Member Author

Choose a reason for hiding this comment

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

In this case, changing id_format results in a post-create read to /siteVerification/v1/webResource/webResource/{{id}}.

FWIW I have a follow-up PR to add a fine grained resource to this resource, and the test resource looks like:

resource "google_site_verification_owner" "example" {
  web_resource_id = google_site_verification_web_resource.example.id
  email           = "%{owner}"
}

It resolves OK 🤷

@github-actions github-actions bot requested a review from slevenick September 6, 2024 23:14
@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 ( 6 files changed, 926 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 925 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Missing test report

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

Resource: google_site_verification_web_resource (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_site_verification_web_resource" "primary" {
  site {
    identifier = # value needed
    type       = # value needed
  }
  verification_method = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3978
Passed tests: 3567
Skipped tests: 410
Affected tests: 1

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteVerificationDomain

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccBackupDRBackupVault_fullUpdate

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBackupDRBackupVault_fullUpdate[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

@SirGitsalot
Copy link
Member Author

Ah, that all makes sense!

I did end up leaving in identity (changing it from id to web_resource_id). Without it the create doesn't extract web_resource_id from the API response. That is, identity causes this code to be generated post-create:

if err := d.Set("web_resource_id", flattenSiteVerificationWebResourceWebResourceId(res["id"], d, config)); err != nil {
    return fmt.Errorf(`Error setting computed identity field "web_resource_id": %s`, err)
}

@github-actions github-actions bot requested a review from slevenick September 12, 2024 23:55
@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 ( 6 files changed, 930 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 6 files changed, 929 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 99 insertions(+))

Missing test report

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

Resource: google_site_verification_web_resource (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_site_verification_web_resource" "primary" {
  site {
    identifier = # value needed
    type       = # value needed
  }
  verification_method = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4034
Passed tests: 3618
Skipped tests: 412
Affected tests: 4

Click here to see the affected service packages

All service packages are affected

#### Non-exercised tests

Tests were added that are skipped in VCR:

  • TestAccSiteVerificationWebResource_siteVerificationDomain

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
  • TestAccBackupDRBackupVault_fullUpdate
  • TestAccFrameworkProviderBasePath_setInvalidBasePath
  • TestAccProjectIamPolicy_invalidMembers
  • TestAccSiteVerificationWebResource_siteVerificationBucket

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBackupDRBackupVault_fullUpdate[Debug log]
TestAccProjectIamPolicy_invalidMembers[Debug log]
TestAccSiteVerificationWebResource_siteVerificationBucket[Debug log]

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


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

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@SirGitsalot SirGitsalot merged commit 8709d00 into GoogleCloudPlatform:main Sep 13, 2024
12 of 13 checks passed
@SirGitsalot SirGitsalot deleted the siteverification-web-resource branch September 13, 2024 21:17
iyabchen pushed a commit to iyabchen/magic-modules that referenced this pull request Sep 14, 2024
abd-goog pushed a commit to abd-goog/magic-modules that referenced this pull request Sep 23, 2024
niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Oct 7, 2024
Philip-Jonany pushed a commit to Philip-Jonany/magic-modules that referenced this pull request Nov 4, 2024
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.

3 participants