databricks-cli/libs/sync
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
..
testdata/sync-fileset Refactor change computation for sync (#785) 2023-10-03 13:47:46 +00:00
diff.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
diff_test.go Refactor change computation for sync (#785) 2023-10-03 13:47:46 +00:00
dirset.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
dirset_test.go Add directory tracking to sync (#425) 2023-06-12 11:44:00 +00:00
event.go Drain sync event channel before returning (#253) 2023-03-16 17:48:17 +01:00
event_test.go Add optional JSON output for sync command (#230) 2023-03-08 10:27:19 +01:00
output.go Add verbose flag to the "bundle deploy" command (#1774) 2024-09-23 10:09:11 +00:00
path.go Extend deployment mode support (#577) 2023-07-30 07:19:49 +00:00
path_test.go Remove base path checks during sync (#576) 2023-07-14 11:43:20 +02:00
snapshot.go Clean up unused code (#1502) 2024-06-18 14:14:27 +00:00
snapshot_state.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
snapshot_state_test.go Make fileset take optional list of paths to list (#1684) 2024-08-19 15:15:14 +00:00
snapshot_test.go Make fileset take optional list of paths to list (#1684) 2024-08-19 15:15:14 +00:00
sync.go Add verbose flag to the "bundle deploy" command (#1774) 2024-09-23 10:09:11 +00:00
sync_test.go Added test for negation pattern in sync include exclude section (#1637) 2024-07-31 13:42:23 +00:00
watchdog.go Pass through paths argument to libs/sync (#1689) 2024-08-19 15:41:02 +00:00