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 certificate manager trust config resource #8623

Conversation

DanielRieske
Copy link
Contributor

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 Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_certificate_manager_trust_config`

Closes:

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a community contributor. @trodge, 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 modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 11, 2023
Copy link

@shakeebshams shakeebshams left a comment

Choose a reason for hiding this comment

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

LGTM

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 14, 2023
@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 ( 5 files changed, 1038 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1038 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 172 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

Missing test report

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

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

resource "google_certificate_manager_trust_config" "primary" {
  description = # value needed
  labels      = # value needed
  location    = # value needed
  name        = # value needed
  trust_stores {
    intermediate_cas {
      pem_certificate = # value needed
    }
    trust_anchors {
      pem_certificate = # value needed
    }
  }
}

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 14, 2023
@DanielRieske
Copy link
Contributor Author

I removed the whitespaces and whiteline to pass the linter but I am a little stumped on why it believes there are no acceptance tests.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2950
Passed tests 2643
Skipped tests: 302
Affected tests: 5

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
TestAccBigQueryDataTable_bigtable|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample|TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccCertificateManagerTrustConfig_certificateManagerTrustConfigExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigQueryDataTable_bigtable[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileMulticlusterExample[Debug log]
TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

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


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCertificateManagerTrustConfig_certificateManagerTrustConfigExample[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

@DanielRieske
Copy link
Contributor Author

@trodge could you share the test failure for TestAccCertificateManagerTrustConfig_certificateManagerTrustConfigExample I can't reproduce a failure in my own project.

@trodge
Copy link
Contributor

trodge commented Aug 14, 2023

This is the error:

2023-08-14T19:20:04.324Z [ERROR] sdk.helper_resource: Unexpected error: test_step_number=1 test_terraform_path=/bin/terraform test_working_directory=/tmp/plugintest1551355497
  error=
  | Error running pre-apply refresh: exit status 1
  | 
  | Error: Invalid function argument
  | 
  |   on terraform_plugin_test.tf line 9, in resource "google_certificate_manager_trust_config" "default":
  |    9:       pem_certificate = file("test-fixtures/certificatemanager/cert.pem")
  | 
  | Invalid value for "path" parameter: no file exists at
  | "test-fixtures/certificatemanager/cert.pem"; this function works only with
  | files that are distributed as part of the configuration source code, so if
  | this file will be created by a resource in this configuration you must
  | instead obtain this result from an attribute of that resource.
  | 
  | Error: Invalid function argument
  | 
  |   on terraform_plugin_test.tf line 12, in resource "google_certificate_manager_trust_config" "default":
  |   12:       pem_certificate = file("test-fixtures/certificatemanager/cert.pem") 
  | 
  | Invalid value for "path" parameter: no file exists at
  | "test-fixtures/certificatemanager/cert.pem"; this function works only with
  | files that are distributed as part of the configuration source code, so if
  | this file will be created by a resource in this configuration you must
  | instead obtain this result from an attribute of that resource.
   test_name=TestAccCertificateManagerTrustConfig_certificateManagerTrustConfigExample

@trodge
Copy link
Contributor

trodge commented Aug 14, 2023

I removed the whitespaces and whiteline to pass the linter but I am a little stumped on why it believes there are no acceptance tests.

The missing test detector currently isn't seeing any tests because they've been moved to service packages.

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 14, 2023
@DanielRieske
Copy link
Contributor Author

I removed the whitespaces and whiteline to pass the linter but I am a little stumped on why it believes there are no acceptance tests.

The missing test detector currently isn't seeing any tests because they've been moved to service packages.

Ah that explains it, I have multiple PR's claiming fields to be missing in acceptance tests and was already curious what was going on.

@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 ( 5 files changed, 1038 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1038 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 172 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

Missing test report

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

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

resource "google_certificate_manager_trust_config" "primary" {
  description = # value needed
  labels      = # value needed
  location    = # value needed
  name        = # value needed
  trust_stores {
    intermediate_cas {
      pem_certificate = # value needed
    }
    trust_anchors {
      pem_certificate = # value needed
    }
  }
}

@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Aug 14, 2023
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 14, 2023
@DanielRieske
Copy link
Contributor Author

I will take a look tomorrow why file("test-fixtures/certificatemanager/cert.pem") can't be found.
At the moment I can't put my finger on it as it seems these fixtures do exist in the project and they are used for several other tests.

@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 ( 6 files changed, 1051 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1046 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 172 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

Missing test report

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

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

resource "google_certificate_manager_trust_config" "primary" {
  description = # value needed
  labels      = # value needed
  location    = # value needed
  name        = # value needed
  trust_stores {
    intermediate_cas {
      pem_certificate = # value needed
    }
    trust_anchors {
      pem_certificate = # value needed
    }
  }
}

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Aug 14, 2023
@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 ( 5 files changed, 1046 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 5 files changed, 1046 insertions(+), 2 deletions(-))
TF Conversion: Diff ( 1 file changed, 172 insertions(+))
TF OiCS: Diff ( 4 files changed, 119 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2950
Passed tests 2647
Skipped tests: 302
Affected tests: 1

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
TestAccCertificateManagerTrustConfig_certificateManagerTrustConfigExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccCertificateManagerTrustConfig_certificateManagerTrustConfigExample[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

mariomachado94 and others added 20 commits August 15, 2023 10:02
…gger.source_to_build, supporting manual, pub/sub and webhook triggers. (GoogleCloudPlatform#8544)

Also fixes TestAccCloudBuildTrigger_basic_bitbucket test.

Co-authored-by: Mario Machado <mariomachado@google.com>
…oogle (GoogleCloudPlatform#8526)

* add scalingConfig object for google_dataproc_metastore_service

* add an example of a DPMS 2 config

* remove invalid value for instanceSize

* WIP: Add tests for scaling_factor

* changes for ga provider

- removed google-beta provider
- removed fields from tests that require google-beta provider (gRPC)

* add exactly_one_of for instance_size and scaling_factor
…atform#8612)

* Add Backupdr with Management Server resource

* Fixing lint issue

* Fixing Variable name

* FIxing values of type and peering mode

* Fixing description and example

* Adding type and Peering_mode to coverage

* Changing release version of provider to only beta

* Changing variable name

* Fixing Acceptance test and trademark
…eCloudPlatform#8378)

* Generate Mmv1 test files to the service packages

* Fix test-fixtures

* Copy test-fixtures in service packages

* Replace test-fixtures path

* Fix rebasing errors

* Fix function usage

* Fix test TestAccBigQueryExternalDataTable_objectTable

* Fix test-fixtures

* Keep deprecated utility functions

* Move tests

* Fixing rebasing error

* Move more tests to the service packages

* Add back resource_resourcemanager_lien_test.go

* Change package name

* Fix test-fixtures

* Fix the test-fixtures
…leCloudPlatform#8585)

* Made reviewer assignment comment include detected reviewer type

Also made it clearly state whether tests will run automatically

* Temporarily made it run for core contributors

* Revert "Temporarily made it run for core contributors"

This reverts commit 18314a0.

* Fixed formatting for non-Googler comments

* gofmt

* Switched back to using the embedded string for the comment template

* Fixed conditions for posting new comment
…8508)

* Build provider before running tests

* Exit if build fails

* Move pending status after build
…Y instead of deprecated INTERNAL_HTTPS_LOAD_BALANCER (GoogleCloudPlatform#8571)

* Update subnetwork descriptions and tests to use REGIONAL_MANAGED_PROXY instead of deprecated INTERNAL_HTTPS_LOAD_BALANCER.

* Update mmv1/products/compute/Subnetwork.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* Update mmv1/products/compute/Subnetwork.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* Update mmv1/products/compute/Subnetwork.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* Update mmv1/products/compute/Subnetwork.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* Update mmv1/products/compute/Subnetwork.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* Update mmv1/products/compute/Subnetwork.yaml

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

* Remove remaining references to INTERNAL_HTTPS_LOAD_BALANCER.

---------

Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
…t resource (GoogleCloudPlatform#8555)

* Added support for versionAliases field in google_secret_manager_secret resource

* Removed redundant test step from the version_aliases field testcases
…oogleCloudPlatform#8629)

* Add `BRANCH_NAME` parameter to projects. This will be used by the manually-configured VCS root

* Update comment above where `BRANCH_NAME` is set
…#8627)

Also added unit tests for labeler and backfill script
… resource (GoogleCloudPlatform#8625)

* Add a new supported value to the scope field in certificate resource

* Improve the naming of the examples to avoid concurrency errors while running acceptance tests

---------

Co-authored-by: Hamza Hassan <hamzahassan@google.com>
* Look for test files in service packages

* Remove TPG_LOCAL_PATH
…8217)

* Move gcp_sweeper_test.go to the sweeper package

* Change the sweeper path
@DanielRieske
Copy link
Contributor Author

I am going to close this PR and create a new one, I can't seem to fix the branch after rebasing it with main and the changes were relatively small so I will opt on making a new one.

Sorry for the unwanted noise everyone.

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.