Skip to content

Add command_ci_auth_type telemetry field for CI/CD integrations#3128

Open
sfc-gh-olorek wants to merge 1 commit into
mainfrom
olorek/cicd-auth-type-telemetry
Open

Add command_ci_auth_type telemetry field for CI/CD integrations#3128
sfc-gh-olorek wants to merge 1 commit into
mainfrom
olorek/cicd-auth-type-telemetry

Conversation

@sfc-gh-olorek

@sfc-gh-olorek sfc-gh-olorek commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Pre-review checklist

  • If my changes add or modify user-facing interface (commands, flags, output formats), I consulted maintainers and got sign-off beforehand. — N/A: backend telemetry field only, no user-facing CLI surface.
  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code. — N/A: matches the existing command_ci_integration_version field, which is unit-tested only.
  • Manually tested on macOS — N/A: pure-Python env-var read, covered by unit tests.
  • Manually tested on Windows — N/A.
  • I've confirmed my changes are up-to-date with the target branch.
  • I've described my changes in RELEASE-NOTES.md. — not included for now; happy to add a "New additions" bullet if maintainers want one.
  • I've updated documentation if behavior changed. — N/A: no behavior/doc change.

Changes description

Adds a new command_ci_auth_type telemetry field that records the authentication type the official Snowflake CI/CD integrations configure, so we can measure OIDC adoption across CI/CD.

  • New CLITelemetryField.COMMAND_CI_AUTH_TYPE and helper _get_ci_auth_type() in src/snowflake/cli/_app/telemetry.py, wired into generate_telemetry_data_dict.
  • The value is read from the SF_CICD_AUTH_TYPE environment variable (lower-cased + trimmed), exactly mirroring the existing SF_CICD_INTEGRATION_VERSIONcommand_ci_integration_version mechanism. The integrations set it to oidc on their OIDC/workload-identity path; credential fallbacks the integration never configures leave it unset (empty string).
  • Open value vocabulary (oidc, key_pair, password, externalbrowser, oauth, programmatic_access_token) documented next to the helper; unknown values are recorded rather than dropped.
  • _get_ci_auth_type() is the single resolution point, so a later change can fall back to inferring the real authenticator from the resolved connection without touching the integrations or the field.

Companion PRs set SF_CICD_AUTH_TYPE=oidc in the integrations: snowflakedb/snowflake-actions#10, snowflakedb/snowflake-ado-extension#21, and the GitLab snowflake-cicd-component (MR !13). Those are forward-compatible and can merge in any order; this PR is the consumer that activates the signal.

Tests

hatch run pytest tests/app/test_telemetry.py — 59 passed (4 new: value-when-set, empty-when-unset, normalization, and end-to-end payload).

Record the authentication type the official Snowflake CI/CD integrations
configure (currently "oidc") in a new command_ci_auth_type telemetry
field, read from the SF_CICD_AUTH_TYPE environment variable. Mirrors the
existing SF_CICD_INTEGRATION_VERSION / command_ci_integration_version
pattern. _get_ci_auth_type() is the single resolution point so the value
set can later be extended (e.g. inferred from the resolved connection)
without changing the integrations.
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.

1 participant