Commit Graph

1373 Commits

Author SHA1 Message Date
Ilya Kuznetsov 66bf5f35c1
fix: Use warning instead of log in python wheel wrapper message 2024-11-20 11:48:52 +01:00
Ilya Kuznetsov 6a036d199a
Merge branch 'tmp/in-place-prototype' of github.com:databricks/cli into tmp/in-place-prototype 2024-11-20 11:39:46 +01:00
Ilya Kuznetsov eede522d87
Update bundle/config/presets.go
Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
2024-11-20 11:34:35 +01:00
Ilya Kuznetsov ddb68a76f2
fix: Update skip uploading log entry with more clear message 2024-11-20 11:33:09 +01:00
Ilya Kuznetsov aba35ae3fe fix: Replaced diag warning message with logger and removed unnecessary test 2024-11-19 22:08:45 +01:00
Ilya Kuznetsov 530a2a9bab
fix: Skipping path translation tests for windows 2024-11-19 13:33:02 +01:00
Ilya Kuznetsov 5d04569112
fix: Windows tests 2024-11-19 13:15:52 +01:00
Ilya Kuznetsov 8ee8de554b
test: Added path translation test cases for source-linked 2024-11-19 12:46:31 +01:00
Ilya Kuznetsov 5d09070fcb
fix: Cleanup 2024-11-19 11:50:28 +01:00
Ilya Kuznetsov 234d971790
fix: Cleanup in test 2024-11-19 11:47:57 +01:00
Ilya Kuznetsov 8c8fb35861
fix: Add explicit warning when using python wheel wrappers with source-linked deployment 2024-11-19 10:46:40 +01:00
Ilya Kuznetsov aeb9813d25
feat: Use path translations instead of overriding config 2024-11-19 10:40:16 +01:00
Ilya Kuznetsov 518aa14b64
Revert "fix: Skip permissions set and check for in-place"
This reverts commit 53e1f6df6a.
2024-11-18 22:32:36 +01:00
Ilya Kuznetsov 55f715dddf
fix: Broken test 2024-11-18 17:31:52 +01:00
Ilya Kuznetsov 1d7b27e0ef
feat: Rename "in-place" to "source-linked" 2024-11-18 17:21:33 +01:00
Ilya Kuznetsov e8825d559f
fix: Reuse existing `root` variable 2024-11-18 16:19:26 +01:00
Ilya Kuznetsov 00bb683be9
fix: Remove unnecessary fields in apply presets test 2024-11-18 16:13:14 +01:00
Ilya Kuznetsov 53e1f6df6a
fix: Skip permissions set and check for in-place 2024-11-18 16:05:21 +01:00
Ilya Kuznetsov e65b50cf3c
fix: Wrong condition 2024-11-18 12:22:14 +01:00
Ilya Kuznetsov 49f6bc9354
fix: Skipping in-place tests on Windows 2024-11-18 12:08:10 +01:00
Ilya Kuznetsov e7165ec17a
feat: Add Databricks Workspace conditions to dev mode setting. Add warning if conditions not met when preset is enabled by user 2024-11-18 11:58:56 +01:00
Ilya Kuznetsov 80ea3a05e3
fix: Move SyncRoot field to the top og the struct 2024-11-18 11:24:33 +01:00
Ilya Kuznetsov a3c6d571c8
fix: Use SyncRootPath 2024-11-18 11:11:44 +01:00
Ilya Kuznetsov e9b72895dc
test: Process target mode 2024-11-15 12:32:44 +01:00
Ilya Kuznetsov 8cd95eb0ea
test: Apply presets unit test 2024-11-15 12:09:53 +01:00
Ilya Kuznetsov 4cf692924c
fix: Missing root variable 2024-11-14 18:46:10 +01:00
Ilya Kuznetsov 51c8ef592c
fix: Applies autoformat 2024-11-14 18:38:31 +01:00
Ilya Kuznetsov 26f24538ee feat: Use dbr package for runtime check 2024-11-14 18:18:17 +01:00
Ilya Kuznetsov 0004ed27a7 Merge branch 'main' of github.com:databricks/cli into tmp/in-place-prototype 2024-11-14 18:12:34 +01:00
Pieter Noordhuis 1508d65c4c
Extract functionality to detect if the CLI is running on DBR (#1889)
## Changes

Whether or not the CLI is running on DBR can be detected once and stored
in the command's context.

By storing it in the context, it can easily be mocked for testing.

This builds on the simpler approach and conversation in #1744. It
unblocks testing of the DBR-specific paths while not compromising on the
checks we can perform to test if the CLI is running on DBR.

## Tests

* Unit tests for the new `dbr` package
* New unit test for the `ConfigureWSFS` mutator
2024-11-14 16:10:45 +00:00
Andrew Nester 2edfb6cfea
[Release] Release v0.234.0 (#1902)
Bundles:
* Do not execute build on bundle destroy
([#1882](https://github.com/databricks/cli/pull/1882)).
* Add support for non-Python ipynb notebooks to DABs
([#1827](https://github.com/databricks/cli/pull/1827)).

API Changes:
 * Added `databricks credentials` command group.
* Changed `databricks lakeview create` command with new required
argument order.

OpenAPI commit d25296d2f4aa7bd6195c816fdf82e0f960f775da (2024-11-07)
Dependency updates:
* Upgrade TF provider to 1.58.0
([#1900](https://github.com/databricks/cli/pull/1900)).
* Bump golang.org/x/sync from 0.8.0 to 0.9.0
([#1892](https://github.com/databricks/cli/pull/1892)).
* Bump golang.org/x/text from 0.19.0 to 0.20.0
([#1893](https://github.com/databricks/cli/pull/1893)).
* Bump golang.org/x/mod from 0.21.0 to 0.22.0
([#1895](https://github.com/databricks/cli/pull/1895)).
* Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0
([#1894](https://github.com/databricks/cli/pull/1894)).
* Bump github.com/databricks/databricks-sdk-go from 0.49.0 to 0.51.0
([#1878](https://github.com/databricks/cli/pull/1878)).
2024-11-14 14:38:52 +00:00
Pieter Noordhuis 21d27885dc
Upgrade TF provider to 1.58.0 (#1900)
## Changes

Notable changes:
* Adds support for `restart_window` for pipelines.
* Fix drift for pipelines where `catalog` contains uppercase characters.
* Better error message if single-node job clusters are incorrectly configured.

See:
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.58.0
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.57.0
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.56.0
* https://github.com/databricks/terraform-provider-databricks/releases/tag/v1.55.0

## Tests

Integration tests pass.
2024-11-14 14:00:15 +01:00
shreyas-goenka e1978fa429
Add support for non-Python ipynb notebooks to DABs (#1827)
## Changes

### Background

The workspace import APIs recently added support for importing Jupyter
notebooks written in R, Scala, or SQL, that is non-Python notebooks.
This now works for the `/import-file` API which we leverage in the CLI.

Note: We do not need any changes in `databricks sync`. It works out of
the box because any state mapping of local names to remote names that we
store is only scoped to the notebook extension (i.e., `.ipynb` in this
case) and is agnostic of the notebook's specific language.

### Problem this PR addresses

The extension-aware filer previously did not function because it checks
that a `.ipynb` notebook is written in Python. This PR relaxes that
constraint and adds integration tests for both the normal workspace
filer and extensions aware filer writing and reading non-Python `.ipynb`
notebooks.

This implies that after this PR DABs in the workspace / CLI from DBR
will work for non-Python notebooks as well. non-Python notebooks for
DABs deployment from local machines already works after the platform
side changes to the API landed, this PR just adds integration tests for
that bit of functionality.

Note: Any platform side changes we needed for the import API have
already been rolled out to production.

### Before

DABs deploy would work fine for non-Python notebooks. But DABs
deployments from DBR would not.

### After

DABs deploys both from local machines and DBR will work fine.

## Testing

For creating the `.ipynb` notebook fixtures used in the integration
tests I created them directly from the VSCode UI. This ensures high
fidelity with how users will create their non-Python notebooks locally.
For Python notebooks this is supported out of the box by VSCode but for
R and Scala notebooks this requires installing the Jupyter kernel for R
and Scala on my local machine and using that from VSCode.

For SQL, I ended up directly modifying the `language_info` field in the
Jupyter metadata to create the test fixture.

### Discussion: Issues with configuring language at the cell level

The language metadata for a Jupyter notebook is standardized at the
notebook level (in the `language_info` field). Unfortunately, it's not
standardized at the cell level. Thus, for example, if a user changes the
language for their cell in VSCode (which is supported by the standard
Jupyter VSCode integration), it'll cause a runtime error when the user
actually attempts to run the notebook. This is because the cell-level
metadata is encoded in a format specific to VSCode:
```
cells: []{
    "vscode": {
     "languageId": "sql"
    }
}
```

Supporting cell level languages is thus out of scope for this PR and can
be revisited along with the workspace files team if there's strong
customer interest.
2024-11-13 21:39:51 +00:00
dependabot[bot] 25838ee0af
Bump github.com/databricks/databricks-sdk-go from 0.49.0 to 0.51.0 (#1878)
Known issues:

- [ ] _(non-blocking with a command override)_ `apps.Update` requires 2
`name` params (one from path, one from request body)
- [ ] _(non-blocking)_ `lakeview.Create` does not require positional
argument `display_name` anymore because it's not marked as required in
request body

Bumps
[github.com/databricks/databricks-sdk-go](https://github.com/databricks/databricks-sdk-go)
from 0.49.0 to 0.51.0.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Nester <andrew.nester@databricks.com>
2024-11-13 13:40:53 +00:00
Ilya Kuznetsov b2164c0725
fix: Use SyncRootPath to allow using parent directories 2024-11-12 15:16:47 +01:00
Ilya Kuznetsov 6c1230889a
Merge branch 'main' of github.com:databricks/cli into tmp/in-place-prototype 2024-11-12 13:23:15 +01:00
Ilya Kuznetsov 5a22151580 feat: Move FilePath update to apply preset step 2024-11-12 09:58:36 +01:00
Ilya Kuznetsov a43f7ddad0 feat: Use global FilePath instead of locally overriden paths 2024-11-11 19:36:31 +01:00
dependabot[bot] f80ebe15f8
Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 (#1894)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from
0.23.0 to 0.24.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="22134a4103"><code>22134a4</code></a>
README: don't recommend go get</li>
<li>See full diff in <a
href="https://github.com/golang/oauth2/compare/v0.23.0...v0.24.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/oauth2&package-manager=go_modules&previous-version=0.23.0&new-version=0.24.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 11:58:19 +00:00
dependabot[bot] 1e1aaddfa4
Bump golang.org/x/mod from 0.21.0 to 0.22.0 (#1895)
Bumps [golang.org/x/mod](https://github.com/golang/mod) from 0.21.0 to
0.22.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="dec0365065"><code>dec0365</code></a>
sumdb: make data tiles by Server compatible with sum.golang.org</li>
<li><a
href="c8a7319721"><code>c8a7319</code></a>
x/mod: fix handling of vendored packages with '/vendor' in non-top-level
paths</li>
<li><a
href="9cd0e4c9f6"><code>9cd0e4c</code></a>
x/mod: remove vendor/modules.txt from module download</li>
<li>See full diff in <a
href="https://github.com/golang/mod/compare/v0.21.0...v0.22.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/mod&package-manager=go_modules&previous-version=0.21.0&new-version=0.22.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 11:42:54 +00:00
dependabot[bot] bc96872b18
Bump golang.org/x/text from 0.19.0 to 0.20.0 (#1893)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.19.0 to
0.20.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="efd25daf28"><code>efd25da</code></a>
go.mod: update golang.org/x dependencies</li>
<li><a
href="8a0e65e7b4"><code>8a0e65e</code></a>
README: don't recommend go get</li>
<li><a
href="fefda1abda"><code>fefda1a</code></a>
internal/texttest: remove Run and Bench helpers</li>
<li><a
href="a457f47ba2"><code>a457f47</code></a>
all: normalize subtest names to NFC</li>
<li>See full diff in <a
href="https://github.com/golang/text/compare/v0.19.0...v0.20.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/text&package-manager=go_modules&previous-version=0.19.0&new-version=0.20.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 11:42:07 +00:00
dependabot[bot] 6a28ae0bea
Bump golang.org/x/sync from 0.8.0 to 0.9.0 (#1892)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.8.0 to
0.9.0.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="151027eb56"><code>151027e</code></a>
README: don't recommend go get</li>
<li>See full diff in <a
href="https://github.com/golang/sync/compare/v0.8.0...v0.9.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/sync&package-manager=go_modules&previous-version=0.8.0&new-version=0.9.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-11 11:41:43 +00:00
Ilya Kuznetsov 086dfbc79d Merge branch 'main' of github.com:databricks/cli into tmp/in-place-prototype 2024-11-11 11:20:10 +01:00
Andrew Nester 162aa212bc
Do not execute build on bundle destroy (#1882)
## Changes
There's no value in building artifacts on destroy because they are just
removed from workspace as part of destroy.
2024-11-07 09:31:49 +00:00
Andrew Nester b6a376bf8a
[Release] Release v0.233.0 (#1886)
CLI:
* Clean host URL in the `auth login` command
([#1879](https://github.com/databricks/cli/pull/1879)).

Bundles:
* Fix bundle run when run interactively
([#1880](https://github.com/databricks/cli/pull/1880)).
* Fix relative path resolution for dashboards on Windows
([#1881](https://github.com/databricks/cli/pull/1881)).

Internal:
* Address goreleaser deprecation warning
([#1872](https://github.com/databricks/cli/pull/1872)).
* Update actions/github-script to v7
([#1873](https://github.com/databricks/cli/pull/1873)).
 * Use Go 1.23 ([#1871](https://github.com/databricks/cli/pull/1871)).
* [Internal] Always write message for manual integration test trigger
([#1874](https://github.com/databricks/cli/pull/1874)).
* Add `cmd-exec-id` to user agent
([#1808](https://github.com/databricks/cli/pull/1808)).
* Added E2E test to run Python wheels on interactive cluster created in
bundle ([#1864](https://github.com/databricks/cli/pull/1864)).


Dependency updates:
* Bump github.com/hashicorp/terraform-json from 0.22.1 to 0.23.0
([#1877](https://github.com/databricks/cli/pull/1877)).
2024-11-06 14:03:54 +00:00
Ilya Kuznetsov fbb9be9bdc
fix: Add SyncRoot mock to tests 2024-11-05 19:03:27 +01:00
Ilya Kuznetsov ae26beabfe Merge branch 'main' of github.com:databricks/cli into tmp/in-place-prototype 2024-11-05 18:13:27 +01:00
Ilya Kuznetsov 6b22fdebba Prototype for in-place deployments in DEV mode 2024-11-05 18:12:45 +01:00
shreyas-goenka b81008e2f6
Clean host URL in the `auth login` command (#1879)
## Changes
The host URL for databricks workspaces includes the workspaceId by
default as a positional arg. Eg:
https://e2-dogfood.staging.cloud.databricks.com/?o=1234

Thus a user can't simply copy paste the URL today to the auth login
command. They'll see a runtime error:
```
➜  cli git:(main) ✗ databricks auth login --host https://e2-dogfood.staging.cloud.databricks.com/\?o\=xxx --profile new-dg
Error: oidc: fetch .well-known: failed to unmarshal response body: invalid character '<' looking for beginning of value. This is likely a bug in the Databricks SDK for Go or the underlying REST API. Please report this issue with the following debugging information to the SDK issue tracker at https://github.com/databricks/databricks-sdk-go/issues. Request log:
GET /login.html
...
```

## Tests
Unit tests and manually. Now auth login works even when the workspace_id
is included in the URL.
2024-11-05 15:29:27 +00:00
Pieter Noordhuis 26afab2ccb
Fix relative path resolution for dashboards on Windows (#1881)
## Changes

The file presence check for dashboard files was missing a
`filepath.ToSlash`.

This means it didn't work on Windows unless the dashboard was located at
a path without slashes (i.e. the bundle root).

Closes #1875.

## Tests

* Added a unit test to cover this case (failed before the fix).
* Manually ran a dashboard deployment on Windows.
2024-11-05 09:53:53 +00:00