databricks-cli/cmd
shreyas-goenka 884b5f26ed
Set bundle auth configuration in command context (#2195)
## Changes

This change is required to enable tracking execution time telemetry for
bundle commands. In order to track execution time for the command
generally, we need to have the databricks auth configuration available
at this section of the code:


41bbd89257/cmd/root/root.go (L99)

In order to do this we can rely on the `configUsed` context key.   

Most commands rely on the `root.MustWorkspaceClient` function which
automatically sets the client config in the `configUsed` context key.
Bundle commands, however, do not do so. They instead store their
workspace clients in the `&bundle.Bundle{}` object.

With this PR, the `configUsed` context key will be set for all `bundle`
commands. Functionally nothing changes.

## Tests
Existing tests. Also manually verified that either
`root.MustConfigureBundle` or `utils.ConfigureBundleWithVariables` is
called for all bundle commands (except `bundle init`) thus ensuring this
context key would be set for all bundle commands.

refs for the functions:
1. `root.MustConfigureBundle`:
41bbd89257/cmd/root/bundle.go (L88)
2. `utils.ConfigureBundleWithVariables`:
41bbd89257/cmd/bundle/utils/utils.go (L19)

---------

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2025-01-29 11:02:08 +00:00
..
account Bump github.com/databricks/databricks-sdk-go from 0.55.0 to 0.56.1 (#2238) 2025-01-27 13:11:07 +00:00
api Bump github.com/databricks/databricks-sdk-go from 0.55.0 to 0.56.1 (#2238) 2025-01-27 13:11:07 +00:00
auth Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
bundle Refactor `bundle init` (#2074) 2025-01-20 12:09:28 +00:00
configure Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
fs Consolidate test helpers for `io/fs` (#1906) 2024-11-15 15:37:21 +00:00
labs libs/python: Remove DetectInterpreters (#2234) 2025-01-27 13:22:08 +00:00
root Set bundle auth configuration in command context (#2195) 2025-01-29 11:02:08 +00:00
sync Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
version Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
workspace Bump github.com/databricks/databricks-sdk-go from 0.55.0 to 0.56.1 (#2238) 2025-01-27 13:11:07 +00:00
cmd.go Fix duplicate "apps" entry in help output (#2191) 2025-01-20 16:02:29 +00:00