databricks-cli/cmd
Andrew Nester 70fe0e36ef
Added `databricks bundle generate job` command (#1043)
## Changes
Now it's possible to generate bundle configuration for existing job.
For now it only supports jobs with notebook tasks.

It will download notebooks referenced in the job tasks and generate
bundle YAML config for this job which can be included in larger bundle.

## Tests
Running command manually

Example of generated config
```
resources:
  jobs:
    job_128737545467921:
      name: Notebook job
      format: MULTI_TASK
      tasks:
        - task_key: as_notebook
          existing_cluster_id: 0704-xxxxxx-yyyyyyy
          notebook_task:
            base_parameters:
              bundle_root: /Users/andrew.nester@databricks.com/.bundle/job_with_module_imports/development/files
            notebook_path: ./entry_notebook.py
            source: WORKSPACE
          run_if: ALL_SUCCESS
      max_concurrent_runs: 1
 ```

## Tests
Manual (on our last 100 jobs) + added end-to-end test

```
--- PASS: TestAccGenerateFromExistingJobAndDeploy (50.91s)
PASS
coverage: 61.5% of statements in ./...
ok github.com/databricks/cli/internal/bundle 51.209s coverage: 61.5% of
statements in ./...
```
2024-01-17 14:26:33 +00:00
..
account Always require path parameters as positional arguments (#1129) 2024-01-17 14:14:20 +00:00
api Update Go SDK to v0.19.0 (#729) 2023-09-05 09:43:57 +00:00
auth Ask for host when .databrickscfg doesn't exist (#1041) 2023-12-04 15:40:52 +00:00
bundle Added `databricks bundle generate job` command (#1043) 2024-01-17 14:26:33 +00:00
configure Filter out system clusters for `--configure-cluster` (#1031) 2023-11-30 09:59:11 +00:00
fs Fix windows style file paths in fs cp command (#1118) 2024-01-11 18:49:42 +00:00
labs Do not allow input prompts in Git Bash terminal (#1069) 2023-12-18 15:01:59 +00:00
root Always log with text format by default (#1096) 2024-01-03 09:39:33 +00:00
sync Tweak command groups in CLI help (#1092) 2023-12-28 13:14:55 +00:00
version Added description for version command (#737) 2023-09-06 08:41:47 +00:00
workspace Added `databricks bundle generate job` command (#1043) 2024-01-17 14:26:33 +00:00
cmd.go Add `databricks labs` command group (#914) 2023-11-17 12:47:37 +00:00