Skip to content
Merged
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
2 changes: 2 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@

### Bundles

* Processing 'artifacts' section is now done in "bundle validate" (adding defaults, inferring "build", asserting required fields) ([#2526])(https://github.com/databricks/cli/pull/2526))

### API Changes
9 changes: 9 additions & 0 deletions acceptance/bundle/artifacts/build_and_files/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
bundle:
name: build_and_files

artifacts:
custom:
build: touch built.txt
files:
# this file does not exist yet, will be generated by build command
- source: built.txt
11 changes: 11 additions & 0 deletions acceptance/bundle/artifacts/build_and_files/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"custom": {
"build": "touch built.txt",
"files": [
{
"source": "[TMPDIR]/built.txt"
}
],
"path": "[TMPDIR]"
}
}
1 change: 1 addition & 0 deletions acceptance/bundle/artifacts/build_and_files/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI bundle validate -o json | jq .artifacts
5 changes: 5 additions & 0 deletions acceptance/bundle/artifacts/build_and_files/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RecordRequests = false

[[Repls]]
Old = '\\\\'
New = '/'
8 changes: 8 additions & 0 deletions acceptance/bundle/artifacts/globs_in_files/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bundle:
name: expand_globs

artifacts:
test:
files:
- source: a*.txt
- source: subdir/*.txt
61 changes: 61 additions & 0 deletions acceptance/bundle/artifacts/globs_in_files/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

>>> [CLI] bundle validate -o json
Error: a*.txt: no matching files
at artifacts.test.files[0].source
in databricks.yml:7:17

Error: subdir/*.txt: no matching files
at artifacts.test.files[1].source
in databricks.yml:8:17


Exit code: 1
{
"test": {
"files": [
{
"source": "a*.txt"
},
{
"source": "subdir/*.txt"
}
]
}
}

>>> [CLI] bundle validate -o json
Error: subdir/*.txt: no matching files
at artifacts.test.files[1].source
in databricks.yml:8:17


Exit code: 1
{
"test": {
"files": [
{
"source": "a*.txt"
},
{
"source": "subdir/*.txt"
}
]
}
}

>>> [CLI] bundle validate -o json
{
"test": {
"files": [
{
"source": "a1.txt"
},
{
"source": "a2.txt"
},
{
"source": "subdir/hello.txt"
}
]
}
}
12 changes: 12 additions & 0 deletions acceptance/bundle/artifacts/globs_in_files/script
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
errcode trace $CLI bundle validate -o json | jq .artifacts

touch a1.txt
touch a2.txt

errcode trace $CLI bundle validate -o json | jq .artifacts

mkdir -p subdir
touch subdir/hello.txt
errcode trace $CLI bundle validate -o json | jq .artifacts

rm -fr a1.txt a2.txt subdir
5 changes: 5 additions & 0 deletions acceptance/bundle/artifacts/globs_in_files/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RecordRequests = false

[[Repls]]
Old = '\\\\'
New = '/'
10 changes: 10 additions & 0 deletions acceptance/bundle/artifacts/globs_invalid/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
bundle:
name: expand_globs

artifacts:
test:
files:
- source: "a[.txt"
- source: "./a[.txt"
- source: "../a[.txt"
- source: "subdir/a[.txt"
38 changes: 38 additions & 0 deletions acceptance/bundle/artifacts/globs_invalid/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

>>> [CLI] bundle validate -o json
Error: a[.txt: syntax error in pattern
at artifacts.test.files[0].source
in databricks.yml:7:17

Error: ./a[.txt: syntax error in pattern
at artifacts.test.files[1].source
in databricks.yml:8:17

Error: ../a[.txt: syntax error in pattern
at artifacts.test.files[2].source
in databricks.yml:9:17

Error: subdir/a[.txt: syntax error in pattern
at artifacts.test.files[3].source
in databricks.yml:10:17


Exit code: 1
{
"test": {
"files": [
{
"source": "a[.txt"
},
{
"source": "./a[.txt"
},
{
"source": "../a[.txt"
},
{
"source": "subdir/a[.txt"
}
]
}
}
1 change: 1 addition & 0 deletions acceptance/bundle/artifacts/globs_invalid/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
errcode trace $CLI bundle validate -o json | jq .artifacts
1 change: 1 addition & 0 deletions acceptance/bundle/artifacts/globs_invalid/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RecordRequests = false
2 changes: 2 additions & 0 deletions acceptance/bundle/debug/out.stderr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
10:07:59 Debug: Apply pid=12345 mutator=ConfigureWSFS
10:07:59 Debug: Apply pid=12345 mutator=TranslatePaths
10:07:59 Debug: Apply pid=12345 mutator=PythonWrapperWarning
10:07:59 Debug: Apply pid=12345 mutator=artifacts.Prepare
10:07:59 Info: No local tasks in databricks.yml config, skipping auto detect pid=12345 mutator=artifacts.Prepare
10:07:59 Debug: Apply pid=12345 mutator=apps.Validate
10:07:59 Debug: Apply pid=12345 mutator=ValidateSharedRootPermissions
10:07:59 Debug: Apply pid=12345 mutator=ApplyBundlePermissions
Expand Down
42 changes: 0 additions & 42 deletions bundle/artifacts/all.go

This file was deleted.

74 changes: 0 additions & 74 deletions bundle/artifacts/artifacts.go

This file was deleted.

Loading
Loading