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 optional service account for scheduled queries #3405

Conversation

MartinNowak
Copy link
Contributor

@MartinNowak MartinNowak commented Apr 23, 2020

Release Note Template for Downstream PRs (will be copied)

* bigquery: added `service_account_name` field to `google_bigquery_data_transfer_config` resource

- https://cloud.google.com/bigquery/docs/release-notes#November_21_2019
- see [Try API](https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.transferConfigs/create) or [Discovery ](https://bigquerydatatransfer.googleapis.com/$discovery/rest?version=v1)
- the API does support PATCHing, but magic-modules doesn't really
  support setting the required update_mask for url_param_only, hence
  I marked this parameter as input for now (which will replace the
  resource on update)
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@danawillow, please review this PR or find an appropriate assignee.

@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, 17 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 3 files changed, 17 insertions(+), 2 deletions(-))

@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.

@danawillow danawillow self-assigned this Apr 23, 2020
@MartinNowak
Copy link
Contributor Author

Let me know if I can do sth. to solve that Google Cloud Build error, can't see the logs unfortunately.

@danawillow danawillow removed their assignment Apr 23, 2020
@danawillow danawillow self-requested a review April 23, 2020 19:20
@danawillow
Copy link
Contributor

This looks good to me. I added a changelog message and am rerunning cloud build, so that should be enough to resolve it.

I'm curious, what does the update mask look like that successfully updates the field? does it just set serviceAccount? I'm wondering whether I could make a quick fix to our templates that would get that parameter into the updatemask.

@MartinNowak
Copy link
Contributor Author

MartinNowak commented Apr 24, 2020

I'm curious, what does the update mask look like that successfully updates the field? does it just set serviceAccount?

Yes, it's just serviceAccountName and inserting that here works.
It's a bit atypical for the gcloud API to include such parameters in the query string (without returning it anywhere), hence there is no precedence.

I'm wondering whether I could make a quick fix to our templates that would get that parameter into the updatemask.

A hack around the issue would be to move all of the update_mask logic to a piece of custom code, but that seemed out of scope and less maintainable in the long-run.
How about we do a followup PR if you find a good extension point?

Copy link
Contributor

@danawillow danawillow left a comment

Choose a reason for hiding this comment

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

Follow-up PR sounds good. Can you add an example (which will become a test) that sets the new field?

@MartinNowak
Copy link
Contributor Author

MartinNowak commented Apr 26, 2020

I added a test-case that sets service_account_name @danawillow, though the query parameter is input only so has to be ignored for the ImportStateVerify.

@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 ( 4 files changed, 80 insertions(+), 5 deletions(-))
Terraform Beta: Diff ( 4 files changed, 80 insertions(+), 5 deletions(-))

@danawillow
Copy link
Contributor

Thanks @MartinNowak!

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.

4 participants