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

refactor: update resource manager tag references #12118

Conversation

wyardley
Copy link
Contributor

@wyardley wyardley commented Oct 24, 2024

Update the code for handwritten / templated go tests to use foo.id vs "tagKeys/${foo.name}" or "tagValues/${foo.name}", and foo.namespaced_name vs. "${data.google_project.project.project_id}/${foo.short_name}"

This would be part 1: can update the resources for generated resources separately, and container_cluster will be covered in a separate PR.

Wrap map keys in parens where needed.

I tried to adjust spacing only in the affected blocks vs. doing any other terraform reformatting, except in one or two extreme cases.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


Update the code for go tests to use `foo.id` vs `"tagKeys/${foo.name}"`
or `"tagValues/${foo.name}"`, and `foo.namespaced_name` vs.
`"${data.google_project.project.project_id}/${foo.short_name}"`
Part 1: can update generated resources separately, and container_cluster
is already covered in other PRs.

Wrap map keys in parens where needed.
Copy link

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.

@github-actions github-actions bot requested a review from slevenick October 24, 2024 18:33
@modular-magician modular-magician added awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests service/terraform and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Oct 24, 2024
@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 ( 8 files changed, 80 insertions(+), 80 deletions(-))
google-beta provider: Diff ( 13 files changed, 101 insertions(+), 101 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 1207
Passed tests: 1122
Skipped tests: 83
Affected tests: 2

Click here to see the affected service packages
  • bigquery
  • compute
  • tags
  • workstations

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
  • TestAccBigQueryDataset_bigqueryDatasetResourceTags_update
  • TestAccWorkstationsWorkstationConfig_vmTags

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccBigQueryDataset_bigqueryDatasetResourceTags_update [Debug log]
TestAccWorkstationsWorkstationConfig_vmTags [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

@@ -4324,8 +4324,8 @@ resource "google_bigquery_table" "test" {
dataset_id = "${google_bigquery_dataset.test.dataset_id}"
table_id = "%{table_id}"
resource_tags = {
"%{project_id}/${google_tags_tag_key.key1.short_name}" = "${google_tags_tag_value.value1.short_name}"
"%{project_id}/${google_tags_tag_key.key2.short_name}" = "${google_tags_tag_value.value2.short_name}"
(google_tags_tag_key.key1.namespaced_name) = google_tags_tag_value.value1.short_name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: for these namespaced_name / short_name pairs, I _suspectthey would work with.id` on both side like in the other examples, but this makes the adjustments more minimal, as I believe it should be exactly equivalent with the old value.

If someone has a strong opinion about which is correct, they could easily be updated.

@slevenick slevenick merged commit 8717a60 into GoogleCloudPlatform:main Oct 25, 2024
13 checks passed
wyardley added a commit to wyardley/magic-modules that referenced this pull request Oct 25, 2024
Update resource manager tag references in formatting

Followup to GoogleCloudPlatform#12118
wyardley added a commit to wyardley/magic-modules that referenced this pull request Oct 25, 2024
Update resource manager tag references in terraform code templates and
some minor formatting changes

- Update the code to use foo.id vs "tagKeys/${foo.name}" or
  "tagValues/${foo.name}", and foo.namespaced_name vs.
  "${data.google_project.project.project_id}/${foo.short_name}"
- Wrap map keys in parens where needed.

Followup to GoogleCloudPlatform#12118
@wyardley wyardley deleted the wyardley/adjust_resource_manager_part1 branch October 25, 2024 17:10
wyardley added a commit to wyardley/magic-modules that referenced this pull request Oct 25, 2024
Update resource manager tag references in terraform code templates and
some minor formatting changes

- Update the code to use foo.id vs "tagKeys/${foo.name}" or
  "tagValues/${foo.name}", and foo.namespaced_name vs.
  "${data.google_project.project.project_id}/${foo.short_name}"
- Wrap map keys in parens where needed.

Followup to GoogleCloudPlatform#12118
wyardley added a commit to wyardley/magic-modules that referenced this pull request Oct 29, 2024
Update resource manager tag references in terraform code templates and
some minor formatting changes

- Update the code to use foo.id vs "tagKeys/${foo.name}" or
  "tagValues/${foo.name}", and foo.namespaced_name vs.
  "${data.google_project.project.project_id}/${foo.short_name}"
- Wrap map keys in parens where needed.

Followup to GoogleCloudPlatform#12118
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
amanMahendroo pushed a commit to amanMahendroo/magic-modules that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants