-
Notifications
You must be signed in to change notification settings - Fork 154
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c48e0c1
Add include/exclude flags to sync and bundle-sync commands
anton-107 16d11ac
simplify acceptance tests setup
anton-107 af74873
simplify acceptance test
anton-107 6c25f78
add a negated include example to the acceptance test
anton-107 2926b28
add --dry-run flag to sync and bundle-sync commands
anton-107 ac5fa66
change flag description
anton-107 60a2ad6
fix event_test.go
anton-107 33f346e
modify event_test.go to test dry run mode
anton-107 7ebf827
fix acceptance tests for dry-run syncs
anton-107 1238676
add NEXT_CHANGELOG.md
anton-107 76eb5de
fix acceptance tests for sync dry-run
anton-107 8cbd68e
update NEXT_CHANGELOG.md
anton-107 00db49f
remove DRY-RUN mode note from individual file actions
anton-107 c53a2f7
update acceptance tests to reflect removal of include/exclude flags f…
anton-107 9093505
use the same style of messaging in sync and bundle-sync commands
anton-107 829bf9e
fix acceptance tests
anton-107 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
anton-107 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| trace $CLI bundle sync --dry-run --output text | grep -v "^Action: " | sort | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ | |
| Initial Sync Complete | ||
| Uploaded .gitignore | ||
| Uploaded databricks.yml | ||
| Uploaded dryrun | ||
| Uploaded dryrun/databricks.yml | ||
|
Contributor
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. Curious, is it intentional that we process inner test's config there? |
||
| Uploaded ignored-folder/folder1 | ||
| Uploaded ignored-folder/folder1/script.py | ||
| Uploaded ignored-folder/script.py | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.