From f3e7c2d4216caec98d3b05d6ca7cf672a27c4bae Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 15:27:31 +0200 Subject: [PATCH 1/7] acc: Extract common replacements; add Order to [[Repls]] entries - Use common replacement for timestamps and numbers - Add Order property to [[Repls]]. Lowest Order is applied first. Default is 0. --- acceptance/acceptance_test.go | 7 --- .../bundle/artifacts/whl_dynamic/output.txt | 52 +++++++++--------- .../whl_prebuilt_outside_dynamic/output.txt | 20 +++---- .../deploy/experimental-python/output.txt | 2 +- .../deploy/fail-on-active-runs/output.txt | 2 +- .../deploy/jobs/check-metadata/test.toml | 4 -- .../bundle/deploy/mlops-stacks/test.toml | 4 -- .../deploy/pipeline/auto-approve/test.toml | 4 -- .../bundle/deploy/python-notebook/output.txt | 2 +- .../deployment/bind/experiment/test.toml | 4 -- .../destroy/jobs-and-pipeline/test.toml | 4 -- acceptance/bundle/integration_whl/test.toml | 8 --- acceptance/bundle/resources/jobs/output.txt | 6 +- .../bundle/resources/pipelines/output.txt | 2 +- .../bundle/resources/pipelines/test.toml | 4 -- acceptance/bundle/run/basic/output.txt | 8 +-- acceptance/bundle/run/basic/test.toml | 7 --- .../deploy-no-uuid/out.telemetry.txt | 2 +- .../telemetry/deploy-whl-artifacts/output.txt | 2 +- .../bundle/telemetry/deploy/out.telemetry.txt | 6 +- .../integration_classic/test.toml | 12 ++-- .../custom-template/out.requests.txt | 2 +- .../telemetry/dbt-sql/out.requests.txt | 2 +- .../telemetry/default-python/out.requests.txt | 2 +- .../telemetry/default-sql/out.requests.txt | 2 +- .../bundle/templates/telemetry/test.toml | 4 -- acceptance/bundle/test.toml | 4 -- acceptance/cmd/patchwhl/output.txt | 24 ++++---- .../METADATA | 2 +- .../RECORD | 10 ++-- acceptance/telemetry/failure/out.requests.txt | 6 +- acceptance/telemetry/failure/output.txt | 6 +- .../partial-success/out.requests.txt | 6 +- .../telemetry/partial-success/output.txt | 6 +- acceptance/telemetry/success/out.requests.txt | 2 +- acceptance/telemetry/success/output.txt | 2 +- acceptance/telemetry/test.toml | 4 -- acceptance/telemetry/timeout/out.requests.txt | 2 +- acceptance/telemetry/timeout/output.txt | 2 +- acceptance/test.toml | 55 +++++++++++++++++++ libs/testdiff/replacement.go | 14 ++++- libs/testdiff/replacement_test.go | 13 +++++ 42 files changed, 173 insertions(+), 159 deletions(-) delete mode 100644 acceptance/bundle/run/basic/test.toml diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index a64a83739d..df07f2772e 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -31,7 +31,6 @@ import ( "github.com/databricks/cli/internal/testutil" "github.com/databricks/cli/libs/auth" "github.com/databricks/cli/libs/testdiff" - "github.com/databricks/cli/libs/testserver" "github.com/databricks/cli/libs/utils" "github.com/stretchr/testify/require" ) @@ -472,12 +471,6 @@ func runTest(t *testing.T, // User replacements: repls.Repls = append(repls.Repls, config.Repls...) - // Apply these after user replacements in case user replacement capture something like "Job \d+" - for offset := range 5 { - repls.Set(strconv.Itoa(testserver.TestJobID+offset), fmt.Sprintf("[TEST_JOB_ID+%d]", offset)) - repls.Set(strconv.Itoa(testserver.TestRunID+offset), fmt.Sprintf("[TEST_RUN_ID+%d]", offset)) - } - // Save replacements to temp test directory so that it can be read by diff.py replsJson, err := json.MarshalIndent(repls.Repls, "", " ") require.NoError(t, err) diff --git a/acceptance/bundle/artifacts/whl_dynamic/output.txt b/acceptance/bundle/artifacts/whl_dynamic/output.txt index 419c92df8d..cdeb34df97 100644 --- a/acceptance/bundle/artifacts/whl_dynamic/output.txt +++ b/acceptance/bundle/artifacts/whl_dynamic/output.txt @@ -21,8 +21,8 @@ >>> [CLI] bundle deploy Building my_test_code... -Uploading .databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... -Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... +Uploading .databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS]-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/test-bundle/default/files... Deploying resources... Updating deployment state... @@ -30,8 +30,8 @@ Deployment complete! === There are 2 original wheels and 2 patched ones >>> find.py --expect 4 whl -.databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl -.databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl +.databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl +.databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl my_test_code/dist/my_test_code-0.0.1-py3-none-any.whl prebuilt/other_test_code-0.0.1-py3-none-any.whl @@ -39,11 +39,11 @@ prebuilt/other_test_code-0.0.1-py3-none-any.whl >>> find.py --expect 1 .databricks/.*my_test_code.*whl src/__init__.py src/__main__.py -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/METADATA -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/WHEEL -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/entry_points.txt -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/top_level.txt -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/METADATA +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/WHEEL +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/entry_points.txt +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/top_level.txt +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/RECORD === Expecting 2 patched wheels in libraries section in /jobs/create >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | .body.tasks out.requests.txt @@ -64,7 +64,7 @@ my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD "existing_cluster_id": "0717-132531-5opeqon1", "libraries": [ { - "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" } ], "python_wheel_task": { @@ -76,10 +76,10 @@ my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD }, "libraries": [ { - "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" }, { - "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" } ], "python_wheel_task": { @@ -92,16 +92,16 @@ my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD === Expecting 2 patched wheels to be uploaded >>> jq .path -"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" -"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" +"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" +"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/dist/my_test_code-0.0.1-py3-none-any.whl" "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/prebuilt/other_test_code-0.0.1-py3-none-any.whl" === Updating the local wheel and deploying again >>> [CLI] bundle deploy Building my_test_code... -Uploading .databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... -Uploading .databricks/bundle/default/patched_wheels/my_test_code_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... +Uploading .databricks/bundle/default/patched_wheels/my_prebuilt_whl_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS]-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/test-bundle/default/files... Deploying resources... Updating deployment state... @@ -112,11 +112,11 @@ Deployment complete! src/__init__.py src/__main__.py src/new_module.py -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/METADATA -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/WHEEL -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/entry_points.txt -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/top_level.txt -my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/METADATA +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/WHEEL +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/entry_points.txt +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/top_level.txt +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/RECORD === Expecting 2 patched wheels in libraries section in /jobs/reset >>> jq -s .[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks out.requests.txt @@ -137,7 +137,7 @@ my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD "existing_cluster_id": "0717-132531-5opeqon1", "libraries": [ { - "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" } ], "python_wheel_task": { @@ -149,10 +149,10 @@ my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD }, "libraries": [ { - "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" }, { - "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" } ], "python_wheel_task": { @@ -165,6 +165,6 @@ my_test_code-0.0.1+[TIMESTAMP_NS].dist-info/RECORD === Expecting 2 pached wheels to be uploaded (Bad: it is currently uploaded twice) >>> jq .path -"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" -"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" +"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" +"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/dist/my_test_code-0.0.1-py3-none-any.whl" diff --git a/acceptance/bundle/artifacts/whl_prebuilt_outside_dynamic/output.txt b/acceptance/bundle/artifacts/whl_prebuilt_outside_dynamic/output.txt index 806a1491ff..dc6c70a84f 100644 --- a/acceptance/bundle/artifacts/whl_prebuilt_outside_dynamic/output.txt +++ b/acceptance/bundle/artifacts/whl_prebuilt_outside_dynamic/output.txt @@ -1,7 +1,7 @@ >>> errcode [CLI] bundle deploy -Uploading this_dab/.databricks/bundle/default/patched_wheels/art1_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... -Uploading this_dab/.databricks/bundle/default/patched_wheels/art2_other_test_code/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... +Uploading this_dab/.databricks/bundle/default/patched_wheels/art1_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl... +Uploading this_dab/.databricks/bundle/default/patched_wheels/art2_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/python-wheel/default/files... Deploying resources... Updating deployment state... @@ -9,8 +9,8 @@ Deployment complete! === Expecting to find two patched wheels in current directory >>> find.py --expect 2 whl -.databricks/bundle/default/patched_wheels/art1_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl -.databricks/bundle/default/patched_wheels/art2_other_test_code/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl +.databricks/bundle/default/patched_wheels/art1_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl +.databricks/bundle/default/patched_wheels/art2_other_test_code/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl === Expecting 2 wheels in libraries section in /jobs/create >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | .body.tasks out.requests.txt @@ -27,10 +27,10 @@ Deployment complete! "existing_cluster_id": "0717-132531-5opeqon1", "libraries": [ { - "whl": "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" }, { - "whl": "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "whl": "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" } ], "python_wheel_task": { @@ -48,8 +48,8 @@ Deployment complete! "spec": { "client": "1", "dependencies": [ - "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl", - "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" + "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl", + "/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" ] } } @@ -57,5 +57,5 @@ Deployment complete! === Expecting 2 wheels to be uploaded >>> jq .path -"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" -"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/other_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl" +"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" +"/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/python-wheel/default/artifacts/.internal/other_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl" diff --git a/acceptance/bundle/deploy/experimental-python/output.txt b/acceptance/bundle/deploy/experimental-python/output.txt index 4160d6ecfe..9d2acc0924 100644 --- a/acceptance/bundle/deploy/experimental-python/output.txt +++ b/acceptance/bundle/deploy/experimental-python/output.txt @@ -8,7 +8,7 @@ Deployment complete! >>> [CLI] jobs list --output json [ { - "job_id": [TEST_JOB_ID+0], + "job_id": [NUMID], "settings": { "deployment": { "kind": "BUNDLE", diff --git a/acceptance/bundle/deploy/fail-on-active-runs/output.txt b/acceptance/bundle/deploy/fail-on-active-runs/output.txt index 79a13f0e10..b4ba46f998 100644 --- a/acceptance/bundle/deploy/fail-on-active-runs/output.txt +++ b/acceptance/bundle/deploy/fail-on-active-runs/output.txt @@ -6,7 +6,7 @@ Updating deployment state... Deployment complete! >>> errcode [CLI] bundle deploy --fail-on-active-runs -Error: job [TEST_JOB_ID+0] is running +Error: job [NUMID] is running Exit code: 1 diff --git a/acceptance/bundle/deploy/jobs/check-metadata/test.toml b/acceptance/bundle/deploy/jobs/check-metadata/test.toml index ec6d3abdde..844dc98bdd 100644 --- a/acceptance/bundle/deploy/jobs/check-metadata/test.toml +++ b/acceptance/bundle/deploy/jobs/check-metadata/test.toml @@ -12,7 +12,3 @@ Ignore = [ # C:/Program Files/Git/Users/$username/UNIQUE_NAME before passing it to the CLI # Setting this environment variable prevents that conversion on windows. MSYS_NO_PATHCONV = "1" - -[[Repls]] -Old = "[0-9]{12,}" -New = "[NUMID]" diff --git a/acceptance/bundle/deploy/mlops-stacks/test.toml b/acceptance/bundle/deploy/mlops-stacks/test.toml index 8a639c1084..f652b1cfe4 100644 --- a/acceptance/bundle/deploy/mlops-stacks/test.toml +++ b/acceptance/bundle/deploy/mlops-stacks/test.toml @@ -7,10 +7,6 @@ Ignore = [ "config.json" ] -[[Repls]] -Old = "[0-9]{12,}" -New = "[NUMID]" - [[Repls]] Old = '\\' New = '/' diff --git a/acceptance/bundle/deploy/pipeline/auto-approve/test.toml b/acceptance/bundle/deploy/pipeline/auto-approve/test.toml index 1024e554d4..e7b8c4f1f0 100644 --- a/acceptance/bundle/deploy/pipeline/auto-approve/test.toml +++ b/acceptance/bundle/deploy/pipeline/auto-approve/test.toml @@ -4,7 +4,3 @@ Cloud = true Ignore = [ "databricks.yml" ] - -[[Repls]] -Old = "[0-9]{3,}" -New = "[NUMID]" diff --git a/acceptance/bundle/deploy/python-notebook/output.txt b/acceptance/bundle/deploy/python-notebook/output.txt index 1df96b9184..7a9dfb67f5 100644 --- a/acceptance/bundle/deploy/python-notebook/output.txt +++ b/acceptance/bundle/deploy/python-notebook/output.txt @@ -8,7 +8,7 @@ Deployment complete! >>> [CLI] jobs list --output json [ { - "job_id": [TEST_JOB_ID+0], + "job_id": [NUMID], "settings": { "deployment": { "kind": "BUNDLE", diff --git a/acceptance/bundle/deployment/bind/experiment/test.toml b/acceptance/bundle/deployment/bind/experiment/test.toml index d7e2743263..3b8c14b4b8 100644 --- a/acceptance/bundle/deployment/bind/experiment/test.toml +++ b/acceptance/bundle/deployment/bind/experiment/test.toml @@ -2,10 +2,6 @@ Local = true Cloud = true BundleConfigTarget = "databricks.yml" -[[Repls]] -Old = "[0-9]{3,}" -New = "[NUMID]" - [[Server]] Pattern = "POST /api/2.0/mlflow/experiments/create" Response.Body = ''' diff --git a/acceptance/bundle/destroy/jobs-and-pipeline/test.toml b/acceptance/bundle/destroy/jobs-and-pipeline/test.toml index 2a56683772..29525776ea 100644 --- a/acceptance/bundle/destroy/jobs-and-pipeline/test.toml +++ b/acceptance/bundle/destroy/jobs-and-pipeline/test.toml @@ -7,10 +7,6 @@ Ignore = [ ".databricks/" ] -[[Repls]] -Old = "[0-9]{10,}" -New = "[NUMID]" - [[Repls]] Old = "[0-9a-z]{12,}" New = "[ALPHANUMID]" diff --git a/acceptance/bundle/integration_whl/test.toml b/acceptance/bundle/integration_whl/test.toml index f5e229d4be..e63bd17c83 100644 --- a/acceptance/bundle/integration_whl/test.toml +++ b/acceptance/bundle/integration_whl/test.toml @@ -12,11 +12,3 @@ Ignore = [ "python_wheel_wrapper.yml", "empty.yml", ] - -[[Repls]] -Old = '2\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' -New = "[TIMESTAMP]" - -[[Repls]] -Old = '\d{5,}' -New = "[NUMID]" diff --git a/acceptance/bundle/resources/jobs/output.txt b/acceptance/bundle/resources/jobs/output.txt index 3f2ea93c89..b28e1bd1af 100644 --- a/acceptance/bundle/resources/jobs/output.txt +++ b/acceptance/bundle/resources/jobs/output.txt @@ -39,7 +39,7 @@ Deployment complete! "method": "POST", "path": "/api/2.2/jobs/create" } -jobs foo id='[TEST_JOB_ID+0]' name='foo' +jobs foo id='[NUMID]' name='foo' === Update trigger.periodic.unit and re-deploy >>> update_file.py databricks.yml DAYS HOURS @@ -53,7 +53,7 @@ Deployment complete! >>> print_requests { "body": { - "job_id": [TEST_JOB_ID+0], + "job_id": [NUMID], "new_settings": { "deployment": { "kind": "BUNDLE", @@ -87,4 +87,4 @@ Deployment complete! "method": "POST", "path": "/api/2.2/jobs/reset" } -jobs foo id='[TEST_JOB_ID+0]' name='foo' +jobs foo id='[NUMID]' name='foo' diff --git a/acceptance/bundle/resources/pipelines/output.txt b/acceptance/bundle/resources/pipelines/output.txt index 98bcd61d83..dd448efaed 100644 --- a/acceptance/bundle/resources/pipelines/output.txt +++ b/acceptance/bundle/resources/pipelines/output.txt @@ -64,7 +64,7 @@ pipelines my id='[UUID]' name='test-pipeline-[UNIQUE_NAME]' >>> [CLI] pipelines get [UUID] { "creator_user_name":"[USERNAME]", - "last_modified":[TIMESTAMP_MS], + "last_modified":[UNIX_TIME_MILLIS], "name":"test-pipeline-[UNIQUE_NAME]", "pipeline_id":"[UUID]", "run_as_user_name":"[USERNAME]", diff --git a/acceptance/bundle/resources/pipelines/test.toml b/acceptance/bundle/resources/pipelines/test.toml index 1ab26f1002..9fb310ccba 100644 --- a/acceptance/bundle/resources/pipelines/test.toml +++ b/acceptance/bundle/resources/pipelines/test.toml @@ -1,6 +1,2 @@ Cloud = true Ignore = ["bar.py", "foo.py"] - -[[Repls]] -Old = '174\d{10}' -New = '[TIMESTAMP_MS]' diff --git a/acceptance/bundle/run/basic/output.txt b/acceptance/bundle/run/basic/output.txt index 5948000ccb..c599656aa3 100644 --- a/acceptance/bundle/run/basic/output.txt +++ b/acceptance/bundle/run/basic/output.txt @@ -13,9 +13,9 @@ Updating deployment state... Deployment complete! >>> [CLI] bundle run foo -Run URL: [DATABRICKS_URL]/job/run/[TEST_RUN_ID+0] +Run URL: [DATABRICKS_URL]/job/run/[NUMID] -[DATE] HH:MM:SS "run-name" TERMINATED +[TIMESTAMP] "run-name" TERMINATED === no resource key with -- >>> [CLI] bundle run -- @@ -25,9 +25,9 @@ Exit code: 1 === resource key with parameters >>> [CLI] bundle run foo -- arg1 arg2 -Run URL: [DATABRICKS_URL]/job/run/[TEST_RUN_ID+1] +Run URL: [DATABRICKS_URL]/job/run/[NUMID] -[DATE] HH:MM:SS "run-name" TERMINATED +[TIMESTAMP] "run-name" TERMINATED === inline script >>> [CLI] bundle run -- echo hello diff --git a/acceptance/bundle/run/basic/test.toml b/acceptance/bundle/run/basic/test.toml deleted file mode 100644 index fbd2506c39..0000000000 --- a/acceptance/bundle/run/basic/test.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[Repls]] -Old = "(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]" -New = "HH:MM:SS" - -[[Repls]] -Old = '20\d\d-\d\d-\d\d' -New = '[DATE]' diff --git a/acceptance/bundle/telemetry/deploy-no-uuid/out.telemetry.txt b/acceptance/bundle/telemetry/deploy-no-uuid/out.telemetry.txt index 0495c8c7ce..20b2d9eabd 100644 --- a/acceptance/bundle/telemetry/deploy-no-uuid/out.telemetry.txt +++ b/acceptance/bundle/telemetry/deploy-no-uuid/out.telemetry.txt @@ -27,7 +27,7 @@ "resource_dashboard_count": 0, "resource_app_count": 0, "resource_job_ids": [ - "[TEST_JOB_ID+0]" + "[NUMID]" ], "experimental": { "configuration_file_count": 1, diff --git a/acceptance/bundle/telemetry/deploy-whl-artifacts/output.txt b/acceptance/bundle/telemetry/deploy-whl-artifacts/output.txt index caf4396bdd..60a8d90849 100644 --- a/acceptance/bundle/telemetry/deploy-whl-artifacts/output.txt +++ b/acceptance/bundle/telemetry/deploy-whl-artifacts/output.txt @@ -8,7 +8,7 @@ Deployment complete! >>> [CLI] bundle deploy -t two Building test... -Uploading .databricks/bundle/two/patched_wheels/test_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... +Uploading .databricks/bundle/two/patched_wheels/test_my_test_code/my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl... Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/two/files... Deploying resources... Deployment complete! diff --git a/acceptance/bundle/telemetry/deploy/out.telemetry.txt b/acceptance/bundle/telemetry/deploy/out.telemetry.txt index f8e2530eac..ad614821d8 100644 --- a/acceptance/bundle/telemetry/deploy/out.telemetry.txt +++ b/acceptance/bundle/telemetry/deploy/out.telemetry.txt @@ -27,9 +27,9 @@ "resource_dashboard_count": 0, "resource_app_count": 0, "resource_job_ids": [ - "[TEST_JOB_ID+0]", - "[TEST_JOB_ID+1]", - "[TEST_JOB_ID+2]" + "[NUMID]", + "[NUMID]", + "[NUMID]" ], "resource_pipeline_ids": [ "[UUID]", diff --git a/acceptance/bundle/templates/default-python/integration_classic/test.toml b/acceptance/bundle/templates/default-python/integration_classic/test.toml index b9f908ff30..2e07eb2b07 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/test.toml +++ b/acceptance/bundle/templates/default-python/integration_classic/test.toml @@ -18,14 +18,10 @@ EnvMatrix.UV_PYTHON = [ EnvRepl.UV_PYTHON = true -[[Repls]] +#[[Repls]] # for some reason leading number is lost converting "%H%M%S" 061234 to 61234 -Old = '\d{5,}' -New = '[NUMBER]' - -[[Repls]] -Old = '20\d{6}.' -New = '[DATE]' +#Old = '\d{5,}' +#New = '[NUMBER]' [[Repls]] Old = 'Standard_D3_v2' @@ -41,5 +37,5 @@ Old = "python setup.py bdist_wheel" New = "python3 setup.py bdist_wheel" [[Repls]] -Old = '\?o=\[NUMBER\]' +Old = '\?o=\[NUMID\]' New = '' diff --git a/acceptance/bundle/templates/telemetry/custom-template/out.requests.txt b/acceptance/bundle/templates/telemetry/custom-template/out.requests.txt index f9365480e2..95b054c7dd 100644 --- a/acceptance/bundle/templates/telemetry/custom-template/out.requests.txt +++ b/acceptance/bundle/templates/telemetry/custom-template/out.requests.txt @@ -7,7 +7,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[CMD-EXEC-ID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"bundle_init\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"bundle_init_event\":{\"bundle_uuid\":\"[BUNDLE-UUID]\",\"template_name\":\"custom\"}}}}" diff --git a/acceptance/bundle/templates/telemetry/dbt-sql/out.requests.txt b/acceptance/bundle/templates/telemetry/dbt-sql/out.requests.txt index 9bbca9108c..b7616ccd3a 100644 --- a/acceptance/bundle/templates/telemetry/dbt-sql/out.requests.txt +++ b/acceptance/bundle/templates/telemetry/dbt-sql/out.requests.txt @@ -25,7 +25,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[CMD-EXEC-ID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"bundle_init\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"bundle_init_event\":{\"bundle_uuid\":\"[BUNDLE-UUID]\",\"template_name\":\"dbt-sql\",\"template_enum_args\":[{\"key\":\"personal_schemas\",\"value\":\"yes, use a schema based on the current user name during development\"}]}}}}" diff --git a/acceptance/bundle/templates/telemetry/default-python/out.requests.txt b/acceptance/bundle/templates/telemetry/default-python/out.requests.txt index 4c56c04578..f36603307e 100644 --- a/acceptance/bundle/templates/telemetry/default-python/out.requests.txt +++ b/acceptance/bundle/templates/telemetry/default-python/out.requests.txt @@ -25,7 +25,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[CMD-EXEC-ID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"bundle_init\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"bundle_init_event\":{\"bundle_uuid\":\"[BUNDLE-UUID]\",\"template_name\":\"default-python\",\"template_enum_args\":[{\"key\":\"include_dlt\",\"value\":\"no\"},{\"key\":\"include_notebook\",\"value\":\"yes\"},{\"key\":\"include_python\",\"value\":\"yes\"},{\"key\":\"serverless\",\"value\":\"no\"}]}}}}" diff --git a/acceptance/bundle/templates/telemetry/default-sql/out.requests.txt b/acceptance/bundle/templates/telemetry/default-sql/out.requests.txt index 5ff90d749e..314abb60d2 100644 --- a/acceptance/bundle/templates/telemetry/default-sql/out.requests.txt +++ b/acceptance/bundle/templates/telemetry/default-sql/out.requests.txt @@ -16,7 +16,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[CMD-EXEC-ID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"bundle_init\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"bundle_init_event\":{\"bundle_uuid\":\"[BUNDLE-UUID]\",\"template_name\":\"default-sql\",\"template_enum_args\":[{\"key\":\"personal_schemas\",\"value\":\"yes, automatically use a schema based on the current user name during development\"}]}}}}" diff --git a/acceptance/bundle/templates/telemetry/test.toml b/acceptance/bundle/templates/telemetry/test.toml index 5c9f47c792..1f4778acc9 100644 --- a/acceptance/bundle/templates/telemetry/test.toml +++ b/acceptance/bundle/templates/telemetry/test.toml @@ -1,10 +1,6 @@ RecordRequests = true IncludeRequestHeaders = ["User-Agent"] -[[Repls]] -Old = '17\d{11}' -New = '"UNIX_TIME_MILLIS"' - [[Repls]] Old = 'darwin|linux|windows' New = '[OS]' diff --git a/acceptance/bundle/test.toml b/acceptance/bundle/test.toml index c9e5922b88..bef5513866 100644 --- a/acceptance/bundle/test.toml +++ b/acceptance/bundle/test.toml @@ -3,7 +3,3 @@ Env.UV_PYTHON = "3.10" [BundleConfig.default_name] bundle.name = "test-bundle" - -[[Repls]] -Old = '1\d{18}' -New = '[TIMESTAMP_NS]' diff --git a/acceptance/cmd/patchwhl/output.txt b/acceptance/cmd/patchwhl/output.txt index 13f1f1dce9..905a403a0a 100644 --- a/acceptance/cmd/patchwhl/output.txt +++ b/acceptance/cmd/patchwhl/output.txt @@ -1,22 +1,22 @@ === Test prebuilt wheel: ->>> setmtime.py 2025-03-05 15:07:33.123456700 my_test_code-0.0.1-py3-none-any.whl +>>> setmtime.py [TIMESTAMP].[NUMID] my_test_code-0.0.1-py3-none-any.whl >>> [CLI] selftest patchwhl my_test_code-0.0.1-py3-none-any.whl -Warn: Patched whl: my_test_code-0.0.1-py3-none-any.whl -> my_test_code-0.0.1+1741187253123456700-py3-none-any.whl +Warn: Patched whl: my_test_code-0.0.1-py3-none-any.whl -> my_test_code-0.0.1+[UNIX_TIME_NANOS]-py3-none-any.whl >>> diff.py original output ---- original/my_test_code-0.0.1+1741187253123456700.dist-info/METADATA -+++ output/my_test_code-0.0.1+1741187253123456700.dist-info/METADATA +--- original/my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/METADATA ++++ output/my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/METADATA @@ -1,5 +1,5 @@ Metadata-Version: 2.1 Name: my-test-code -Version: 0.0.1 -+Version: 0.0.1+1741187253123456700 ++Version: 0.0.1+[UNIX_TIME_NANOS] Summary: my test wheel Home-page: https://databricks.com ---- original/my_test_code-0.0.1+1741187253123456700.dist-info/RECORD -+++ output/my_test_code-0.0.1+1741187253123456700.dist-info/RECORD +--- original/my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/RECORD ++++ output/my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/RECORD @@ -1,7 +1,7 @@ src/__init__.py,sha256=BRmKeYehopKv4NG_SFa7t6wn248RrPHJivu7DM1R-Rw,48 src/__main__.py,sha256=8TtsnLsaJEM35Y4L8ocrv-qfxusgYpRL2HPyYiabHng,242 @@ -25,8 +25,8 @@ Warn: Patched whl: my_test_code-0.0.1-py3-none-any.whl -> my_test_code-0.0.1+174 -my_test_code-0.0.1.dist-info/entry_points.txt,sha256=oDWOW9SsBlk4Uejj1ftYPBxfhJ5ZJctb4JOUIG1rc-4,34 -my_test_code-0.0.1.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4 -my_test_code-0.0.1.dist-info/RECORD,, -+my_test_code-0.0.1+1741187253123456700.dist-info/METADATA,sha256=H99P2vEwB_hBVPNtPwsXZotaDQzmWEGeSlOtMzWe62U,217 -+my_test_code-0.0.1+1741187253123456700.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92 -+my_test_code-0.0.1+1741187253123456700.dist-info/entry_points.txt,sha256=oDWOW9SsBlk4Uejj1ftYPBxfhJ5ZJctb4JOUIG1rc-4,34 -+my_test_code-0.0.1+1741187253123456700.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4 -+my_test_code-0.0.1+1741187253123456700.dist-info/RECORD,, ++my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/METADATA,sha256=H99P2vEwB_hBVPNtPwsXZotaDQzmWEGeSlOtMzWe62U,217 ++my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92 ++my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/entry_points.txt,sha256=oDWOW9SsBlk4Uejj1ftYPBxfhJ5ZJctb4JOUIG1rc-4,34 ++my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4 ++my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/RECORD,, diff --git a/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/METADATA b/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/METADATA index 2308a523da..76c3a64a40 100644 --- a/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/METADATA +++ b/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: my-test-code -Version: 0.0.1+1741187253123456700 +Version: 0.0.1+[UNIX_TIME_NANOS] Summary: my test wheel Home-page: https://databricks.com Author: Databricks diff --git a/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/RECORD b/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/RECORD index d7eb55dc1c..56678166ab 100644 --- a/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/RECORD +++ b/acceptance/cmd/patchwhl/output/my_test_code-0.0.1+1741187253123456700.dist-info/RECORD @@ -1,7 +1,7 @@ src/__init__.py,sha256=BRmKeYehopKv4NG_SFa7t6wn248RrPHJivu7DM1R-Rw,48 src/__main__.py,sha256=8TtsnLsaJEM35Y4L8ocrv-qfxusgYpRL2HPyYiabHng,242 -my_test_code-0.0.1+1741187253123456700.dist-info/METADATA,sha256=H99P2vEwB_hBVPNtPwsXZotaDQzmWEGeSlOtMzWe62U,217 -my_test_code-0.0.1+1741187253123456700.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92 -my_test_code-0.0.1+1741187253123456700.dist-info/entry_points.txt,sha256=oDWOW9SsBlk4Uejj1ftYPBxfhJ5ZJctb4JOUIG1rc-4,34 -my_test_code-0.0.1+1741187253123456700.dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4 -my_test_code-0.0.1+1741187253123456700.dist-info/RECORD,, +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/METADATA,sha256=H99P2vEwB_hBVPNtPwsXZotaDQzmWEGeSlOtMzWe62U,217 +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92 +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/entry_points.txt,sha256=oDWOW9SsBlk4Uejj1ftYPBxfhJ5ZJctb4JOUIG1rc-4,34 +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/top_level.txt,sha256=74rtVfumQlgAPzR5_2CgYN24MB0XARCg0t-gzk6gTrM,4 +my_test_code-0.0.1+[UNIX_TIME_NANOS].dist-info/RECORD,, diff --git a/acceptance/telemetry/failure/out.requests.txt b/acceptance/telemetry/failure/out.requests.txt index 95b21f5c3d..9e8ff398b6 100644 --- a/acceptance/telemetry/failure/out.requests.txt +++ b/acceptance/telemetry/failure/out.requests.txt @@ -7,7 +7,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", @@ -24,7 +24,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", @@ -41,7 +41,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", diff --git a/acceptance/telemetry/failure/output.txt b/acceptance/telemetry/failure/output.txt index 332563b74c..9af46a1f7e 100644 --- a/acceptance/telemetry/failure/output.txt +++ b/acceptance/telemetry/failure/output.txt @@ -9,7 +9,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 501 Not Implemented < { @@ -25,7 +25,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 501 Not Implemented < { @@ -41,7 +41,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 501 Not Implemented < { diff --git a/acceptance/telemetry/partial-success/out.requests.txt b/acceptance/telemetry/partial-success/out.requests.txt index 95b21f5c3d..9e8ff398b6 100644 --- a/acceptance/telemetry/partial-success/out.requests.txt +++ b/acceptance/telemetry/partial-success/out.requests.txt @@ -7,7 +7,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", @@ -24,7 +24,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", @@ -41,7 +41,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", diff --git a/acceptance/telemetry/partial-success/output.txt b/acceptance/telemetry/partial-success/output.txt index 483e32a0c8..ff97d4e6ab 100644 --- a/acceptance/telemetry/partial-success/output.txt +++ b/acceptance/telemetry/partial-success/output.txt @@ -9,7 +9,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 200 OK < { @@ -24,7 +24,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 200 OK < { @@ -39,7 +39,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 200 OK < { diff --git a/acceptance/telemetry/success/out.requests.txt b/acceptance/telemetry/success/out.requests.txt index 33155ac8c8..33e0c040eb 100644 --- a/acceptance/telemetry/success/out.requests.txt +++ b/acceptance/telemetry/success/out.requests.txt @@ -10,7 +10,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[CMD-EXEC-ID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", diff --git a/acceptance/telemetry/success/output.txt b/acceptance/telemetry/success/output.txt index e627523ee2..c029c43f48 100644 --- a/acceptance/telemetry/success/output.txt +++ b/acceptance/telemetry/success/output.txt @@ -9,7 +9,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < HTTP/1.1 200 OK < { diff --git a/acceptance/telemetry/test.toml b/acceptance/telemetry/test.toml index 04c202b488..574ffd3ce1 100644 --- a/acceptance/telemetry/test.toml +++ b/acceptance/telemetry/test.toml @@ -4,10 +4,6 @@ RecordRequests = true Local = true Cloud = false -[[Repls]] -Old = '17\d{11}' -New = '"UNIX_TIME_MILLIS"' - [[Repls]] Old = 'darwin|linux|windows' New = '[OS]' diff --git a/acceptance/telemetry/timeout/out.requests.txt b/acceptance/telemetry/timeout/out.requests.txt index d8260f5623..ca8f41c1db 100644 --- a/acceptance/telemetry/timeout/out.requests.txt +++ b/acceptance/telemetry/timeout/out.requests.txt @@ -7,7 +7,7 @@ "method": "POST", "path": "/telemetry-ext", "body": { - "uploadTime": "UNIX_TIME_MILLIS", + "uploadTime": [UNIX_TIME_MILLIS], "items": [], "protoLogs": [ "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":\"SMALL_INT\",\"exit_code\":0},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", diff --git a/acceptance/telemetry/timeout/output.txt b/acceptance/telemetry/timeout/output.txt index 5fec727698..19e2b8551f 100644 --- a/acceptance/telemetry/timeout/output.txt +++ b/acceptance/telemetry/timeout/output.txt @@ -9,7 +9,7 @@ HH:MM:SS Debug: POST /telemetry-ext > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)", > "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (N more bytes)" > ], -> "uploadTime": "UNIX_TIME_MILLIS" +> "uploadTime": [UNIX_TIME_MILLIS] > } < Error: Post "[DATABRICKS_URL]/telemetry-ext": context deadline exceeded pid=PID sdk=true HH:MM:SS Debug: non-retriable error: Post "[DATABRICKS_URL]/telemetry-ext": context deadline exceeded pid=PID sdk=true diff --git a/acceptance/test.toml b/acceptance/test.toml index 96b75baff6..8f8d580582 100644 --- a/acceptance/test.toml +++ b/acceptance/test.toml @@ -13,3 +13,58 @@ TimeoutCloud = '25m' Env.PYTHONDONTWRITEBYTECODE = "1" Env.PYTHONUNBUFFERED = "1" + +# >>> datetime.datetime.fromtimestamp(18000000000) +# datetime.datetime(2027, 1, 15, 9, 0) +# >>> datetime.datetime.fromtimestamp(1900000000) +# datetime.datetime(2030, 3, 17, 18, 46, 40) + +[[Repls]] +Old = '\d{20,}' +New = "[NUMID]" +Order = 10 + +[[Repls]] +Old = '1[78]\d{17}' +New = '[UNIX_TIME_NANOS]' +Order = 10 + +[[Repls]] +Old = '\d{17,}' +New = "[NUMID]" +Order = 10 + +[[Repls]] +Old = '1[78]\d{14}' +New = '[UNIX_TIME_MICROS]' +Order = 10 + +[[Repls]] +Old = '\d{14,}' +New = "[NUMID]" +Order = 10 + +[[Repls]] +Old = '1[78]\d{11}' +New = '[UNIX_TIME_MILLIS]' +Order = 10 + +[[Repls]] +Old = '\d{11,}' +New = "[NUMID]" +Order = 10 + +[[Repls]] +Old = '1[78]\d{8}' +New = '[UNIX_TIME_S]' +Order = 10 + +[[Repls]] +Old = '\d{8,}' +New = "[NUMID]" +Order = 10 + +[[Repls]] +Old = '2\d\d\d-\d\d-\d\d(T| )\d\d:\d\d:\d\d' +New = "[TIMESTAMP]" +Order = 10 diff --git a/libs/testdiff/replacement.go b/libs/testdiff/replacement.go index 61889b83ba..92ac2e6db3 100644 --- a/libs/testdiff/replacement.go +++ b/libs/testdiff/replacement.go @@ -6,6 +6,7 @@ import ( "regexp" "runtime" "slices" + "sort" "strings" "github.com/databricks/cli/internal/testutil" @@ -29,8 +30,9 @@ var ( ) type Replacement struct { - Old *regexp.Regexp - New string + Old *regexp.Regexp + New string + Order int } type ReplacementsContext struct { @@ -43,7 +45,13 @@ func (r *ReplacementsContext) Clone() ReplacementsContext { func (r *ReplacementsContext) Replace(s string) string { // QQQ Should probably only replace whole words - for _, repl := range r.Repls { + // Sort replacements stably by Order to guarantee deterministic application sequence. + // A cloned slice is used to avoid mutating the original order held in the context. + repls := slices.Clone(r.Repls) + sort.SliceStable(repls, func(i, j int) bool { + return repls[i].Order < repls[j].Order + }) + for _, repl := range repls { s = repl.Old.ReplaceAllString(s, repl.New) } return s diff --git a/libs/testdiff/replacement_test.go b/libs/testdiff/replacement_test.go index 1b6c5fe2d2..3587baf5e6 100644 --- a/libs/testdiff/replacement_test.go +++ b/libs/testdiff/replacement_test.go @@ -1,6 +1,7 @@ package testdiff import ( + "regexp" "testing" "github.com/stretchr/testify/assert" @@ -44,3 +45,15 @@ func TestReplacement_TemporaryDirectory(t *testing.T) { assert.Equal(t, "/tmp/.../tail", repls.Replace("/tmp/foo/bar/qux/tail")) } + +func TestReplaceAppliesInOrder(t *testing.T) { + input := "A" + + rc := ReplacementsContext{Repls: []Replacement{ + {Old: regexp.MustCompile("B"), New: "C", Order: 2}, + {Old: regexp.MustCompile("A"), New: "B", Order: 1}, + }} + + got := rc.Replace(input) + assert.Equal(t, "C", got) +} From ce1f2fde81b0f7cc7f9f90eb7ed586ff06bc929f Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 15:52:51 +0200 Subject: [PATCH 2/7] update integration tests --- .../interactive_cluster_dynamic_version/output.txt | 4 ++-- .../integration_whl/serverless_dynamic_version/output.txt | 4 ++-- .../templates/default-python/integration_classic/output.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt b/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt index cbce894b99..a777d2a6ee 100644 --- a/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt +++ b/acceptance/bundle/integration_whl/interactive_cluster_dynamic_version/output.txt @@ -1,7 +1,7 @@ >>> [CLI] bundle deploy Building python_artifact... -Uploading .databricks/bundle/default/patched_wheels/python_artifact_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... +Uploading .databricks/bundle/default/patched_wheels/python_artifact_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... Deploying resources... Updating deployment state... @@ -19,7 +19,7 @@ Got arguments: === Make a change to code without version change and run the job again >>> [CLI] bundle deploy Building python_artifact... -Uploading .databricks/bundle/default/patched_wheels/python_artifact_my_test_code/my_test_code-0.0.1+[TIMESTAMP_NS]-py3-none-any.whl... +Uploading .databricks/bundle/default/patched_wheels/python_artifact_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... Deploying resources... Updating deployment state... diff --git a/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt b/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt index b7f3231105..cfc068cc8a 100644 --- a/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt +++ b/acceptance/bundle/integration_whl/serverless_dynamic_version/output.txt @@ -3,7 +3,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+[TIMESTAMP_NS]-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... Deploying resources... Updating deployment state... @@ -21,7 +21,7 @@ Got arguments: === Make a change to code without version change and run the job again >>> [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+[TIMESTAMP_NS]-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... Deploying resources... Updating deployment state... diff --git a/acceptance/bundle/templates/default-python/integration_classic/output.txt b/acceptance/bundle/templates/default-python/integration_classic/output.txt index a2c56f4088..82a8ad745e 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/output.txt +++ b/acceptance/bundle/templates/default-python/integration_classic/output.txt @@ -57,7 +57,7 @@ Resources: @@ -45,4 +45,5 @@ "edit_mode": "UI_LOCKED", "format": "MULTI_TASK", -+ "id": "[NUMBER]", ++ "id": "[NUMID]", "job_clusters": [ { @@ -55,5 +56,4 @@ @@ -77,7 +77,7 @@ Resources: } - } + }, -+ "url": "[DATABRICKS_URL]/jobs/[NUMBER]" ++ "url": "[DATABRICKS_URL]/jobs/[NUMID]" } }, @@ -128,4 +128,5 @@ From c0a6687cf053e6be424cbb79d1f26e59d0447718 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 15:56:37 +0200 Subject: [PATCH 3/7] update integration tests --- acceptance/bundle/destroy/jobs-and-pipeline/output.txt | 2 +- acceptance/bundle/destroy/jobs-and-pipeline/script | 2 +- acceptance/bundle/destroy/jobs-and-pipeline/test.toml | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/acceptance/bundle/destroy/jobs-and-pipeline/output.txt b/acceptance/bundle/destroy/jobs-and-pipeline/output.txt index c84656567f..bdac93fef0 100644 --- a/acceptance/bundle/destroy/jobs-and-pipeline/output.txt +++ b/acceptance/bundle/destroy/jobs-and-pipeline/output.txt @@ -10,7 +10,7 @@ Deployment complete! === Assert the snapshot file exists >>> ls .databricks/bundle/default/sync-snapshots -[ALPHANUMID].json + 1 === Assert bundle deployment path is created >>> [CLI] workspace get-status //Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] diff --git a/acceptance/bundle/destroy/jobs-and-pipeline/script b/acceptance/bundle/destroy/jobs-and-pipeline/script index eb311584ec..6f317311f5 100644 --- a/acceptance/bundle/destroy/jobs-and-pipeline/script +++ b/acceptance/bundle/destroy/jobs-and-pipeline/script @@ -38,7 +38,7 @@ fi trace $CLI bundle deploy title "Assert the snapshot file exists" -trace ls .databricks/bundle/default/sync-snapshots +trace ls .databricks/bundle/default/sync-snapshots | wc -l title "Assert bundle deployment path is created" trace $CLI workspace get-status "${DEPLOYMENT_PATH}" | jq '{path, object_type}' diff --git a/acceptance/bundle/destroy/jobs-and-pipeline/test.toml b/acceptance/bundle/destroy/jobs-and-pipeline/test.toml index 29525776ea..f9455dae87 100644 --- a/acceptance/bundle/destroy/jobs-and-pipeline/test.toml +++ b/acceptance/bundle/destroy/jobs-and-pipeline/test.toml @@ -6,7 +6,3 @@ Ignore = [ "resources.yml", ".databricks/" ] - -[[Repls]] -Old = "[0-9a-z]{12,}" -New = "[ALPHANUMID]" From 51ff12663a6bb7a894489f46a122dc05c046c5a3 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 16:07:48 +0200 Subject: [PATCH 4/7] fixes --- .../default-python/integration_classic/test.toml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/acceptance/bundle/templates/default-python/integration_classic/test.toml b/acceptance/bundle/templates/default-python/integration_classic/test.toml index 2e07eb2b07..74a5ee1eff 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/test.toml +++ b/acceptance/bundle/templates/default-python/integration_classic/test.toml @@ -19,10 +19,14 @@ EnvMatrix.UV_PYTHON = [ EnvRepl.UV_PYTHON = true #[[Repls]] -# for some reason leading number is lost converting "%H%M%S" 061234 to 61234 -#Old = '\d{5,}' +#Old = '\d+\?o=\d+' #New = '[NUMBER]' +[[Repls]] +# for some reason leading number is lost converting "%H%M%S" 061234 to 61234 +Old = '\d{5,}' +New = '[NUMBER]' + [[Repls]] Old = 'Standard_D3_v2' New = '[NODE_TYPE_ID]' @@ -36,6 +40,12 @@ New = '/' Old = "python setup.py bdist_wheel" New = "python3 setup.py bdist_wheel" +[[Repls]] +Old = '\?o=\[NUMBER\]' +New = '' +Order = 1000 + [[Repls]] Old = '\?o=\[NUMID\]' New = '' +Order = 1000 From 1c06b5f6aa3cfc029bbdd9087011b79ed0a00b6d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 16:17:25 +0200 Subject: [PATCH 5/7] clean up comment --- .../templates/default-python/integration_classic/test.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/acceptance/bundle/templates/default-python/integration_classic/test.toml b/acceptance/bundle/templates/default-python/integration_classic/test.toml index 74a5ee1eff..e1082f3b7b 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/test.toml +++ b/acceptance/bundle/templates/default-python/integration_classic/test.toml @@ -18,10 +18,6 @@ EnvMatrix.UV_PYTHON = [ EnvRepl.UV_PYTHON = true -#[[Repls]] -#Old = '\d+\?o=\d+' -#New = '[NUMBER]' - [[Repls]] # for some reason leading number is lost converting "%H%M%S" 061234 to 61234 Old = '\d{5,}' From 3efd25b8cf2e2569187fff2db408748280152ee8 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 16:22:16 +0200 Subject: [PATCH 6/7] comment on ?o= suffix --- .../default-python/integration_classic/test.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/acceptance/bundle/templates/default-python/integration_classic/test.toml b/acceptance/bundle/templates/default-python/integration_classic/test.toml index e1082f3b7b..f9b8c44182 100644 --- a/acceptance/bundle/templates/default-python/integration_classic/test.toml +++ b/acceptance/bundle/templates/default-python/integration_classic/test.toml @@ -37,11 +37,7 @@ Old = "python setup.py bdist_wheel" New = "python3 setup.py bdist_wheel" [[Repls]] -Old = '\?o=\[NUMBER\]' -New = '' -Order = 1000 - -[[Repls]] -Old = '\?o=\[NUMID\]' +# clean up ?o= suffix after URL since not all workspaces have that +Old = '\?o=\[(NUMBER|NUMID)\]' New = '' Order = 1000 From 7086f2a7841e1d43f0bdb2383b918dfe2ec87c6d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Jun 2025 16:32:28 +0200 Subject: [PATCH 7/7] do not use 'wc -l', difference in linux/mac --- acceptance/bundle/destroy/jobs-and-pipeline/output.txt | 3 +-- acceptance/bundle/destroy/jobs-and-pipeline/script | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/acceptance/bundle/destroy/jobs-and-pipeline/output.txt b/acceptance/bundle/destroy/jobs-and-pipeline/output.txt index bdac93fef0..3b933f02ec 100644 --- a/acceptance/bundle/destroy/jobs-and-pipeline/output.txt +++ b/acceptance/bundle/destroy/jobs-and-pipeline/output.txt @@ -9,8 +9,7 @@ Updating deployment state... Deployment complete! === Assert the snapshot file exists ->>> ls .databricks/bundle/default/sync-snapshots - 1 +>>> find.py --expect 1 ^.databricks/bundle/default/sync-snapshots/[a-z0-9]+\.json === Assert bundle deployment path is created >>> [CLI] workspace get-status //Workspace/Users/[USERNAME]/.bundle/[UNIQUE_NAME] diff --git a/acceptance/bundle/destroy/jobs-and-pipeline/script b/acceptance/bundle/destroy/jobs-and-pipeline/script index 6f317311f5..57ee878f12 100644 --- a/acceptance/bundle/destroy/jobs-and-pipeline/script +++ b/acceptance/bundle/destroy/jobs-and-pipeline/script @@ -38,7 +38,7 @@ fi trace $CLI bundle deploy title "Assert the snapshot file exists" -trace ls .databricks/bundle/default/sync-snapshots | wc -l +trace find.py --expect 1 '^.databricks/bundle/default/sync-snapshots/[a-z0-9]+\.json' > /dev/null title "Assert bundle deployment path is created" trace $CLI workspace get-status "${DEPLOYMENT_PATH}" | jq '{path, object_type}'