Skip to content

Preserve existing workspace objects on upload type conflicts - #7244

Closed
shreyas-goenka wants to merge 3 commits into
mainfrom
shreyas-goenka_data/shreyas-goenka/remove-upload-type-deletion
Closed

shreyas-goenka wants to merge 3 commits into
mainfrom
shreyas-goenka_data/shreyas-goenka/remove-upload-type-deletion

Conversation

@shreyas-goenka

Copy link
Copy Markdown
Contributor

Uploads that conflict with an existing workspace object's type now fail and preserve the existing object. Remove the automatic delete-and-retry path, its collision-message matching, and its object-type and notebook-language checks. Users must remove a conflicting file or notebook explicitly before retrying, including files misclassified by CLI v1.21/v1.22.

Update the existing sync acceptance test to assert that both conflicting objects survive a failed sync and that syncing succeeds after manual cleanup. This follows up on #7218.

Validation:

  • go test ./libs/filer ./libs/sync
  • Sync acceptance tests, including all DMS variants
  • ./task fmt, ./task lint, whitespace and changelog checks

The internal Go proxy blocks the pinned golang.org/x/net v0.62.0 download. Go tests and lint passed with a temporary local override to the cached v0.61.0; dependency files were restored before committing.

@github-actions github-actions Bot added DABs DABs related issues labels Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Commit: 7bbb1071e | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

2 tests: regression=2 unreleased=0 coverage=0 failing=0

test branch main (8afc86f) latest (v1.22.1)
TestAccept/bundle/sync/replace-node-type/DMS= ✅ ❌ ❌
TestAccept/bundle/sync/replace-node-type/DMS=true ✅ ❌ ❌
TestAccept/bundle/sync/replace-node-type/DMS=: branch ✅ | main (8afc86f) ❌ | latest (v1.22.1) ❌

main (8afc86f):

acceptance_test.go:1341: Diff:
        --- bundle/sync/replace-node-type/output.txt
        +++ /tmp/TestAcceptbundlesyncreplace-node-typeDMS=2786552774/002/output.txt
        @@ -11,23 +11,8 @@
         
         === Sync fails and preserves both existing objects
         Action: PUT: bom.sql, plain.sql
        -
        ->>> list
        -FILE bom.sql
        -NOTEBOOK plain
        -
        -=== Sync succeeds after manually deleting the conflicting objects
        -
        ->>> [CLI] workspace delete /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/bom.sql
        -
        ->>> [CLI] workspace delete /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain
        -
        ->>> [CLI] bundle sync --output text
        -Action: PUT: bom.sql, plain.sql
         Initial Sync Complete
         Uploaded bom.sql
         Uploaded plain.sql
         
        ->>> list
        -NOTEBOOK bom
        -FILE plain.sql
        +Exit code: 1
        
    acceptance_test.go:1119: 
        LOG.sync: 
        LOG.sync: >>> musterr /tmp/TestAccept2701811891/001/databricks bundle sync --output text
        LOG.sync: 
        LOG.sync: Unexpected success
FAIL

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/sync/replace-node-type/output.txt
        +++ /tmp/TestAcceptbundlesyncreplace-node-typeDMS=3545582887/002/output.txt
        @@ -29,5 +29,5 @@
         Uploaded plain.sql
         
         >>> list
        -NOTEBOOK bom
        +FILE bom.sql
         FILE plain.sql
        
    acceptance_test.go:1119: 
        LOG.sync: 
        LOG.sync: >>> musterr /home/runner/work/cli/cli/acceptance/build/linux_amd64/1.22.1/databricks bundle sync --output text
        LOG.sync: Error: file already exists: /Workspace/Users/tester@databricks.com/.bundle/replace-node-type-qjnk5x3s7nhclngfr24tguypya/default/files/plain.sql
FAIL
TestAccept/bundle/sync/replace-node-type/DMS=true: branch ✅ | main (8afc86f) ❌ | latest (v1.22.1) ❌

main (8afc86f):

acceptance_test.go:1341: Diff:
        --- bundle/sync/replace-node-type/output.txt
        +++ /tmp/TestAcceptbundlesyncreplace-node-typeDMS=true798453020/002/output.txt
        @@ -11,23 +11,8 @@
         
         === Sync fails and preserves both existing objects
         Action: PUT: bom.sql, plain.sql
        -
        ->>> list
        -FILE bom.sql
        -NOTEBOOK plain
        -
        -=== Sync succeeds after manually deleting the conflicting objects
        -
        ->>> [CLI] workspace delete /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/bom.sql
        -
        ->>> [CLI] workspace delete /Workspace/Users/[USERNAME]/.bundle/replace-node-type-[UNIQUE_NAME]/default/files/plain
        -
        ->>> [CLI] bundle sync --output text
        -Action: PUT: bom.sql, plain.sql
         Initial Sync Complete
         Uploaded bom.sql
         Uploaded plain.sql
         
        ->>> list
        -NOTEBOOK bom
        -FILE plain.sql
        +Exit code: 1
        
    acceptance_test.go:1119: 
        LOG.sync: 
        LOG.sync: >>> musterr /tmp/TestAccept2701811891/001/databricks bundle sync --output text
        LOG.sync: 
        LOG.sync: Unexpected success

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/sync/replace-node-type/output.txt
        +++ /tmp/TestAcceptbundlesyncreplace-node-typeDMS=true65810895/002/output.txt
        @@ -11,6 +11,7 @@
         
         === Sync fails and preserves both existing objects
         Action: PUT: bom.sql, plain.sql
        +Uploaded bom.sql
         
         >>> list
         FILE bom.sql
        @@ -29,5 +30,5 @@
         Uploaded plain.sql
         
         >>> list
        -NOTEBOOK bom
        +FILE bom.sql
         FILE plain.sql
        
    acceptance_test.go:1119: 
        LOG.sync: 
        LOG.sync: >>> musterr /home/runner/work/cli/cli/acceptance/build/linux_amd64/1.22.1/databricks bundle sync --output text
        LOG.sync: Error: file already exists: /Workspace/Users/tester@databricks.com/.bundle/replace-node-type-c2nqr35ikzac5o32rwtjatyqru/default/files/plain.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant