Skip to content

Restore keyless GCP authentication in NVIDIA CI - #104

Closed
danielmawhirter wants to merge 1 commit into
mainfrom
dm-bigquery-credential-mode
Closed

danielmawhirter wants to merge 1 commit into
mainfrom
dm-bigquery-credential-mode

Conversation

@danielmawhirter

@danielmawhirter danielmawhirter commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Restore the intended keyless BigQuery/GCS CI path in NVIDIA/kumo-engine. The imported workflows still restricted Google authentication to kumo-ai/kumo, so NVIDIA jobs skipped OIDC and reached the stored-key fallback.

The original migration, kumo-ai/kumo #29915, replaced CI's stored GCP keys with GitHub OIDC and Workload Identity Federation. Update the repository guards and require federated ADC when KUMO_GCP_WORKLOAD_EXCHANGE_ENABLED is enabled, independently of the execution host, including IAM impersonation for restricted permission tests. Missing ADC or stored-key credentials now fail explicitly. The existing local/deployment fallback is unchanged. The main test workflow selects gha-kumo-workflow-tests for GCP-enabled shards and azure-adls-tests otherwise, using the same repository, shard, and fork restrictions as the GCP test gate.

Change map

File-by-file change map.

Testing Done

  • All 31 focused credential tests pass and cover missing ADC, rejection of stored-key/user credentials with workload exchange enabled, host-independent selection, environment cleanup, and default → restricted → default impersonation without secret reads.
  • Changed-file flake8, isort, YAML lint, and whitespace checks pass.
  • Repository/environment variable names were inspected without printing values. The GCS and Snowflake workflow environment contains the required provider, project, and three service-account variables.
  • Live OIDC now executes, but Google authentication fails with unauthorized_client: “The given credential is rejected by the attribute condition.” Provider trust policy requires follow-up; its exact condition has not been inspected. No IAM changes were made, and credentialed integration tests remain unverified.

Hotfix Context

Not a hotfix or backport.

Checklist

  • I listed all the breaking changes introduced by the PR: Explicit workload-exchange mode rejects missing or non-federated ADC rather than using stored keys.
  • I made sure to update examples and documentation with my changes (if necessary): the helper explains its explicit workload-exchange requirement and existing unconfigured fallback.
  • I have added and modified unit tests required to cover changes made by this PR.

Environment selection passes actionlint (shellcheck disabled) and 48 routing cases, including fork exclusion. The five temporarily copied GCP variables were removed from azure-adls-tests; all other settings were preserved. GCP provider trust remains unresolved.

@danielmawhirter

danielmawhirter commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

Change map

NVIDIA's imported workflows still gated Google authentication on the former repository name. This skipped OIDC and exposed a stored-key fallback/identity-switch failure. Follow the original keyless migration in kumo-ai/kumo #29915: enable the intended CI path and prevent explicitly configured workload-exchange tests from silently loading stored keys. The local/deployment fallback remains unchanged. Scope ends at credential helper behavior and the three affected Google CI workflows; cloud IAM changes and unrelated provider migrations are excluded.

File Function / scope What changed Why
.github/workflows/testing.yml GCP authentication eligibility Updates the GCP repository guard to NVIDIA/kumo-engine and selects gha-kumo-workflow-tests for GCP-enabled shards; other shards retain azure-adls-tests. Preserves shard conditions and same-repository PR restrictions. The imported former-repository guard disabled Google authentication on NVIDIA jobs.
.github/workflows/testing_gcs.yml GCS/BigQuery integration authentication eligibility Selects NVIDIA/kumo-engine for GCP OIDC while retaining the same-repository PR restriction. Enables federated authentication for the intended integration workflow.
.github/workflows/testing_snowflake.yml GCP authentication for mixed provider shards Selects NVIDIA/kumo-engine for GCP OIDC while retaining the existing shard and same-repository PR restrictions. Mixed connector/REST/filesystem shards also require federated Google credentials.
kumo/testing/bigquery.py _configure_application_default_credentials, setup_bigquery_credentials Uses the existing explicit workload-exchange flag to require external-account ADC before selecting the default or restricted impersonated identity; preserves the unconfigured fallback. Prevents missing OIDC setup from silently reaching stored service-account keys in CI.
test/testing/test_bigquery_credentials.py Explicit credential selection and environment isolation Covers host-independent mode selection, missing/non-federated ADC rejection, identity transitions, and restoration of all helper-mutated environment variables. Verifies the intended keyless contract without cloud calls or secret reads.

All 31 focused credential tests pass, including rejected credentials and synchronous/asynchronous impersonation restoration after failure. Changed-file flake8, isort, YAML lint, and whitespace checks pass. Live OIDC now executes, but the GCP provider rejects federation with unauthorized_client because the credential fails its attribute condition. Provider trust policy requires follow-up; its exact condition has not been inspected and no IAM changes were made. Credentialed integration tests remain unverified.

Environment selection passes actionlint (shellcheck disabled) and 48 routing cases, including fork exclusion. The five temporarily copied GCP variables were removed from azure-adls-tests; all other settings were preserved. GCP provider trust remains unresolved.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between b1af889 and 0f11287.

📒 Files selected for processing: 1
  • .github/workflows/testing.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

📝 Walkthrough

GitHub Actions workflows now select the GCP test environment for eligible runs in NVIDIA/kumo-engine. When workload exchange is enabled, BigQuery credential setup requires an existing ADC file with type external_account. When workload exchange is disabled, a missing ADC path still returns False. Tests cover ADC validation, credential retention, impersonation target selection, and restoration after synchronous or asynchronous failures.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to 0f112

The change is broadly mergeable, but credential loading retains a narrow path/provenance edge case that can select the wrong file or reuse helper-written credentials.

Pre-merge checks: Passed 2 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Change Map Design Review Inconclusive The required <!-- kumo-pr-change-map --> conversation comment is unavailable. The repository contains only the change-map template and review instructions; the PR description links to an external co… Provide the full marked conversation comment, or enable retrieval of PR conversation comments, then review its file rows and rationale against the five changed files and repository behavior.
Passed Passed checks: 2 passed
Check name Status Explanation
Pr Size Passed The pull request changes 5 files. This does not exceed the 40-file limit.
Public Resource Access Passed The pull request adds the repository reference NVIDIA/kumo-engine in three workflow files: .github/workflows/testing.yml:84,93, .github/workflows/testing_gcs.yml:53, and `.github/workflows/testi…
Full details: Public Resource Access

Explanation

The pull request adds the repository reference NVIDIA/kumo-engine in three workflow files: .github/workflows/testing.yml:84,93, .github/workflows/testing_gcs.yml:53, and .github/workflows/testing_snowflake.yml:53. Anonymous requests to https://github.com/NVIDIA/kumo-engine and the unauthenticated GitHub API returned HTTP 200. The removed kumo-ai/kumo references exist only on the base branch and are excluded by the check.

Full details: Change Map Design Review

Explanation

The required &lt;!-- kumo-pr-change-map --&gt; conversation comment is unavailable. The repository contains only the change-map template and review instructions; the PR description links to an external comment but does not include its Change map. The code diff is available, but it cannot establish whether each proposed change was necessary, correctly layered, minimally scoped, and supported by the required verification and stopping condition.

Resolution

Provide the full marked conversation comment, or enable retrieval of PR conversation comments, then review its file rows and rationale against the five changed files and repository behavior.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments: 2
test/testing/test_bigquery_credentials.py: 1

170-170: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Track GOOGLE_CREDENTIALS_JSON before invoking the helper.

monkeypatch already restores GOOGLE_APPLICATION_CREDENTIALS. However, setup_bigquery_credentials also writes the distinct GOOGLE_CREDENTIALS_JSON variable directly. This test does not register that variable, so it can point later connector calls to this test's credential file.

🐛 Suggested fix
         monkeypatch.delenv('GOOGLE_APPLICATION_CREDENTIALS', raising=False)
+        monkeypatch.delenv(
+            testing_bigquery.ENV_GOOGLE_CREDENTIALS_JSON, raising=False)
         monkeypatch.delenv(
             testing_bigquery.ENV_BIGQUERY_NO_TABLE_SERVICE_ACCOUNT, raising=False)
kumo/testing/bigquery.py: 1

61-64: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Do not use the pathname as proof that this helper owns the ADC file.

If an external service-account ADC exists at <cwd>/.google_credential.json, this branch treats it as helper-owned and falls back to a stored key. If the working directory changes after the helper writes the file, the helper-owned file no longer matches os.getcwd(). A restricted-key call can then select impersonation and fail when its target-account variable is absent.

Track credential provenance independently from the current pathname, and cover both cases in the credential-selection tests.

🧹 Nitpick comments: 1
test/testing/test_bigquery_credentials.py: 1

201-204: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Clarify the scope of the external ADC test.

test_external_service_account_adc writes a service_account file. For that type, BigQueryConnector._use_credentials calls from_json and does not read GOOGLE_IMPERSONATE_SERVICE_ACCOUNT. Therefore the restricted case can pass while the connector still uses the external service-account credentials.

If this test covers helper environment configuration only, state that in its name or docstring. If it covers restricted identity selection, exercise _use_credentials and assert the effective credential instead.


ℹ️ Review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 3100e71 and 57982bf.

📒 Files selected for processing: 2
  • kumo/testing/bigquery.py
  • test/testing/test_bigquery_credentials.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.

@danielmawhirter
danielmawhirter force-pushed the dm-bigquery-credential-mode branch from 57982bf to 8336f29 Compare October 22, 2026 19:20
@danielmawhirter
danielmawhirter temporarily deployed to gha-kumo-workflow-tests October 22, 2026 19:21 — with GitHub Actions Inactive
@danielmawhirter danielmawhirter changed the title Preserve stored BigQuery test identities after ADC setup Restore keyless GCP authentication in NVIDIA CI Oct 22, 2026
@danielmawhirter
danielmawhirter force-pushed the dm-bigquery-credential-mode branch from 8336f29 to b2d1cba Compare October 22, 2026 19:35
@danielmawhirter
danielmawhirter temporarily deployed to gha-kumo-workflow-tests October 22, 2026 19:35 — with GitHub Actions Inactive

@aaron-kumo aaron-kumo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the fix!

Comment thread kumo/testing/bigquery.py Outdated
"""
credentials_path = os.getenv('GOOGLE_APPLICATION_CREDENTIALS')
if not credentials_path or not os.path.exists(credentials_path):
if os.getenv('GITHUB_ACTIONS') == 'true':

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we decouple the auth mode from where/how the tests run?

E.g. KUMO_GCP_TEST_AUTH_MODE=wif

testing_bigquery.setup_bigquery_credentials()


def test_ci_switches_impersonation(monkeypatch, tmp_path, ci_credentials):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] New tests leak credential configuration. test_ci_switches_impersonation

This calls a helper that directly writes GOOGLE_CREDENTIALS_JSON, but never registers that variable with monkeypatch. That can contaminate later connector tests. Restore every environment variable the helper mutates through a shared fixture.

@danielmawhirter
danielmawhirter force-pushed the dm-bigquery-credential-mode branch from b2d1cba to b1af889 Compare October 22, 2026 20:49
@danielmawhirter
danielmawhirter temporarily deployed to gha-kumo-workflow-tests October 22, 2026 20:49 — with GitHub Actions Inactive
@danielmawhirter

Copy link
Copy Markdown
Collaborator Author

Superseded by #224 (minimal NVIDIA GCP CI enablement) and #225 (explicit, scoped test credentials), following the GCP provider trust update. Those changes preserve the useful authentication and lifecycle fixes without enabling GCP login in the Snowflake workflow. Closing this earlier approach; no separate follow-up from this PR is needed.

This branch was previously deployed

1 inactive deployment
gha-kumo-workflow-tests — 0f112879 Deployed Oct 22, 2026 by danielmawhirter via import #661
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.

2 participants