diff --git a/acceptance/bundle/scripts/output.txt b/acceptance/bundle/scripts/output.txt index 8a1fa8409..2deedb0e7 100644 --- a/acceptance/bundle/scripts/output.txt +++ b/acceptance/bundle/scripts/output.txt @@ -42,28 +42,11 @@ from myscript.py 0 postbuild: hello stderr! Executing 'predeploy' script from myscript.py 0 predeploy: hello stdout! from myscript.py 0 predeploy: hello stderr! -Error: unable to parse response. 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: -``` -POST /api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/scripts/default/state/deploy.lock?overwrite=false -> * Host: -> * Accept: application/json -> * Authorization: REDACTED -> * Traceparent: 00-065d5ec735d5eae4dab651801abba98f-05acfeff8caffc7c-01 -> * User-Agent: cli/[DEV_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_deploy cmd-exec-id/[UUID] auth/pat -> { -> "AcquisitionTime": "2025-02-03T20:00:19.375383+01:00", -> "ID": "[UUID]", -> "IsForced": false, -> "User": "[USERNAME]" -> } -< HTTP/1.1 500 Internal Server Error -< * Content-Length: 16 -< * Content-Type: text/plain; charset=utf-8 -< * Date: Mon, 03 Feb 2025 19:00:19 GMT -< * X-Content-Type-Options: nosniff -< not implemented -< -``` +Error: unable to deploy to /Workspace/Users/[USERNAME]/.bundle/scripts/default/state as [USERNAME]. +Please make sure the current user or one of their groups is listed under the permissions of this bundle. +For assistance, contact the owners of this project. +They may need to redeploy the bundle to apply the new permissions. +Please refer to https://docs.databricks.com/dev-tools/bundles/permissions.html for more on managing permissions. Exit code: 1 diff --git a/acceptance/server_test.go b/acceptance/server_test.go index 67109d56c..d714bdcd2 100644 --- a/acceptance/server_test.go +++ b/acceptance/server_test.go @@ -1,7 +1,6 @@ package acceptance_test import ( - "errors" "net/http" "github.com/databricks/cli/libs/testserver" @@ -96,23 +95,19 @@ func AddHandlers(server *testserver.Server) { return "{}", http.StatusOK }) - server.Handle("GET /oidc/.well-known/oauth-authorization-server", func(r *http.Request) (any, error) { + server.Handle("GET /oidc/.well-known/oauth-authorization-server", func(r *http.Request) (any, int) { return map[string]string{ "authorization_endpoint": server.URL + "oidc/v1/authorize", "token_endpoint": server.URL + "/oidc/v1/token", - }, nil + }, http.StatusOK }) - server.Handle("POST /oidc/v1/token", func(r *http.Request) (any, error) { + server.Handle("POST /oidc/v1/token", func(r *http.Request) (any, int) { return map[string]string{ "access_token": "oauth-token", "expires_in": "3600", "scope": "all-apis", "token_type": "Bearer", - }, nil - }) - - server.Handle("POST /api/2.0/workspace-files/import-file/", func(r *http.Request) (any, error) { - return "{}", errors.New("not implemented") + }, http.StatusOK }) } diff --git a/acceptance/terraform/output.txt b/acceptance/terraform/output.txt index b25aef04b..6bdc809f6 100644 --- a/acceptance/terraform/output.txt +++ b/acceptance/terraform/output.txt @@ -1,17 +1,51 @@ >>> [TERRAFORM] init -no-color -get=false -Error: Failed to install provider - -Error while installing databricks/databricks v1.64.1: provider binary not -found: could not find executable file starting with -terraform-provider-databricks - - Initializing the backend... Initializing provider plugins... - Finding databricks/databricks versions matching "1.64.1"... - Installing databricks/databricks v1.64.1... +- Installed databricks/databricks v1.64.1 (unauthenticated) -Exit code: 1 +Terraform has created a lock file .terraform.lock.hcl to record the provider +selections it made above. Include this file in your version control repository +so that Terraform can guarantee to make the same selections by default when +you run "terraform init" in the future. + + +Warning: Incomplete lock file information for providers + +Due to your customized provider installation methods, Terraform was forced to +calculate lock file checksums locally for the following providers: + - databricks/databricks + + +To calculate additional checksums for another platform, run: + terraform providers lock -platform=linux_amd64 +(where linux_amd64 is the platform to generate) + +Terraform has been successfully initialized! + +You may now begin working with Terraform. Try running "terraform plan" to see +any changes that are required for your infrastructure. All Terraform commands +should now work. + +If you ever set or change modules or backend configuration for Terraform, +rerun this command to reinitialize your working directory. If you forget, other +commands will detect it and remind you to do so if necessary. + +>>> [TERRAFORM] plan -no-color +data.databricks_current_user.me: Reading... +data.databricks_current_user.me: Read complete after (redacted) [id=[USERID]] + +Changes to Outputs: + + username = "[USERNAME]" + +You can apply this plan to save these new output values to the Terraform +state, without changing any real infrastructure. + +───────────────────────────────────────────────────────────────────────────── + +Note: You didn't use the -out option to save this plan, so Terraform can't +guarantee to take exactly these actions if you run "terraform apply" now. diff --git a/libs/testdiff/replacement_test.go b/libs/testdiff/replacement_test.go index f5d08d81e..1b6c5fe2d 100644 --- a/libs/testdiff/replacement_test.go +++ b/libs/testdiff/replacement_test.go @@ -1,7 +1,6 @@ package testdiff import ( - "runtime" "testing" "github.com/stretchr/testify/assert" @@ -45,11 +44,3 @@ func TestReplacement_TemporaryDirectory(t *testing.T) { assert.Equal(t, "/tmp/.../tail", repls.Replace("/tmp/foo/bar/qux/tail")) } - -func TestReplacement_OS(t *testing.T) { - var repls ReplacementsContext - - PrepareReplaceOS(t, &repls) - - assert.Equal(t, "[OS]", repls.Replace(runtime.GOOS)) -} diff --git a/libs/testserver/server.go b/libs/testserver/server.go index 6ccd155ce..5e3efe1c5 100644 --- a/libs/testserver/server.go +++ b/libs/testserver/server.go @@ -2,8 +2,6 @@ package testserver import ( "encoding/json" - "errors" - "fmt" "io" "net/http" "net/http/httptest"