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

allow bigquery job fields that reference resources in blocks to do so with one field #3519

Merged
merged 1 commit into from
May 18, 2020

Conversation

danawillow
Copy link
Contributor

@danawillow danawillow commented May 15, 2020

Release Note Template for Downstream PRs (will be copied)

bigquery: added ability for various `table_id` fields (and one `dataset_id` field) in `google_bigquery_job` to specify a relative path instead of just the table id

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 618 insertions(+), 293 deletions(-))
Terraform Beta: Diff ( 3 files changed, 618 insertions(+), 293 deletions(-))
TF Conversion: Diff ( 1 file changed, 80 insertions(+), 138 deletions(-))
TF OiCS: Diff ( 12 files changed, 428 insertions(+))

@danawillow
Copy link
Contributor Author

Ended up deciding to do out-of-sprint after talking to @jcanseco.

@jcanseco
Copy link
Member

jcanseco commented May 18, 2020

Hi @danawillow, would it also make sense to add a diff suppressor for table and dataset references?

That is, a diff suppressor that says that these three things are the same:

Case 1:

destination_table {
  table_id = "https://content-bigquery.googleapis.com/bigquery/v2/projects/myproject/datasets/mydataset/tables/mytable"
}

Case 2:

destination_table {
  table_id   = "projects/myproject/datasets/mydataset/tables/mytable"
}

Case 3:

destination_table {
  project_id = "myproject"
  dataset_id = "mydataset"
  table_id   = "mytable"
}

Please note that this is neither a blocker nor a pain for us.

I wanted to make sure that there is no diff between Case 1 and Case 2, but I managed to achieve that by patching our copy of the provider to use the compareSelfLinkRelativePaths suppressor for table_id for table references and dataset_id for the dataset reference.

I can upstream that change if you wish, but it does not handle Case 3, and I figure you may want to handle all three cases.

@danawillow
Copy link
Contributor Author

Sure, would you mind making that patch? We shouldn't need it for case 3 on the Terraform side because of the logic to set values in state in the format the user provided (which was why I omitted the DSF in the first place), but if you're able to repro a failure let me know and I can fix (or let you know how)

@jcanseco
Copy link
Member

jcanseco commented May 18, 2020

Ah gotcha, makes sense. And yes, of course, I can upstream my changes. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants