-
Notifications
You must be signed in to change notification settings - Fork 79
Add --dry-run flag to sync and bundle-sync command #2657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c48e0c1
16d11ac
af74873
6c25f78
2926b28
ac5fa66
60a2ad6
33f346e
7ebf827
1238676
76eb5de
8cbd68e
00db49f
c53a2f7
9093505
829bf9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
bundle: | ||
name: bundle-sync-test | ||
|
||
resources: | ||
dashboards: | ||
dashboard1: | ||
display_name: My dashboard |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
>>> [CLI] bundle sync --dry-run --output text | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
Uploaded databricks.yml | ||
Uploaded project-folder | ||
Uploaded project-folder/app.py | ||
Uploaded project-folder/app.yaml | ||
Uploaded project-folder/query.sql |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
mkdir "project-folder" "ignored-folder" "ignored-folder/folder1" | ||
touch "project-folder/app.yaml" "project-folder/app.py" "project-folder/query.sql" | ||
touch "ignored-folder/script.py" "ignored-folder/folder1/script.py" | ||
cat > .gitignore << EOF | ||
ignored-folder/ | ||
script | ||
output.txt | ||
repls.json | ||
EOF | ||
|
||
cleanup() { | ||
rm .gitignore | ||
rm -rf project-folder ignored-folder .git .databricks | ||
} | ||
trap cleanup EXIT | ||
|
||
# Note: output line starting with "Action: " lists files in non-deterministic order so we filter it out | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're sorting anyway, so you already handle non-deterministic order, right?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorting output lines, but "Action:" is listing all files affected by the operation in a random order in a single line. I figured the easiest way around is to remove it from the output altogether There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normally we try get rid of non-determinism in output (where feasible). Is this due to map being used to hold the files? In that case I'd either get rid of map or use SortedKeys helper before printing. |
||
trace $CLI bundle sync --dry-run --output text | grep -v "^Action: " | sort |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
>>> [CLI] sync . /Users/[USERNAME] --dry-run | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
Uploaded project-folder | ||
Uploaded project-folder/app.py | ||
Uploaded project-folder/app.yaml | ||
Uploaded project-folder/query.sql | ||
|
||
>>> [CLI] sync . /Users/[USERNAME] --dry-run --exclude project-folder/app.* | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
Uploaded project-folder | ||
Uploaded project-folder/query.sql | ||
|
||
>>> [CLI] sync . /Users/[USERNAME] --dry-run --exclude project-folder/app.* --exclude project-folder/query.sql | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
|
||
>>> [CLI] sync . /Users/[USERNAME] --dry-run --exclude project-folder/app.* --exclude project-folder/query.sql --include ignored-folder/*.py | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
Uploaded ignored-folder | ||
Uploaded ignored-folder/script.py | ||
|
||
>>> [CLI] sync . /Users/[USERNAME] --dry-run --exclude project-folder/app.* --exclude project-folder/query.sql --include ignored-folder/**/*.py | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
Uploaded ignored-folder/folder1 | ||
Uploaded ignored-folder/folder1/script.py | ||
Uploaded ignored-folder/script.py | ||
|
||
>>> [CLI] sync . /Users/[USERNAME] --dry-run --include ignored-folder/** --include !ignored-folder/folder1/big-blob | ||
Warn: Running in dry-run mode. No actual changes will be made. | ||
Initial Sync Complete | ||
Uploaded .gitignore | ||
Uploaded ignored-folder/folder1 | ||
Uploaded ignored-folder/folder1/script.py | ||
Uploaded ignored-folder/folder1/script.yaml | ||
Uploaded ignored-folder/script.py | ||
Uploaded project-folder | ||
Uploaded project-folder/app.py | ||
Uploaded project-folder/app.yaml | ||
Uploaded project-folder/query.sql |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
mkdir "project-folder" "ignored-folder" "ignored-folder/folder1" ".git" | ||
touch "project-folder/app.yaml" "project-folder/app.py" "project-folder/query.sql" | ||
touch "ignored-folder/script.py" "ignored-folder/folder1/script.py" "ignored-folder/folder1/script.yaml" "ignored-folder/folder1/big-blob" | ||
cat > .gitignore << EOF | ||
ignored-folder/ | ||
script | ||
output.txt | ||
repls.json | ||
EOF | ||
|
||
cleanup() { | ||
rm .gitignore | ||
rm -rf project-folder ignored-folder .git | ||
} | ||
trap cleanup EXIT | ||
|
||
# Note: output line starting with Action lists files in non-deterministic order so we filter it out | ||
trace $CLI sync . /Users/$CURRENT_USER_NAME --dry-run | grep -v "^Action" | sort | ||
|
||
# excluding by mask: | ||
trace $CLI sync . /Users/$CURRENT_USER_NAME --dry-run --exclude 'project-folder/app.*' | grep -v "^Action" | sort | ||
|
||
# combining excludes: | ||
trace $CLI sync . /Users/$CURRENT_USER_NAME --dry-run --exclude 'project-folder/app.*' --exclude 'project-folder/query.sql' | grep -v "^Action" | sort | ||
|
||
# combining excludes and includes: | ||
trace $CLI sync . /Users/$CURRENT_USER_NAME --dry-run --exclude 'project-folder/app.*' --exclude 'project-folder/query.sql' --include 'ignored-folder/*.py' | grep -v "^Action" | sort | ||
|
||
# include sub-folders: | ||
trace $CLI sync . /Users/$CURRENT_USER_NAME --dry-run --exclude 'project-folder/app.*' --exclude 'project-folder/query.sql' --include 'ignored-folder/**/*.py' | grep -v "^Action" | sort | ||
|
||
# use negated include to exclude files from syncing: | ||
trace $CLI sync . /Users/$CURRENT_USER_NAME --dry-run --include 'ignored-folder/**' --include '!ignored-folder/folder1/big-blob' | grep -v "^Action" | sort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be more natural to prepare this structure and commit it to git?
You would need to come up with another name for .gitignore (e.g. test-gitignore) and do 'mv test-gitignore .gitignore' before your test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that method did not occur to me. That is probably worth adding to the acceptance testing contribution guidelines.