fix: avoid implicit bundle target for non-bundle auth resolution#4504
fix: avoid implicit bundle target for non-bundle auth resolution#4504jmahotiedu wants to merge 1 commit intodatabricks:mainfrom
Conversation
|
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
|
I just recently had a 1 hour troubleshooting session trying to figure out why an Azure SP could not login to a test environment when it worked in dev in my Github Workflow, when I finally realized it was not actually logging into test, but following the bundle's default environment. In my case I have a utility workflow script (running in a folder that also has DAB) that is doing non-bundle related items with CLI that was relying on my workflow's DATABRICKS_HOST env var. |
|
Thanks @NateWerner, this is exactly the real-world failure mode this PR is intended to fix. With this change, bundle auth is only used when @andrewnester if you have bandwidth, could you please approve workflow execution for #4504 so required checks can run? Happy to make any follow-up changes. |
## Summary
Stop loading bundle auth configuration implicitly in
MustWorkspaceClientunless--target/--environmentis explicitly set.Keep explicit target behavior unchanged so bundle context remains opt-in.
Add regression tests covering:
DATABRICKS_HOST.--targetstill uses bundle target host.## Problem
Fixes #4502. Non-bundle commands such as
databricks current-user mewere resolving authentication from the bundle’s default target when run inside a bundle directory, potentially overridingDATABRICKS_HOST.## Testing
go test ./cmd/root