Skip to content

Conversation

@ashish10alex
Copy link
Contributor

@ashish10alex ashish10alex commented Aug 6, 2025

Fixes: #2000

Solution:

Update @google-cloud/bigquery to a newer version which supports service account impersonation. The version number (~7.1.1) was set from finding the maximum version of @google-cloud/bigquery such that current minimum Node JS version (16.6.0) does not need to be changed.

Tests

  1. Able to create .df-credentials.json after authenticating to service account to impersonate by running the following. Earlier to would throw an error: The incoming JSON object does not contain a client_email field
gcloud auth application-default login --impersonate-service-account=<service-account-here>
CleanShot 2025-08-06 at 16 15 31@2x
  1. Able to do dataform run with the impersonated service account
CleanShot 2025-08-06 at 16 17 02@2x CleanShot 2025-08-06 at 16 18 09@2x
  1. bazel test //core/... & ./scripts/lint passes

@ashish10alex ashish10alex requested a review from a team as a code owner August 6, 2025 15:25
@ashish10alex ashish10alex requested review from kolina and removed request for a team August 6, 2025 15:25
package.json Outdated
"@bazel/rollup": "^3.0.0",
"@bazel/typescript": "^3.0.0",
"@google-cloud/bigquery": "^5.6.0",
"@google-cloud/bigquery": "7.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it shouldn't be pinned to a specific version similar to other dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @kolina for the review. Using ^7.1.1 results in the following error when doing bazel run @nodejs//:yarn add @google-cloud/bigquery@^7.1.1

error @google-cloud/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.16.0"

However, we can use ~ to allow patch updates only (minor and major fixed). This installs without any issues. I have made this change in the lates commit.

Happy to change based on feedback. Trying a lower major version is another option.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ceridan, can you please take a look here?

@ashish10alex ashish10alex requested a review from kolina August 7, 2025 08:08
@kolina kolina requested a review from Ceridan August 8, 2025 00:16
Copy link
Contributor

@Ceridan Ceridan left a comment

Choose a reason for hiding this comment

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

Unfortunately, we need to put it on hold for a while. We cannot easily upgrade to @google-cloud/[email protected] because it is not available on our npm mirror at the moment.

Additionally, there is a an ongoing work to update the whole toolchain for Dataform which will make it possible to upgrade NodeJS version and other dependencies to up to date versions.

@wintermi
Copy link

wintermi commented Sep 3, 2025

Any further updates on when this will be merged?

@Ceridan
Copy link
Contributor

Ceridan commented Sep 5, 2025

Unfortunately, we cannot merge this right now. It is required some additional work on build toolchain upgrade, which allows us to upgrade all the dependencies. This work will most likely be done in Q4'2025.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataform CLI ignores impersonation

4 participants