Skip to content

Add --exclude-from and --include-from flags to sync command - #2660

Merged
anton-107 merged 16 commits into
mainfrom
anton-107/sync-excludefrom
Apr 23, 2025
Merged

Add --exclude-from and --include-from flags to sync command#2660
anton-107 merged 16 commits into
mainfrom
anton-107/sync-excludefrom

Conversation

@anton-107

@anton-107anton-107 commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

Why

Exclude-from flag allows users to exclude file patterns from sync operations by providing a .gitignore -like file containing file patterns that should be excluded from sync

Usage:

$ databricks sync <SRC> <DEST> --exclude-from .my-exclude-file
$ databricks sync <SRC> <DEST> --include-from .my-include-file

Tests

  1. Added new acceptance tests
  2. Added new unit test

@anton-107
anton-107 marked this pull request as ready for review April 4, 2025 15:33
Comment threadacceptance/bundle/sync/from-file/script Outdated
Comment threadacceptance/cmd/sync/from-file/script Outdated
Comment threadcmd/sync/sync.go Outdated
Comment threadacceptance/bundle/sync/from-file/script Outdated
Comment threadacceptance/bundle/sync/from-file/script Outdated

@pieternpietern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect --include-from to be almost identical, could you include it in this PR?

Separately, I would prefer if we not use .databricksignore even in our test files. It implies (to me) there are semantics associated with this file name, even though that's something we explicitly don't want.

@anton-107
anton-107force-pushed the anton-107/sync-excludefrom branch from 6ba54a9 to 76acd9bCompareApril 17, 2025 13:27
…isting / missing) 2) refers to exact directory (existing / missing) 3) contains "**"
@anton-107anton-107 changed the title Add --exclude-from flag to sync commands Add --exclude-from and --include-from flags to sync commandApr 17, 2025
Comment threadcmd/sync/sync.go
Comment threadacceptance/cmd/sync-from-file/script
@anton-107
anton-107 added this pull request to the merge queueApr 23, 2025
Merged via the queue into main with commit 46b79a7Apr 23, 2025
@anton-107
anton-107 deleted the anton-107/sync-excludefrom branch April 23, 2025 08:15
deco-sdk-taggingBot added a commit that referenced this pull request Apr 23, 2025
## Release v0.249.0
### CLI
* Added `exclude-from` and `include-from` flags support to sync command ([#2660](#2660))
### Bundles
* Correctly translate paths to local requirements.txt file in environment dependencies ([#2736](#2736))
* Check for running resources with --fail-on-active-runs before any mutative operation during deploy ([#2743](#2743))
denik pushed a commit that referenced this pull request May 20, 2026
## Why
<!-- Why are these changes needed? Provide the context that the reviewer
might be missing.
For example, were there any decisions behind the change that are not
reflected in the code itself? -->
Exclude-from flag allows users to exclude file patterns from sync
operations by providing a .gitignore -like file containing file patterns
that should be excluded from sync
Usage:
`$ databricks sync <SRC> <DEST> --exclude-from .my-exclude-file` `$ databricks sync <SRC> <DEST> --include-from .my-include-file` ## Tests
<!-- How have you tested the changes? -->
1. Added new acceptance tests
2. Added new unit 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. -->
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.249.0
### CLI
* Added `exclude-from` and `include-from` flags support to sync command ([#2660](#2660))
### Bundles
* Correctly translate paths to local requirements.txt file in environment dependencies ([#2736](#2736))
* Check for running resources with --fail-on-active-runs before any mutative operation during deploy ([#2743](#2743))
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@anton-107@pietern@denik@andrewnester@shreyas-goenka