databricks-cli/bundle/deploy
Denis Bilenko 0ad790e468
Properly read Git metadata when running inside workspace (#1945)
## Changes

Since there is no .git directory in Workspace file system, we need to
make an API call to api/2.0/workspace/get-status?return_git_info=true to
fetch git the root of the repo, current branch, commit and origin.

Added new function FetchRepositoryInfo that either looks up and parses
.git or calls remote API depending on env.

Refactor Repository/View/FileSet to accept repository root rather than
calculate it. This helps because:
- Repository is currently created in multiple places and finding the
repository root is becoming relatively expensive (API call needed).
- Repository/FileSet/View do not have access to current Bundle which is
where WorkplaceClient is stored.

## Tests

- Tested manually by running "bundle validate --json" inside web
terminal within Databricks env.
- Added integration tests for the new API.

---------

Co-authored-by: Andrew Nester <andrew.nester@databricks.com>
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2024-12-05 10:13:13 +00:00
..
files Properly read Git metadata when running inside workspace (#1945) 2024-12-05 10:13:13 +00:00
lock Show actionable errors for collaborative deployment scenarios (#1386) 2024-10-10 11:18:23 +00:00
metadata Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
terraform Add golangci-lint v1.62.2 (#1953) 2024-12-04 17:40:19 +00:00
filer.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state.go Add UUID to uniquely identify a deployment state (#1595) 2024-07-16 10:01:58 +00:00
state_pull.go Add paths field to bundle sync configuration (#1694) 2024-08-21 15:33:25 +00:00
state_pull_test.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
state_push.go Add an error if state files grow bigger than the export limit (#1795) 2024-10-02 13:53:24 +00:00
state_push_test.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00
state_test.go Make fileset take optional list of paths to list (#1684) 2024-08-19 15:15:14 +00:00
state_update.go Add UUID to uniquely identify a deployment state (#1595) 2024-07-16 10:01:58 +00:00
state_update_test.go Rename `RootPath` -> `BundleRootPath` (#1792) 2024-09-27 10:03:05 +00:00