Skip to content

Fix bundle file resync after remote directory deletion - #6661

Open
50sotero wants to merge 4 commits into
databricks:mainfrom
50sotero:fix/bundle-resync-deleted-1976
Open

50sotero wants to merge 4 commits into
databricks:mainfrom
50sotero:fix/bundle-resync-deleted-1976

Conversation

@50sotero

@50sotero 50sotero commented Sep 12, 2026

Copy link
Copy Markdown

Changes

Track the remote directory object ID in sync snapshots and invalidate a snapshot when the directory has been deleted or recreated. Preserve deletion history for snapshots rebuilt from deployment state, keep unchanged redeploys incremental, and leave remote directories and saved snapshots unchanged during dry runs.

Why

Fixes #1976. Deleting a bundle's remote directory leaves the local sync snapshot intact, so redeployment previously skipped the files. Existing snapshots without a directory ID receive one full upload after upgrading.

Tests

  • Reproduced the missing-file failure before the fix using the existing out-of-band deletion acceptance test on both Terraform and direct engines.
  • Recovery acceptance tests pass across their engine variants: deleted bundle recovery, unchanged redeployment, replacement of just the files directory, and deletion of obsolete files after local state is cleared.
  • Five snapshot/dry-run cases and all five CLI sync acceptance scenarios (both engines) pass.
  • Full Linux validation with this PR and Validate serverless pipeline cluster settings #6662 applied: ./task fmt, ./task checks, ./task lint, and ./task test pass. Results: 10,030 root-module unit cases (47 skipped), 73 tools-module cases, and 5,138 acceptance cases (11 skipped), with no failures. Go 1.26.8; acceptance uses the local test server.
  • Changelog validation also passes with this PR's link. Live workspace integration tests were not run; upstream CI requires maintainer approval.

This PR was written by OpenAI Codex.

@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 6661
  • Commit SHA: 99c36f7525c84c545da3f4ea13ebfc9079db3702

Checks will be approved automatically on success.

@50sotero
50sotero marked this pull request as ready for review September 12, 2026 19:29
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

Files: acceptance/bundle/deploy/files/out-of-band-delete/output.txt, acceptance/bundle/deploy/files/out-of-band-delete/script, acceptance/bundle/deploy/files/out-of-band-delete/test.toml
Suggested: @denik
Also eligible: @andrewnester, @janniklasrose, @pietern, @shreyas-goenka, @anton-107, @lennartkats-db

/libs/sync/ - needs approval

4 files changed
Suggested: @simonfaltum
Also eligible: @renaudhartert-db, @hectorcast-db, @parthban-db, @tanmay-db, @Divyansh-db, @tejaskochar-db, @mihaimitrea-db, @chrisst, @rauchy

General files (require maintainer)

Files: .nextchanges/bundles/resync-deleted-bundle-files.md
Based on git history:

  • @denik -- recent work in .nextchanges/bundles/, libs/sync/, acceptance/bundle/deploy/files/out-of-band-delete/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@50sotero

Copy link
Copy Markdown
Author

@denik, could you take a look at this fix for #1976 and help authorize the pending CI/integration tests? The regression coverage includes deleted or recreated remote directories and recovery after local state is cleared. Local formatting, checks, lint, and the full unit/acceptance suites pass; live workspace integration tests still need an authorized run.

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.

Bundles don't deploy correctly if remote was deleted

1 participant