airbyte icon indicating copy to clipboard operation
airbyte copied to clipboard

Destination BigQuery: Enabling Application Default Credentials

Open marcelopio opened this issue 3 years ago • 3 comments
trafficstars

I need to refactor/create new integration tests to test this specific case, but want an opinion if this will be accepted first

What

Current implementation only accepts Service Accounts. For developers it is very desirable that we can login with Application Default Credentials (ADC) as documented at: https://cloud.google.com/sdk/gcloud/reference/auth/application-default

This enables developers to test connections on environments where they don't have access to a service account

How

Current solution specifically used Service Credentials class, the implementation just changes it to use GoogleCredentials generically.

Recommended reading order

  1. BigQueryDestination.java

🚨 User Impact 🚨

The impact is probably that it is not enforced to use just service credentials, probably creating a problem for system administrators. But I think this is for the benefit of developers who needs to test their ingestions in development environments where they don't have access to service credentials

Pre-merge Checklist

Updating a connector

Community member or Airbyter

  • [x] Grant edit access to maintainers (instructions)
  • [x] Secrets in the connector's spec are annotated with airbyte_secret
  • [ ] Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • [x] Code reviews completed
  • [ ] Documentation updated
    • [ ] Connector's README.md
    • [ ] Connector's bootstrap.md. See description and examples
    • [ ] Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • [x] PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • [ ] Create a non-forked branch based on this PR and test the below items on it
  • [ ] Build is successful
  • [ ] If new credentials are required for use in CI, add them to GSM. Instructions.
  • [ ] /test connector=connectors/<name> command is passing
  • [ ] New Connector version released on Dockerhub and connector version bumped by running the /publish command described here

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

marcelopio avatar Jul 18 '22 03:07 marcelopio

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 18 '22 03:07 CLAassistant

/test connector=connectors/destination-bigquery

:clock2: connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/2749584577 :white_check_mark: connectors/destination-bigquery https://github.com/airbytehq/airbyte/actions/runs/2749584577 Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 13      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    13      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     155      8    95%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         162     34    79%
normalization/transform_catalog/utils.py                             38      9    76%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         61     38    38%
normalization/transform_catalog/stream_processor.py                 570    377    34%
-------------------------------------------------------------------------------------
TOTAL                                                              1363    587    57%

Build Passed

Test summary info:

All Passed

marcosmarxm avatar Jul 27 '22 20:07 marcosmarxm

Because Bigquery is a GA destination @alexandr-shegeda can you do a final review to this contribution?

marcosmarxm avatar Jul 27 '22 21:07 marcosmarxm

@marcosmarxm could you proceed with publishing and merging this branch or do you need assistance?

alexandr-shegeda avatar Aug 01 '22 16:08 alexandr-shegeda

/publish connector=connectors/destination-bigquery

:clock2: Publishing the following connectors:
connectors/destination-bigquery
https://github.com/airbytehq/airbyte/actions/runs/2782848996

Connector Did it publish? Were definitions generated?
connectors/destination-bigquery :x: :x:

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

marcosmarxm avatar Aug 02 '22 14:08 marcosmarxm

Waiting for https://github.com/airbytehq/airbyte/pull/14801 to be merged and I'll update here.

marcosmarxm avatar Aug 02 '22 14:08 marcosmarxm

/publish connector=connectors/destination-bigquery

:clock2: Publishing the following connectors:
connectors/destination-bigquery
https://github.com/airbytehq/airbyte/actions/runs/2791197643

Connector Did it publish? Were definitions generated?
connectors/destination-bigquery :white_check_mark: :white_check_mark:

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

marcosmarxm avatar Aug 03 '22 17:08 marcosmarxm