fix: auth describe should not label DATABRICKS_CONFIG_PROFILE as from bundle#5904
Open
mvanhorn wants to merge 1 commit into
Open
fix: auth describe should not label DATABRICKS_CONFIG_PROFILE as from bundle#5904mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
…source Inside a bundle root the resolved config labels every attribute with the "bundle" source, so a profile selected via DATABRICKS_CONFIG_PROFILE was rendered as "(from bundle)" instead of "(from DATABRICKS_CONFIG_PROFILE environment variable)". Extend getAuthDetails to detect the env var, mirroring the flag > env precedence in cmd/root/bundle.go:getProfile. The value guard keeps genuine bundle-file profiles reading "(from bundle)". Closes databricks#2303 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01M1ZTEJFKv3BAW36VmBwe2v
Contributor
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
Approval status: pending
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
databricks auth describereports the wrong source for theprofileconfiguration attribute when run inside a bundle root while the profile was
selected via the
DATABRICKS_CONFIG_PROFILEenvironment variable. It renders(from bundle)instead of(from DATABRICKS_CONFIG_PROFILE environment variable).Fixes #2303.
Inside a bundle root,
Workspace.Config()(bundle/config/workspace.go) labelsevery resolved attribute with the
bundlesource, so a profile that actuallycame from the environment is misattributed.
getAuthDetailsalreadypost-processes attribute sources to correct the
--profileand--hostflagcases; this extends the
profilebranch to also detectDATABRICKS_CONFIG_PROFILE, following the same precedence ascmd/root/bundle.go'sgetProfile(an explicit--profileflag wins, then theenvironment variable). The env branch relabels only when the environment
variable equals the resolved profile value, so a profile set in
databricks.ymlstill reads
(from bundle)and flag precedence is preserved.Why
When debugging auth inside a bundle, the source label is the whole point of
auth describe: it tells you where a value came from. Attributing anenvironment-selected profile to the bundle is misleading and sends users
looking in the wrong place (
databricks.yml) for a value that came from theirshell.
Tests
Added an acceptance test under
acceptance/cmd/auth/describe/bundle-profile-env/that runsauth describeinside a bundle root with
DATABRICKS_CONFIG_PROFILEset and asserts theprofile renders
(from DATABRICKS_CONFIG_PROFILE environment variable)whilegenuine bundle attributes (host, timeouts) still render
(from bundle).go build ./...,go test ./cmd/auth/..., and the new acceptance test pass.Closes #2303