Skip to content

Commit 429bedc

Browse files
authored
Fix bundle plan to not create workspace objects or upload the files (#3442)
## Changes Refactored `deployPrepare` to make it non-mutative. Moved artifact folder cleanup and libraries upload to `uploadLibraries`, which is only used by deploy. ## Why This makes `bundle plan` non-mutative and safe to use to preview bundle changes. ## Tests Added acceptance test <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
1 parent 21381cb commit 429bedc

File tree

21 files changed

+287
-197
lines changed

21 files changed

+287
-197
lines changed

acceptance/bundle/paths/fallback_metric/output.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Deployment complete!
2323
"value": false
2424
},
2525
{
26-
"key": "skip_artifact_cleanup",
26+
"key": "python_wheel_wrapper_is_set",
2727
"value": false
2828
},
2929
{
30-
"key": "python_wheel_wrapper_is_set",
30+
"key": "skip_artifact_cleanup",
3131
"value": false
3232
},
3333
{
@@ -57,11 +57,11 @@ Deployment complete!
5757
"value": true
5858
},
5959
{
60-
"key": "skip_artifact_cleanup",
60+
"key": "python_wheel_wrapper_is_set",
6161
"value": false
6262
},
6363
{
64-
"key": "python_wheel_wrapper_is_set",
64+
"key": "skip_artifact_cleanup",
6565
"value": false
6666
},
6767
{
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
bundle:
2+
name: plan-no-upload
3+
4+
resources:
5+
jobs:
6+
my_job:
7+
name: my-job
8+
tasks:
9+
- task_key: task1
10+
spark_python_task:
11+
python_file: "./my_script.py"
12+
environment_key: "env"
13+
14+
environments:
15+
- environment_key: "env"
16+
spec:
17+
client: "1"
18+
dependencies:
19+
- "*.whl"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("Hello, World!")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Local = true
2+
Cloud = false
3+
4+
[EnvMatrix]
5+
DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
>>> [CLI] bundle plan
3+
create jobs.my_job
4+
5+
>>> jq -s .[] | select(.method != "GET") out.requests.txt
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
trace $CLI bundle plan
2+
3+
# Expect no non-GET requests
4+
trace jq -s '.[] | select(.method != "GET")' out.requests.txt
5+
6+
rm out.requests.txt
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Local = true
2+
Cloud = false
3+
RecordRequests = true

acceptance/bundle/plan/no_upload/test.whl

Whitespace-only changes.

acceptance/bundle/resource_deps/missing_ingestion_definition/out.requests.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,3 @@
2929
"method": "GET",
3030
"path": "/api/2.0/workspace/get-status"
3131
}
32-
{
33-
"method": "POST",
34-
"path": "/api/2.0/workspace/delete",
35-
"body": {
36-
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal",
37-
"recursive": true
38-
}
39-
}
40-
{
41-
"method": "POST",
42-
"path": "/api/2.0/workspace/mkdirs",
43-
"body": {
44-
"path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal"
45-
}
46-
}

acceptance/bundle/telemetry/deploy-compute-type/output.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Deployment complete!
2222
"value": false
2323
},
2424
{
25-
"key": "skip_artifact_cleanup",
25+
"key": "python_wheel_wrapper_is_set",
2626
"value": false
2727
},
2828
{
29-
"key": "python_wheel_wrapper_is_set",
29+
"key": "skip_artifact_cleanup",
3030
"value": false
3131
},
3232
{
@@ -52,11 +52,11 @@ Deployment complete!
5252
"value": false
5353
},
5454
{
55-
"key": "skip_artifact_cleanup",
55+
"key": "python_wheel_wrapper_is_set",
5656
"value": false
5757
},
5858
{
59-
"key": "python_wheel_wrapper_is_set",
59+
"key": "skip_artifact_cleanup",
6060
"value": false
6161
},
6262
{

0 commit comments

Comments
 (0)