databricks-cli/bundle/phases
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
..
bind.go Enable gofumpt and goimports in golangci-lint (#1999) 2024-12-12 10:28:42 +01:00
build.go Split artifact cleanup into prepare step before build (#1618) 2024-07-24 09:13:49 +00:00
deploy.go Do not wait for app compute to start on `bundle deploy` (#2144) 2025-01-28 17:17:37 +00:00
deploy_test.go Add DABs support for Unity Catalog volumes (#1762) 2024-12-02 21:18:07 +00:00
destroy.go Enable perfsprint linter and apply autofix (#2071) 2025-01-07 10:49:23 +00:00
initialize.go Set bundle auth configuration in command context (#2195) 2025-01-29 11:02:08 +00:00
load.go Load bundle configuration from mutator (#1318) 2024-03-27 10:49:05 +00:00
phase.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00