databricks-cli/cmd/root
Lennart Kats (databricks) a5b86093ec
Add a foundation for built-in templates (#685)
## Changes

This pull request extends the templating support in preparation of a
new, default template (WIP, https://github.com/databricks/cli/pull/686):
* builtin templates that can be initialized using e.g. `databricks
bundle init default-python`
* builtin templates are embedded into the executable using go's `embed`
functionality, making sure they're co-versioned with the CLI
* new helpers to get the workspace name, current user name, etc. help
craft a complete template
* (not enabled yet) when the user types `databricks bundle init` they
can interactively select the `default-python` template

And makes two tangentially related changes:
* IsServicePrincipal now uses the "users" API rather than the
"principals" API, since the latter is too slow for our purposes.
* mode: prod no longer requires the 'target.prod.git' setting. It's hard
to set that from a template. (Pieter is planning an overhaul of warnings
support; this would be one of the first warnings we show.)

The actual `default-python` template is maintained in a separate PR:
https://github.com/databricks/cli/pull/686

## Tests
Unit tests, manual testing
2023-08-25 09:03:42 +00:00
..
auth.go Add a foundation for built-in templates (#685) 2023-08-25 09:03:42 +00:00
bundle.go Add a foundation for built-in templates (#685) 2023-08-25 09:03:42 +00:00
bundle_test.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
io.go Remove dependency on global state for the root command (#606) 2023-07-26 11:17:09 +00:00
logger.go Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
progress_logger.go Remove dependency on global state for the root command (#606) 2023-07-26 11:17:09 +00:00
progress_logger_test.go Remove dependency on global state for the root command (#606) 2023-07-26 11:17:09 +00:00
root.go Renamed `environments` to `targets` in bundle configuration (#670) 2023-08-17 15:22:32 +00:00
user_agent.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
user_agent_command.go Move code for including command name in user agent (#203) 2023-02-15 10:33:35 +01:00
user_agent_command_test.go Move code for including command name in user agent (#203) 2023-02-15 10:33:35 +01:00
user_agent_upstream.go Rename: bricks -> databricks (#393) 2023-05-22 16:40:50 +02:00
user_agent_upstream_test.go Let caller set BRICKS_UPSTREAM for user agent (#196) 2023-02-03 17:05:58 +01:00