databricks-cli/cmd/bundle
Ilia Babanov ac80d3dfcb
Add verbose flag to the "bundle deploy" command (#1774)
## Changes
- Extract sync output logic from `cmd/sync` into `lib/sync`
- Add hidden `verbose` flag to the `bundle deploy` command, it's false
by default and hidden from the `--help` output
- Pass output handler to the `deploy/files/upload` mutator if the
verbose option is true

The was an idea to use in-place output overriding each past file sync
event in the output, bit that wont work for the extension, since it
doesn't display deploy logs in the terminal.

Example output:
```
~/tmp/defpy: ~/cli/cli bundle deploy --sync-progress
Building defpy...
Uploading defpy-0.0.1+20240917.112755-py3-none-any.whl...
Uploading bundle files to /Users/ilia.babanov@databricks.com/.bundle/defpy/dev/files...
Action: PUT: requirements-dev.txt, resources/defpy_pipeline.yml, pytest.ini, src/defpy/main.py, src/defpy/__init__.py, src/dlt_pipeline.ipynb, tests/main_test.py, src/notebook.ipynb, setup.py, resources/defpy_job.yml, .vscode/extensions.json, .vscode/settings.json, fixtures/.gitkeep, .vscode/__builtins__.pyi, README.md, .gitignore, databricks.yml
Uploaded tests
Uploaded resources
Uploaded fixtures
Uploaded .vscode
Uploaded src/defpy
Uploaded requirements-dev.txt
Uploaded .gitignore
Uploaded fixtures/.gitkeep
Uploaded src/defpy/__init__.py
Uploaded databricks.yml
Uploaded README.md
Uploaded setup.py
Uploaded .vscode/__builtins__.pyi
Uploaded .vscode/extensions.json
Uploaded src/dlt_pipeline.ipynb
Uploaded .vscode/settings.json
Uploaded resources/defpy_job.yml
Uploaded pytest.ini
Uploaded src/defpy/main.py
Uploaded tests/main_test.py
Uploaded resources/defpy_pipeline.yml
Uploaded src/notebook.ipynb
Initial Sync Complete
Deploying resources...
Updating deployment state...
Deployment complete!
```

Output example in the extension:
<img width="1843" alt="Screenshot 2024-09-19 at 11 07 48"
src="https://github.com/user-attachments/assets/0fafd095-cdc6-44b8-b482-27a38ada0330">


## Tests
Manually for the `sync` and `bundle deploy` commands + vscode extension
sync and deploy flows
2024-09-23 10:09:11 +00:00
..
debug Add `bundle debug terraform` command (#1294) 2024-04-02 12:56:27 +00:00
deployment Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
generate Fixed generated YAML missing 'default' for empty values (#1765) 2024-09-11 09:49:58 +00:00
utils Improve `bundle validate` output (#1532) 2024-07-01 09:01:10 +00:00
bundle.go Fix bundle documentation URL (#1399) 2024-04-25 11:25:26 +00:00
debug.go Add `bundle debug terraform` command (#1294) 2024-04-02 12:56:27 +00:00
deploy.go Add verbose flag to the "bundle deploy" command (#1774) 2024-09-23 10:09:11 +00:00
destroy.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
generate.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
init.go Clarify file format required for the `config-file` flag in `bundle init` (#1651) 2024-08-05 12:24:22 +00:00
init_test.go Make dbt-sql and default-sql templates public (#1463) 2024-06-04 08:57:13 +00:00
launch.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
run.go Reduce time until the prompt is shown for bundle run (#1727) 2024-09-21 06:36:47 +00:00
schema.go Make bundle JSON schema modular with `$defs` (#1700) 2024-09-10 13:55:18 +00:00
summary.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
sync.go Avoid multiple file tree traversals on bundle deploy (#1493) 2024-06-17 09:48:52 +00:00
test.go Make bundle loaders return diagnostics (#1319) 2024-03-28 10:32:34 +00:00
validate.go Print diagnostics in 'bundle deploy' (#1579) 2024-07-10 11:14:57 +00:00
variables.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00