Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,8 @@ func runTest(t *testing.T,
cmd.Env = append(cmd.Env, "CLOUD_ENV_BASE="+envBase)

// Must be added PrepareReplacementsUser, otherwise conflicts with [USERNAME]
// UniqueUUID defaults to false: number distinct UUIDs only when a test opts in.
testdiff.PrepareReplacementsUUID(t, &repls, isTruePtr(config.UniqueUUID))
// UniqueUUID defaults to true: number distinct UUIDs unless the test opts out.
testdiff.PrepareReplacementsUUID(t, &repls, config.UniqueUUID == nil || *config.UniqueUUID)

// User replacements:
repls.Repls = append(repls.Repls, config.Repls...)
Expand Down
4 changes: 2 additions & 2 deletions acceptance/air/run-submit/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Stream logs after submission using:
}
}
],
"idempotency_token": "[UUID]",
"idempotency_token": "[UUID][0]",
"run_name": "submit-smoke",
"tasks": [
{
Expand Down Expand Up @@ -129,7 +129,7 @@ Stream logs after submission using:
}
}
],
"idempotency_token": "[UUID]",
"idempotency_token": "[UUID][1]",
"run_name": "b300-submit-smoke",
"tasks": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"browse_only": false,
"catalog_name": "main",
"catalog_type": "MANAGED_CATALOG",
"created_at": [UNIX_TIME_MILLIS][0],
"created_at": [UNIX_TIME_MILLIS],
"created_by": "[USERNAME]",
"enable_predictive_optimization": "INHERIT",
"full_name": "main.schema-[UNIQUE_NAME]",
"metastore_id": "[UUID]",
"metastore_id": "[UUID][0]",
"name": "schema-[UNIQUE_NAME]",
"owner": "[USERNAME]",
"schema_id": "[UUID]",
"updated_at": [UNIX_TIME_MILLIS][0],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did [0] disappear here?

"schema_id": "[UUID][1]",
"updated_at": [UNIX_TIME_MILLIS],
"updated_by": "[USERNAME]"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"browse_only": false,
"catalog_name": "main",
"catalog_type": "MANAGED_CATALOG",
"created_at": [UNIX_TIME_MILLIS][0],
"created_at": [UNIX_TIME_MILLIS],
"created_by": "[USERNAME]",
"enable_predictive_optimization": "INHERIT",
"full_name": "main.schema-[UNIQUE_NAME]",
"metastore_id": "[UUID]",
"metastore_id": "[UUID][0]",
"name": "schema-[UNIQUE_NAME]",
"owner": "[USERNAME]",
"schema_id": "[UUID]",
"updated_at": [UNIX_TIME_MILLIS][0],
"schema_id": "[UUID][1]",
"updated_at": [UNIX_TIME_MILLIS],
"updated_by": "[USERNAME]"
}

Expand Down
8 changes: 4 additions & 4 deletions acceptance/bundle/deploy/readplan/whl-upload/output.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

=== bundle deploy uploads the wheel
>>> [CLI] bundle deploy
Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl...
Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl...
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/whl-upload/default/files...
Created jobs.my_job
Files: 2 uploaded, 0 deleted
Expand All @@ -10,7 +10,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
>>> print_requests.py //artifacts/.internal --del-field raw_body
{
"method": "POST",
"path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/whl-upload/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl",
"path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/whl-upload/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl",
"q": {
"overwrite": "true"
}
Expand All @@ -26,7 +26,7 @@ Destroy: 1 deleted

=== bundle deploy --plan also uploads the wheel
>>> [CLI] bundle deploy --plan tmp.plan.json
Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl...
Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl...
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/whl-upload/default/files...
Created jobs.my_job
Files: 4 uploaded, 0 deleted
Expand All @@ -35,7 +35,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
>>> print_requests.py //artifacts/.internal --del-field raw_body
{
"method": "POST",
"path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/whl-upload/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl",
"path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/whl-upload/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl",
"q": {
"overwrite": "true"
}
Expand Down
10 changes: 5 additions & 5 deletions acceptance/bundle/dms/no-drift/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 1,
"features": {
"deployment_history": {}
Expand All @@ -47,7 +47,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"features": {
"deployment_history": {}
},
Expand Down Expand Up @@ -119,7 +119,7 @@ Resources: 0 created, 1 changed, 0 deleted, 1 unchanged
}
{
"method": "PUT",
"path": "/api/2.0/pipelines/[UUID]",
"path": "/api/2.0/pipelines/[UUID][1]",
"body": {
"catalog": "main",
"channel": "CURRENT",
Expand Down Expand Up @@ -177,7 +177,7 @@ Warning: The "development" property of pipelines is deprecated. Use "mode: devel
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 2,
"features": {
"deployment_history": {}
Expand All @@ -196,7 +196,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"features": {
"deployment_history": {}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

>>> [CLI] bundle deploy
Building my_test_code...
Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl...
Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl...
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/files...
Created jobs.some_other_job
Files: 13 uploaded, 0 deleted
Expand All @@ -10,7 +10,7 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
=== The environment dependency keeps its [train] extras suffix
>>> [CLI] jobs get [SOME_OTHER_JOB_ID]
[
"/Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS][0]-py3-none-any.whl[train]"
"/Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME]/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl[train]"
]

>>> [CLI] bundle run some_other_job
Expand Down
6 changes: 3 additions & 3 deletions acceptance/bundle/migrate/command/basic/out.new_state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"state_version": 3,
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 6,
"state": {
"resources.jobs.test_job": {
Expand Down Expand Up @@ -29,7 +29,7 @@
}
},
"resources.pipelines.test_pipeline": {
"__id__": "[UUID]",
"__id__": "[UUID][1]",
"state": {
"channel": "CURRENT",
"deployment": {
Expand All @@ -51,7 +51,7 @@
"myjob_timeout": "0",
"myvolume_id": "mycat.myschema.myvol",
"volume_catalog_name": "mycat",
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]"
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID][2]/volumes/[UUID][3]"
}
},
"depends_on": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": 4,
"terraform_version": "1.5.5",
"serial": 4,
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"outputs": {},
"resources": [
{
Expand Down Expand Up @@ -199,7 +199,7 @@
"filters": [],
"gateway_definition": [],
"health": null,
"id": "[UUID]",
"id": "[UUID][1]",
"ingestion_definition": [],
"last_modified": [UNIX_TIME_MILLIS],
"latest_updates": null,
Expand Down Expand Up @@ -233,19 +233,19 @@
"serverless": false,
"serverless_compute_id": null,
"state": "IDLE",
"storage": "dbfs:/pipelines/[UUID]",
"storage": "dbfs:/pipelines/[UUID][1]",
"tags": {
"myjob_id": "[TEST_JOB_ID]",
"myjob_name": "Test Migration Job",
"myjob_timeout": "0",
"myvolume_id": "mycat.myschema.myvol",
"volume_catalog_name": "mycat",
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]"
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID][2]/volumes/[UUID][3]"
},
"target": null,
"timeouts": null,
"trigger": [],
"url": "[DATABRICKS_URL]/#joblist/pipelines/[UUID]",
"url": "[DATABRICKS_URL]/#joblist/pipelines/[UUID][1]",
"usage_policy_id": null
},
"sensitive_attributes": [],
Expand Down Expand Up @@ -277,7 +277,7 @@
}
],
"schema_name": "myschema",
"storage_location": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]",
"storage_location": "s3://[METASTORE_NAME]/metastore/[UUID][2]/volumes/[UUID][3]",
"volume_path": "/Volumes/mycat/myschema/myvol",
"volume_type": "MANAGED"
},
Expand Down
20 changes: 10 additions & 10 deletions acceptance/bundle/migrate/command/basic/out.plan_update.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plan_version": [PLAN_VERSION],
"cli_version": "[CLI_VERSION]",
"lineage": "[UUID]",
"lineage": "[UUID][0]",
"serial": 6,
"plan": {
"resources.jobs.test_job": {
Expand Down Expand Up @@ -155,7 +155,7 @@
"myjob_timeout": "${resources.jobs.test_job.timeout_seconds}",
"myvolume_id": "mycat.myschema.myvol",
"volume_catalog_name": "mycat",
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]"
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID][1]/volumes/[UUID][2]"
}
},
"vars": {
Expand All @@ -171,7 +171,7 @@
},
"edition": "ADVANCED",
"effective_publishing_mode": "DEFAULT_PUBLISHING_MODE",
"id": "[UUID]",
"id": "[UUID][3]",
"last_modified": [UNIX_TIME_MILLIS][1],
"libraries": [
{
Expand All @@ -181,17 +181,17 @@
}
],
"name": "Test Migration Pipeline",
"pipeline_id": "[UUID]",
"pipeline_id": "[UUID][3]",
"run_as_user_name": "[USERNAME]",
"state": "IDLE",
"storage": "dbfs:/pipelines/[UUID]",
"storage": "dbfs:/pipelines/[UUID][3]",
"tags": {
"myjob_id": "[TEST_JOB_ID]",
"myjob_name": "Test Migration Job",
"myjob_timeout": "0",
"myvolume_id": "mycat.myschema.myvol",
"volume_catalog_name": "mycat",
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]"
"volume_storage_location": "s3://[METASTORE_NAME]/metastore/[UUID][1]/volumes/[UUID][2]"
}
},
"changes": {
Expand All @@ -204,7 +204,7 @@
"storage": {
"action": "skip",
"reason": "immutable_backend_value",
"remote": "dbfs:/pipelines/[UUID]"
"remote": "dbfs:/pipelines/[UUID][3]"
},
"tags['myjob_name']": {
"action": "update",
Expand All @@ -230,16 +230,16 @@
"name": "myvol",
"owner": "[USERNAME]",
"schema_name": "myschema",
"storage_location": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]",
"storage_location": "s3://[METASTORE_NAME]/metastore/[UUID][1]/volumes/[UUID][2]",
"updated_at": [UNIX_TIME_MILLIS][2],
"volume_id": "[UUID]",
"volume_id": "[UUID][2]",
"volume_type": "MANAGED"
},
"changes": {
"storage_location": {
"action": "skip",
"reason": "immutable_backend_value",
"remote": "s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]"
"remote": "s3://[METASTORE_NAME]/metastore/[UUID][1]/volumes/[UUID][2]"
}
}
}
Expand Down
26 changes: 13 additions & 13 deletions acceptance/bundle/migrate/command/basic/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ To undo the migration, remove [TEST_TMP_DIR]/.databricks/bundle/dev/resources.js
>>> diff out.original_state.json out.backup_state.json

>>> jq .state."resources.pipelines.test_pipeline".state.tags.volume_storage_location out.new_state.json
"s3://[METASTORE_NAME]/metastore/[UUID]/volumes/[UUID]"
"s3://[METASTORE_NAME]/metastore/[UUID][0]/volumes/[UUID][1]"

=== Should show that it's already migrated
>>> musterr [CLI] bundle deployment migrate
Error: already using direct engine
Details: [TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID]"
Details: [TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID][2]"

>>> DATABRICKS_BUNDLE_ENGINE=direct [CLI] bundle plan
Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
Expand All @@ -36,7 +36,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
{
"headers": {
"User-Agent": [
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_plan cmd-exec-id/[UUID] interactive/none engine/direct auth/pat"
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_plan cmd-exec-id/[UUID][3] interactive/none engine/direct auth/pat"
]
},
"method": "GET",
Expand All @@ -48,7 +48,7 @@ Plan: 0 to add, 0 to change, 0 to delete, 3 unchanged
{
"headers": {
"User-Agent": [
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_plan cmd-exec-id/[UUID] interactive/none engine/direct auth/pat"
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_plan cmd-exec-id/[UUID][4] interactive/none engine/direct auth/pat"
]
},
"method": "GET",
Expand All @@ -64,20 +64,20 @@ Files: 3 uploaded, 0 deleted
Resources: 0 created, 0 changed, 0 deleted, 3 unchanged

>>> print_requests.py --get //jobs/get
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_deploy cmd-exec-id/[UUID] interactive/none engine/direct auth/pat"
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_deploy cmd-exec-id/[UUID] interactive/none engine/direct auth/pat"
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_deploy cmd-exec-id/[UUID][5] interactive/none engine/direct auth/pat"
"cli/[CLI_VERSION] databricks-sdk-go/[SDK_VERSION] go/[GO_VERSION] os/[OS] cmd/bundle_deploy cmd-exec-id/[UUID][5] interactive/none engine/direct auth/pat"

=== Should show that it's already migrated
>>> musterr [CLI] bundle deployment migrate
Error: already using direct engine
Details: [TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID]"
Details: [TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID][2]"

>>> DATABRICKS_BUNDLE_ENGINE= [CLI] bundle debug states
[TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID]"
[TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID][2]"

>>> DATABRICKS_BUNDLE_ENGINE= [CLI] bundle debug states --force-pull
resources.json: remote direct state serial=6 lineage="[UUID]"
[TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID]"
resources.json: remote direct state serial=6 lineage="[UUID][2]"
[TEST_TMP_DIR]/.databricks/bundle/dev/resources.json: local direct state serial=6 lineage="[UUID][2]"

=== Extra plan: should have no drift
>>> DATABRICKS_BUNDLE_ENGINE= [CLI] bundle plan
Expand Down Expand Up @@ -105,8 +105,8 @@ Resources: 0 created, 2 changed, 0 deleted, 1 unchanged
>>> replay_tfstate.py .databricks/terraform-prod-requests.json .databricks/terraform-prod.tfstate -t prod

>>> DATABRICKS_BUNDLE_ENGINE= [CLI] bundle debug states -t prod
[TEST_TMP_DIR]/.databricks/bundle/prod/terraform/terraform.tfstate: local terraform state serial=5 lineage="[UUID]"
[TEST_TMP_DIR]/.databricks/bundle/prod/terraform/terraform.tfstate: local terraform state serial=5 lineage="[UUID][6]"

>>> DATABRICKS_BUNDLE_ENGINE= [CLI] bundle debug states -t prod --force-pull
terraform.tfstate: remote terraform state serial=5 lineage="[UUID]"
[TEST_TMP_DIR]/.databricks/bundle/prod/terraform/terraform.tfstate: local terraform state serial=5 lineage="[UUID]"
terraform.tfstate: remote terraform state serial=5 lineage="[UUID][6]"
[TEST_TMP_DIR]/.databricks/bundle/prod/terraform/terraform.tfstate: local terraform state serial=5 lineage="[UUID][6]"
Loading
Loading