Skip to content

Conversation

@sfc-gh-mraba
Copy link
Contributor

@sfc-gh-mraba sfc-gh-mraba commented Oct 2, 2025

Pre-review checklist

  • I've confirmed that instructions included in README.md are still correct after my changes in the codebase.
  • I've added or updated automated unit tests to verify correctness of my new code.
  • I've added or updated integration tests to verify correctness of my new code.
  • I've confirmed that my changes are working by executing CLI's commands manually on MacOS.
  • I've confirmed that my changes are working by executing CLI's commands manually on Windows.
  • I've confirmed that my changes are up-to-date with the target branch.
  • I've described my changes in the release notes.
  • I've described my changes in the section below.
  • I've described my changes in the documentation.

Changes description

This PR introduces the Next Generation (NG) Configuration System - a complete rewrite of Snowflake CLI's configuration resolution mechanism that addresses critical issues in the legacy system.

What's New

Core Improvements:

  • Explicit 7-level precedence stack with predictable, deterministic ordering
  • Two-phase resolution model: File sources use connection-level replacement; overlay sources (env vars, CLI args) use field-level merging
  • Complete resolution history tracking for debugging configuration issues
  • Extensible architecture with clean abstractions for adding new configuration sources
  • Immutable, read-only sources - all configuration discovery is side-effect free

Key Benefits:

  • Debug exactly where each config value comes from using: snow helpers show-config-sources --verbose
  • Predictable precedence - consistent behavior across all configuration sources
  • Better troubleshooting with resolution chains and history export
  • Backward compatible via feature flag

How to Enable

Enable via environment variable:

export SNOWFLAKE_CLI_FEATURES_ALTERNATIVE_CONFIG_PROVIDER=true

Verify it's active:

snow helpers show-config-sources

Configuration Behavior

File-based sources use connection-level replacement (same as legacy system):

  • When connections.toml defines a connection, it completely replaces that connection from earlier files (e.g., ~/.snowsql/config)
  • Fields are NOT inherited between files
  • Environment variables and CLI arguments merge at the field level

This maintains the same behavior as the legacy system while providing better visibility into the resolution process.

@sfc-gh-mraba sfc-gh-mraba self-assigned this Oct 2, 2025
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-3 branch from 4fa5432 to 99a467d Compare October 7, 2025 07:33
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch from ccb6d2d to eea1e10 Compare October 7, 2025 07:33
@sfc-gh-mraba sfc-gh-mraba changed the title SNOW-2306184: config refactory entry point guarded by env SNOW-2306184: config-ng refactor Oct 9, 2025
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch 2 times, most recently from e37ca5a to d124bdf Compare October 10, 2025 13:34
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-3 branch from 99a467d to c32692c Compare October 13, 2025 06:57
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch from 64c1d39 to 43caa83 Compare October 13, 2025 06:58
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-3 branch from 68ccdbc to ee5e0ce Compare October 21, 2025 08:42
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch from a55db49 to 6d009be Compare October 21, 2025 08:42
@sfc-gh-mraba sfc-gh-mraba marked this pull request as ready for review October 21, 2025 08:43
@sfc-gh-mraba sfc-gh-mraba requested a review from a team as a code owner October 21, 2025 08:43
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-3 branch from ee5e0ce to 2484c26 Compare October 21, 2025 12:34
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch from 6d009be to 5a77b75 Compare October 21, 2025 12:34
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-3 branch from 2484c26 to 66356e5 Compare October 23, 2025 12:57
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch 2 times, most recently from 206dba0 to e092719 Compare October 23, 2025 19:41
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-3 branch from af729e4 to 304a27a Compare November 3, 2025 08:05
@sfc-gh-mraba sfc-gh-mraba force-pushed the SNOW-2306184-ng-config-support-4 branch from 8f8e7f0 to f665cb3 Compare November 3, 2025 08:06
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