Skip to content

[destination-bigquery] Removing excess permission requirements when dataset already exists - #39379

Merged
Edward Gao (edgao) merged 49 commits into
airbytehq:masterfrom
kabeer27:kabeer27/destination-bigquery-dataset-permission-fix
Jun 26, 2024
Merged

[destination-bigquery] Removing excess permission requirements when dataset already exists#39379
Edward Gao (edgao) merged 49 commits into
airbytehq:masterfrom
kabeer27:kabeer27/destination-bigquery-dataset-permission-fix

Conversation

@kabeer27

@kabeer27 kabeer27 commented Jun 10, 2024

Copy link
Copy Markdown
Contributor

What

Solves:
#39330

Currently if a bigquery dataset in the destination already exists, we don't require datasets.create permission.

How

Refactoring the code a little bit to remove redundant checks for create permissions

Review guide

User Impact

Users can provide less permissions to the service account for their prod deployments

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@kabeer27
kabeer27 requested a review from a team as a code owner June 10, 2024 19:38
@vercel

vercel Bot commented Jun 10, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 4:04pm

@CLAassistant

CLAassistant commented Jun 10, 2024

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
16 out of 17 committers have signed the CLA.

✅ alafanechere
✅ davinchia
✅ kabeer27
✅ roman-yermilov-gl
✅ Adorism
✅ rodireich
✅ evantahler
✅ edgao
✅ ChristoGrab
✅ lazebnyi
✅ tolik0
✅ anjay-goel
✅ theyueli
✅ marcosmarxm
✅ gisripa
✅ jnr0790
❌ cmm-airbyte
You have signed the CLA already but the status is still pending? Let us recheck it.

@kabeer27 kabeer27 changed the title [destination-bigquery] Removing excess permission requirements when d… [destination-bigquery] Removing excess permission requirements when dataset already exists Jun 10, 2024
@kabeer27
kabeer27 temporarily deployed to community-ci-auto June 10, 2024 19:39 — with GitHub Actions Inactive
@kabeer27
kabeer27 temporarily deployed to community-ci-auto June 10, 2024 19:39 — with GitHub Actions Inactive

@edgao Edward Gao (edgao) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be better to just delete the checkHasCreateAndDeleteDatasetRole method completely. check is already doing a getOrCreateDataset, which means:

  • if the dataset already exists, this validates our ability to see it
  • if the dataset doesn't already exist, this validates our ability to create it

So checkHasCreateAndDeleteDatasetRole is entirely redundant with the rest of check.

@kabeer27

Copy link
Copy Markdown
Contributor Author

I think it would be better to just delete the checkHasCreateAndDeleteDatasetRole method completely. check is already doing a getOrCreateDataset, which means:

  • if the dataset already exists, this validates our ability to see it
  • if the dataset doesn't already exist, this validates our ability to create it

So checkHasCreateAndDeleteDatasetRole is entirely redundant with the rest of check.

I'll remove that method entirely then, it did feel redundant but i assumed it might be throwing better error messages, but create permissions are also not mentioned in the docs so maybe just better to remove

@edgao Edward Gao (edgao) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit: 🚛

@kabeer27

Copy link
Copy Markdown
Contributor Author

I'm not sure about the merge process beyond this, anything required from my side? M. Marx (@marcosmarxm) Edward Gao (@edgao)

@marcosmarxm

Copy link
Copy Markdown
Contributor

kabeer27 one tests is failing, I'll check with Eduard and check what stpes are needed to fix them.

@edgao

Copy link
Copy Markdown
Contributor

ah, you should just delete this line

Arguments.of("nonBillableConfig", "Access Denied: BigQuery BigQuery: Streaming insert is not allowed in the free tier"));

the old test was doing an insertAll API call, which fails without a billing account.... but we never do that in reality (we either do a GCS copy, or create a bigquery WriteChannel). So this test case is entirely pointless.

@edgao

Copy link
Copy Markdown
Contributor

conflicts were from converting the connector code to kotlin + some cleanup in the changelog, I just copied your changes over to the kotlin files (and merged the changelog/metadata stuff)

@edgao
Edward Gao (edgao) merged commit ee1c21c into airbytehq:master Jun 26, 2024
Xiaohan Song (xiaohansong) pushed a commit that referenced this pull request Jul 9, 2024
…ataset already exists (#39379)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Augustin <augustin@airbyte.io>
Co-authored-by: davinchia <davinchia@users.noreply.github.com>
Co-authored-by: Roman Yermilov [GL] <86300758+roman-yermilov-gl@users.noreply.github.com>
Co-authored-by: Christo Grabowski <108154848+ChristoGrab@users.noreply.github.com>
Co-authored-by: Audrey Maldonado <audrey.maldonado@gmail.com>
Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Co-authored-by: Evan Tahler <evan@airbyte.io>
Co-authored-by: Rodi Reich Zilberman <867491+rodireich@users.noreply.github.com>
Co-authored-by: Edward Gao <edward.gao@airbyte.io>
Co-authored-by: Yue Li <61070669+theyueli@users.noreply.github.com>
Co-authored-by: Baz <oleksandr.bazarnov@globallogic.com>
Co-authored-by: Anatolii Yatsuk <35109939+tolik0@users.noreply.github.com>
Co-authored-by: Anjay Goel <anjay.goel@gmail.com>
Co-authored-by: Natik Gadzhi <natik@respawn.io>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Co-authored-by: Serhii Lazebnyi <53845333+lazebnyi@users.noreply.github.com>
Co-authored-by: lazebnyi <lazebnyi@users.noreply.github.com>
Co-authored-by: Cristina Mariscal <166420606+cmm-airbyte@users.noreply.github.com>
Co-authored-by: cristina.mariscal <cristina.mariscal@cristina.mariscal--MacBook-Pro---DFJ27FJFXX>
Co-authored-by: Juan <80164312+jnr0790@users.noreply.github.com>
Co-authored-by: alafanechere <alafanechere@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gireesh Sreepathi <gisripa@gmail.com>
Co-authored-by: Anton Karpets <anton.karpets@globallogic.com>
Co-authored-by: Serhii Lazebnyi <serhii.lazebnyi@globallogic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connectors Connector related issues area/documentation Improvements or additions to documentation community connectors/destination/bigquery team/destinations Destinations team's backlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.