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 resource tags to BigQuery Table #10455

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

wj-chen
Copy link
Member

@wj-chen wj-chen commented Apr 15, 2024

Adds support for resource tags to BigQuery Table.

Release Note Template for Downstream PRs (will be copied)

bigquery: added `resource_tags` field to `google_bigquery_table` resource

@github-actions github-actions bot requested a review from rileykarson April 15, 2024 22:46
Copy link

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

@rileykarson, 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-beta provider: Diff ( 2 files changed, 143 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 115
Passed tests: 103
Skipped tests: 11
Affected tests: 1

Click here to see the affected service packages
  • bigquery

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
TestAccBigQueryTable_ResourceTags

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

I verified the account has the appropriate permissions, so that error message is probably an effective 404 unless hierarchical permissions aren't getting respected here.

(I haven't taken a further look at the change itself yet)

@github-actions github-actions bot requested a review from rileykarson April 16, 2024 07:25
@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 ( 1 file changed, 4 insertions(+))
google-beta provider: Diff ( 2 files changed, 216 insertions(+))

@wj-chen
Copy link
Member Author

wj-chen commented Apr 16, 2024

I verified the account has the appropriate permissions, so that error message is probably an effective 404 unless hierarchical permissions aren't getting respected here.

(I haven't taken a further look at the change itself yet)

Thank you for checking the permissions! It turned out to be a race condition where resources were referenced before creation, which should be fixed by the newest commit.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 115
Passed tests: 103
Skipped tests: 11
Affected tests: 1

Click here to see the affected service packages
  • bigquery

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
TestAccBigQueryTable_ResourceTags

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Generally LGTM- one question on the deletion precondition before approving/merging, and a couple nits inline.

@@ -1809,6 +1840,18 @@ func resourceBigQueryTableDelete(d *schema.ResourceData, meta interface{}) error
if d.Get("deletion_protection").(bool) {
return fmt.Errorf("cannot destroy instance without setting deletion_protection=false and running `terraform apply`")
}
<% unless version == 'ga' -%>
if v, ok := d.GetOk("resource_tags"); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Does the API have this check / does it take a long time to report a failure? Otherwise, if the API will reject the call there's not much value in doing this clientside first, since this will save 1s / one API call AIUI.

I'm a little hesitant about just checking state here- Terraform will sometimes short-circuit delete calls so Terraform may have drifted from the real config. I'm not sure we ever drift from state though, it's been a bit since I knew all the rules.

Copy link
Member Author

@wj-chen wj-chen Apr 16, 2024

Choose a reason for hiding this comment

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

The deletion will go through actually, but what I discovered while debugging the VCR test failure is that if a table is deleted while having resource tags specified, it's impossible to delete the tag value resource, failing at "it's still has a binding". As a follow-up I'll reach out to our API team to discuss if the behavior should be fixed on the API-level.

@github-actions github-actions bot requested a review from rileykarson April 16, 2024 21:53
@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 ( 1 file changed, 5 insertions(+), 1 deletion(-))
google-beta provider: Diff ( 2 files changed, 209 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 115
Passed tests: 104
Skipped tests: 11
Affected tests: 0

Click here to see the affected service packages
  • bigquery

$\textcolor{green}{\textsf{All tests passed!}}$
View the build log

@wj-chen
Copy link
Member Author

wj-chen commented Apr 16, 2024

Generally LGTM- one question on the deletion precondition before approving/merging, and a couple nits inline.

Thanks for the review! The new revision is out. Hoping to get this merged before the release cut today.

@rileykarson rileykarson merged commit c896dbe into GoogleCloudPlatform:main Apr 16, 2024
14 checks passed
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request May 8, 2024
pawelJas pushed a commit to pawelJas/magic-modules that referenced this pull request May 16, 2024
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
Cheriit pushed a commit to Cheriit/magic-modules that referenced this pull request Jun 4, 2024
pcostell pushed a commit to pcostell/magic-modules that referenced this pull request Jul 16, 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