Skip to content

Make sync command work in bundle context; reorder args - #207

Merged
pietern merged 5 commits into
mainfrom
sync-args
Feb 20, 2023
Merged

pietern merged 5 commits into
mainfrom
sync-args

Conversation

@pietern

@pietern pietern commented Feb 16, 2023 •

Copy link
Copy Markdown
Contributor

This commit also updates the integration tests to use the public empty repo.

Invoke with bricks sync SRC DST.

In bundle context SRC and DST arguments are taken from bundle configuration.

This PR adds bricks bundle sync to disambiguate between the two. Once the VS Code extension is bundle aware they can again be consolidated. Consolidating them today would regress the VS Code experience if a bundle.yml file is present in the file tree.

This commit also updates the integration tests to use the public empty repo.
Comment thread cmd/sync/sync.go
Comment thread cmd/sync/sync.go Outdated
@pietern
pietern merged commit 1715a98 into main Feb 20, 2023
@pietern
pietern deleted the sync-args branch February 20, 2023 10:34
pietern added a commit that referenced this pull request Feb 20, 2023
pietern added a commit that referenced this pull request Feb 20, 2023
pietern added a commit that referenced this pull request Feb 20, 2023
denik pushed a commit that referenced this pull request May 20, 2026
Invoke with `bricks sync SRC DST`.

In bundle context `SRC` and `DST` arguments are taken from bundle configuration.

This PR adds `bricks bundle sync` to disambiguate between the two.
Once the VS Code extension is bundle aware they can again be consolidated.
Consolidating them today would regress the VS Code experience if a
`bundle.yml` file is present in the file tree.
denik pushed a commit that referenced this pull request May 20, 2026
denik pushed a commit that referenced this pull request May 20, 2026
chenyuem-db pushed a commit to chenyuem-db/cli that referenced this pull request Sep 9, 2026
## Why

`databricks bundle sync` was silent by default, while `databricks sync`
defaulted to `text` output. A plain `databricks bundle sync` printed no
file actions, so with `--dry-run` the only output was `Running in
dry-run mode. No actual changes will be made.` — making it look like the
real command would do nothing. Reported as databricks#6499.

The divergence is not a deliberate design decision. When the two
commands were first split in databricks#207 (Feb 2023) they were **both** silent —
neither wired up any output handler — and that PR explicitly framed the
split as temporary ("Once the VS Code extension is bundle aware they can
again be consolidated"). Standalone `sync` later gained a text-default
`--output`; `bundle sync` only got an opt-in `--output` in databricks#1853 (Oct
2024), which kept the pre-existing silence as the no-flag default. So
the silence was incidental and never revisited.

## Changes

- `cmd/bundle/sync.go`: install the sync output handler from the
resolved root `--output` type (which defaults to `text`) instead of
gating on the flag being explicitly `.Changed`. `bundle sync` now
behaves like `sync`; `--output json` is unchanged. Removed the
now-inaccurate comment that went with the guard.
- `cmd/bundle/sync_test.go`: the old unit test pinned "handler only when
`--output` set"; updated it to assert the handler is installed for the
default (text) and for explicit `-o json`.
- `acceptance/bundle/sync-default-output/`: new acceptance test covering
`bundle sync` with no `--output` flag — the case the change alters,
which had no coverage. The two existing `bundle sync` acceptance tests
both pass `--output text`, so they are unaffected.

## Tests

- `go test ./cmd/bundle/` passes.
- New acceptance test passes across all inherited matrix variants
(terraform, direct, direct+DMS).
- Full local acceptance suite: the only failures were two pre-existing
load-induced timeout flakes (`clusters/.../resize-autoscale`,
`permissions/pipelines`), neither of which touches `bundle sync`; both
confirmed passing in isolation.

Closes databricks#6499

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <[email protected]>
janniklasrose added a commit that referenced this pull request Sep 15, 2026
## Why

`databricks bundle sync` was silent by default, while `databricks sync`
defaulted to `text` output. A plain `databricks bundle sync` printed no
file actions, so with `--dry-run` the only output was `Running in
dry-run mode. No actual changes will be made.` — making it look like the
real command would do nothing. Reported as #6499.

The divergence is not a deliberate design decision. When the two
commands were first split in #207 (Feb 2023) they were **both** silent —
neither wired up any output handler — and that PR explicitly framed the
split as temporary ("Once the VS Code extension is bundle aware they can
again be consolidated"). Standalone `sync` later gained a text-default
`--output`; `bundle sync` only got an opt-in `--output` in #1853 (Oct
2024), which kept the pre-existing silence as the no-flag default. So
the silence was incidental and never revisited.

## Changes

- `cmd/bundle/sync.go`: install the sync output handler from the
resolved root `--output` type (which defaults to `text`) instead of
gating on the flag being explicitly `.Changed`. `bundle sync` now
behaves like `sync`; `--output json` is unchanged. Removed the
now-inaccurate comment that went with the guard.
- `cmd/bundle/sync_test.go`: the old unit test pinned "handler only when
`--output` set"; updated it to assert the handler is installed for the
default (text) and for explicit `-o json`.
- `acceptance/bundle/sync-default-output/`: new acceptance test covering
`bundle sync` with no `--output` flag — the case the change alters,
which had no coverage. The two existing `bundle sync` acceptance tests
both pass `--output text`, so they are unaffected.

## Tests

- `go test ./cmd/bundle/` passes.
- New acceptance test passes across all inherited matrix variants
(terraform, direct, direct+DMS).
- Full local acceptance suite: the only failures were two pre-existing
load-induced timeout flakes (`clusters/.../resize-autoscale`,
`permissions/pipelines`), neither of which touches `bundle sync`; both
confirmed passing in isolation.

Closes #6499

This pull request and its description were written by Isaac.

---------

Co-authored-by: Isaac <[email protected]>
Sign up for free to 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.

2 participants