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

Modify labels fields for DCL resources #8563

Merged
merged 5 commits into from
Aug 15, 2023

Conversation

zli82016
Copy link
Member

@zli82016 zli82016 commented Aug 4, 2023

  1. Transform the top level "labels" and "annotations" fields for DCL resources. Currently all of labels fields for DCL resources are in the top level, so just handle this case now.

    • Add note to the description
    • Add new fields effective_labels and effective_annotations
    • Set the fields in the state based on the user's configuration
    • Add the fields to the ImportStateVerifyIgnore list. As the configuration is unaccessible when importing, these fields will be empty after importing.
  2. Add labels or annotations to acceptance tests for some DCL resources, which don't cover these filed in the tests. The tests for these fields already exist for most DCL resources having the labels fields.

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)


@modular-magician
Copy link
Collaborator

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

  • REPLACEME

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 ( 53 files changed, 957 insertions(+), 181 deletions(-))
Terraform Beta: Diff ( 54 files changed, 1010 insertions(+), 219 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

Missing test report

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

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

resource "google_assured_workloads_workload" "primary" {
  effective_labels = # value needed
}

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

resource "google_cloudbuild_worker_pool" "primary" {
  effective_annotations = # value needed
}

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

resource "google_cloudbuildv2_connection" "primary" {
  effective_annotations = # value needed
}

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

resource "google_cloudbuildv2_repository" "primary" {
  effective_annotations = # value needed
}

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

resource "google_clouddeploy_delivery_pipeline" "primary" {
  effective_annotations = # value needed
  effective_labels      = # value needed
}

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

resource "google_clouddeploy_target" "primary" {
  effective_annotations = # value needed
  effective_labels      = # value needed
}

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

resource "google_container_aws_cluster" "primary" {
  effective_annotations = # value needed
}

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

resource "google_container_aws_node_pool" "primary" {
  effective_annotations = # value needed
}

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

resource "google_container_azure_cluster" "primary" {
  effective_annotations = # value needed
}

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

resource "google_container_azure_node_pool" "primary" {
  effective_annotations = # value needed
}

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

resource "google_dataplex_asset" "primary" {
  effective_labels = # value needed
}

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

resource "google_dataplex_lake" "primary" {
  effective_labels = # value needed
}

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

resource "google_dataplex_zone" "primary" {
  effective_labels = # value needed
}

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

resource "google_dataproc_workflow_template" "primary" {
  effective_labels = # value needed
}

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

resource "google_eventarc_trigger" "primary" {
  effective_labels = # value needed
}

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

resource "google_network_connectivity_hub" "primary" {
  effective_labels = # value needed
}

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

resource "google_network_connectivity_spoke" "primary" {
  effective_labels = # value needed
}

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

resource "google_privateca_certificate_template" "primary" {
  effective_labels = # value needed
}

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

resource "google_recaptcha_enterprise_key" "primary" {
  effective_labels = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2921
Passed tests 2618
Skipped tests: 303
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
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 ( 54 files changed, 824 insertions(+), 184 deletions(-))
Terraform Beta: Diff ( 55 files changed, 877 insertions(+), 222 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2921
Passed tests 2615
Skipped tests: 303
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
TestAccFolderIamPolicy_basic|TestAccSpannerInstanceIamPolicy|TestAccCloudbuildWorkerPool_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccFolderIamPolicy_basic[Debug log]
TestAccSpannerInstanceIamPolicy[Debug log]
TestAccCloudbuildWorkerPool_basic[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\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

@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 ( 55 files changed, 831 insertions(+), 185 deletions(-))
Terraform Beta: Diff ( 56 files changed, 884 insertions(+), 223 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@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 ( 55 files changed, 909 insertions(+), 206 deletions(-))
Terraform Beta: Diff ( 56 files changed, 962 insertions(+), 244 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@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 ( 55 files changed, 890 insertions(+), 206 deletions(-))
Terraform Beta: Diff ( 56 files changed, 943 insertions(+), 244 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2921
Passed tests 2616
Skipped tests: 303
Affected tests: 2

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
TestAccDataprocWorkflowTemplate_basic|TestAccDataplexAsset_BasicAssetHandWritten

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataprocWorkflowTemplate_basic[Debug log]
TestAccDataplexAsset_BasicAssetHandWritten[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\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

@c2thorn
Copy link
Member

c2thorn commented Aug 9, 2023

Same here, can you add upgrade guide entries to the main branch?

@zli82016
Copy link
Member Author

Thanks for the reminder. Created the PR-8608 to add the first version of guide for labels. Will add more details to the guide with more PRs being pushed to the 5.0.0 branch.

@zli82016 zli82016 merged commit 5de4e81 into FEATURE-BRANCH-major-release-5.0.0 Aug 15, 2023
8 checks passed
@zli82016 zli82016 deleted the DCL-keyvaluelabels branch August 15, 2023 21:59
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