Skip to content

Add new types KeyValueLabels and KeyValueAnnotations#8519

Merged
zli82016 merged 19 commits into
FEATURE-BRANCH-major-release-5.0.0from
labesl-mmv1
Aug 15, 2023
Merged

Add new types KeyValueLabels and KeyValueAnnotations#8519
zli82016 merged 19 commits into
FEATURE-BRANCH-major-release-5.0.0from
labesl-mmv1

Conversation

@zli82016

@zli82016 zli82016 commented Aug 2, 2023

Copy link
Copy Markdown
Member

Add the new type KeyValueLables and KeyValueAnnotations, which will trigger to add the field effective_labels or effective_annotaitons to the properties.

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
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 143 insertions(+), 7 deletions(-))
Terraform Beta: Diff ( 6 files changed, 291 insertions(+), 8 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 6 files changed, 151 insertions(+), 8 deletions(-))
Terraform Beta: Diff ( 6 files changed, 306 insertions(+), 13 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2922
Passed tests 2604
Skipped tests: 302
Affected tests: 16

Action taken

Found 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDataSourceComputeAddresses|TestAccBigQueryDataTable_bigtable|TestAccBigQueryDataset_bigqueryDatasetDefaultCollationSetExample|TestAccBigQueryDataset_bigqueryDatasetWithMaxTimeTravelHoursExample|TestAccBigQueryDataset_bigqueryDatasetCaseInsensitiveNamesExample|TestAccBigQueryDataset_storageBillModel|TestAccBigQueryDataset_regionalLocation|TestAccBigQueryDataset_access|TestAccBigQueryDataset_bigqueryDatasetAuthorizedDatasetExample|TestAccBigQueryDataset_withProvider5|TestAccBigQueryDataset_bigqueryDatasetBasicExample|TestAccBigQueryDataset_datasetWithContents|TestAccComputeAddress_networkTier_withLabels|TestAccComputeAddress_networkTier|TestAccComputeAddress_networkTier_withProvider5|TestAccBigQueryDataset_basic

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigQueryDataTable_bigtable[Debug log]
TestAccBigQueryDataset_withProvider5[Debug log]
TestAccComputeAddress_networkTier[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccBigQueryDataset_withProvider5[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:}}$
TestAccDataSourceComputeAddresses[Error message] [Debug log]
TestAccBigQueryDataset_bigqueryDatasetDefaultCollationSetExample[Error message] [Debug log]
TestAccBigQueryDataset_bigqueryDatasetWithMaxTimeTravelHoursExample[Error message] [Debug log]
TestAccBigQueryDataset_bigqueryDatasetCaseInsensitiveNamesExample[Error message] [Debug log]
TestAccBigQueryDataset_storageBillModel[Error message] [Debug log]
TestAccBigQueryDataset_regionalLocation[Error message] [Debug log]
TestAccBigQueryDataset_access[Error message] [Debug log]
TestAccBigQueryDataset_bigqueryDatasetAuthorizedDatasetExample[Error message] [Debug log]
TestAccBigQueryDataset_bigqueryDatasetBasicExample[Error message] [Debug log]
TestAccBigQueryDataset_datasetWithContents[Error message] [Debug log]
TestAccComputeAddress_networkTier_withLabels[Error message] [Debug log]
TestAccComputeAddress_networkTier_withProvider5[Error message] [Debug log]
TestAccBigQueryDataset_basic[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

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 7 files changed, 204 insertions(+), 44 deletions(-))
Terraform Beta: Diff ( 7 files changed, 359 insertions(+), 49 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@zli82016 zli82016 changed the title Add new types KeyValueLabels and KeyValueAnnotations [Will not merge]Add new types KeyValueLabels and KeyValueAnnotations Aug 2, 2023
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 9 files changed, 298 insertions(+), 48 deletions(-))
Terraform Beta: Diff ( 11 files changed, 596 insertions(+), 59 deletions(-))
TF Conversion: Diff ( 8 files changed, 253 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2925
Passed tests 2619
Skipped tests: 304
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
TestAccComputeAddress_networkTier_withLabels|TestAccBigQueryDataset_basic

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeAddress_networkTier_withLabels[Debug log]
TestAccBigQueryDataset_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
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 286 insertions(+), 48 deletions(-))
Terraform Beta: Diff ( 11 files changed, 597 insertions(+), 59 deletions(-))
TF Conversion: Diff ( 8 files changed, 253 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2927
Passed tests 2623
Skipped tests: 304
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 286 insertions(+), 48 deletions(-))
Terraform Beta: Diff ( 11 files changed, 597 insertions(+), 59 deletions(-))
TF Conversion: Diff ( 8 files changed, 253 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2931
Passed tests 2627
Skipped tests: 304
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@zli82016

zli82016 commented Aug 4, 2023

Copy link
Copy Markdown
Member Author

TestAccComputeAddress_networkTier_withProvider5 passed locally.

@zli82016 zli82016 requested a review from rileykarson August 4, 2023 17:15

@rileykarson rileykarson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Made a first pass! Can we target this against the 5.0.0 branch now that that exists?

Comment thread mmv1/api/resource.rb Outdated
Comment thread mmv1/api/resource.rb
Comment thread mmv1/api/type.rb Outdated
Comment thread mmv1/api/type.rb Outdated
Comment thread mmv1/api/type.rb Outdated
Comment thread mmv1/api/resource.rb Outdated
Comment thread mmv1/products/bigquery/Dataset.yaml Outdated
Comment thread mmv1/products/bigquery/Dataset.yaml Outdated
organize and group your datasets
default_from_api: true

**Note**: This field does not list all labels present on the resource in GCP.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here & others: Let's use the term "authoritative", since we use it in https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam (and all other IAM pages).

Something like: "This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effective_labels for all of the labels present on the resource.`

(effective_labels is output-only, so it's not entirely correct to call it authoritative)

Comment thread mmv1/templates/terraform/post_create/labels.erb Outdated
@zli82016 zli82016 changed the base branch from main to FEATURE-BRANCH-major-release-5.0.0 August 4, 2023 22:26
@zli82016

zli82016 commented Aug 4, 2023

Copy link
Copy Markdown
Member Author

Made a first pass! Can we target this against the 5.0.0 branch now that that exists?

Changed the base branch to 5.0.0

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 204 insertions(+), 47 deletions(-))
Terraform Beta: Diff ( 12 files changed, 395 insertions(+), 58 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 204 insertions(+), 47 deletions(-))
Terraform Beta: Diff ( 12 files changed, 395 insertions(+), 58 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2924
Passed tests 2619
Skipped tests: 305
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@zli82016 zli82016 changed the title [Will not merge]Add new types KeyValueLabels and KeyValueAnnotations Add new types KeyValueLabels and KeyValueAnnotations Aug 7, 2023
@zli82016 zli82016 requested a review from rileykarson August 7, 2023 16:48

@rileykarson rileykarson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No concerns on my end, but not reviewing to approve as I'm about to go OOO. Adding @c2thorn as reviewer as I'll be out and they're the likely reviewer for subsequent changes

Comment thread mmv1/api/resource.rb
end

def build_effective_labels_field(name, min_version)
description = "All of #{name} (key/value pairs)\

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be consistent w/ handwritten fields?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, it should. Will use this description for all of the effective_labels/effective_annotations field.

@rileykarson rileykarson requested a review from c2thorn August 7, 2023 20:31
@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 204 insertions(+), 47 deletions(-))
Terraform Beta: Diff ( 12 files changed, 395 insertions(+), 58 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field labels transitioned from optional+computed to optional google_bigquery_dataset - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 8 files changed, 204 insertions(+), 47 deletions(-))
Terraform Beta: Diff ( 12 files changed, 395 insertions(+), 58 deletions(-))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2924
Passed tests 2619
Skipped tests: 305
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@c2thorn

c2thorn commented Aug 9, 2023

Copy link
Copy Markdown
Member

Seems good on initial review. Can we get entries on the main branch for the 5.0.0 upgrade guide explaining any breaking changes and manual steps user's will need to take as they upgrade?

@zli82016

zli82016 commented Aug 10, 2023

Copy link
Copy Markdown
Member Author

Seems good on initial review. Can we get entries on the main branch for the 5.0.0 upgrade guide explaining any breaking changes and manual steps user's will need to take as they upgrade?

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 f390fc9 into FEATURE-BRANCH-major-release-5.0.0 Aug 15, 2023
@zli82016 zli82016 deleted the labesl-mmv1 branch August 15, 2023 19:45
zli82016 added a commit that referenced this pull request Aug 22, 2023
* Add new type KeyValueLabels

* Use KeyValueLabels in resource google_compute_address

* func access_path in type

* Add new type KeyValueAnnotations

* Add new type KeyValueAnnotations

* Fix the syntax error

* Modify descriptions for labels field

* Fix tests

* Only read labels fingerprint when set labels

* Remove version check

* Fix tgc

* Refactor code

* Remove logger

* New function properities_with_excluded

* Address comments

* Revert the TGC changes

* Fix rake syntax errors

* Fix the bug to set labels in the state

* Type transform
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