databricks-cli/internal
Pieter Noordhuis 6187803007
Correctly overwrite local state if remote state is newer (#1008)
## Changes

A bug in the code that pulls the remote state could cause the local
state to be empty instead of a copy of the remote state. This happened
only if the local state was present and stale when compared to the
remote version.

We correctly checked for the state serial to see if the local state had
to be replaced but didn't seek back on the remote state before writing
it out. Because the staleness check would read the remote state in full,
copying from the same reader would immediately yield an EOF.

## Tests

* Unit tests for state pull and push mutators that rely on a mocked
filer.
* An integration test that deploys the same bundle from multiple paths,
triggering the staleness logic.

Both failed prior to the fix and now pass.
2023-11-24 11:15:46 +00:00
..
acc Update Go SDK to 0.23.0 and use custom marshaller (#772) 2023-10-16 06:56:06 +00:00
build Make default dev semver a const (#891) 2023-10-19 18:56:54 +00:00
bundle Correctly overwrite local state if remote state is newer (#1008) 2023-11-24 11:15:46 +00:00
mocks Correctly overwrite local state if remote state is newer (#1008) 2023-11-24 11:15:46 +00:00
python Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
testdata Fix integration test asserting errors on unknown template parameters (#977) 2023-11-10 11:05:32 +00:00
testjsons Update Go SDK to 0.23.0 and use custom marshaller (#772) 2023-10-16 06:56:06 +00:00
testutil Run tests to verify backend tag validation behavior (#814) 2023-09-29 08:38:06 +00:00
alerts_test.go Update alerts command integration test (#512) 2023-06-22 10:30:52 +02:00
api_test.go Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
clusters_test.go Do not generate prompts for certain commands (#438) 2023-06-05 19:38:45 +02:00
filer_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
fs_cat_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
fs_cp_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
fs_ls_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
fs_mkdir_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
fs_rm_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
git_clone_test.go Remove resolution of repo names against the Databricks Github account (#940) 2023-11-01 13:02:06 +00:00
helpers.go Make Cobra runner compatible with testing interactive flows (#957) 2023-11-07 19:06:27 +00:00
init_test.go Error when unknown keys are encounters during template execution (#766) 2023-09-14 15:53:20 +00:00
jobs_test.go Update Go SDK to 0.23.0 and use custom marshaller (#772) 2023-10-16 06:56:06 +00:00
locker_test.go Added test to submit and run various Python tasks on multiple DBR versions (#806) 2023-10-03 11:18:55 +00:00
repos_test.go Add provider detection to the repos create command (#528) 2023-06-27 14:17:13 +02:00
secrets_test.go Remove dependency on global state for remaining commands (#613) 2023-07-27 10:03:08 +00:00
sync_test.go Refactor change computation for sync (#785) 2023-10-03 13:47:46 +00:00
tags_test.go Run tests to verify backend tag validation behavior (#814) 2023-09-29 08:38:06 +00:00
version_test.go Use cmdio in version command for `--output` flag (#419) 2023-06-01 12:03:22 +02:00
workspace_test.go Fix workspace import test (#844) 2023-10-06 18:09:56 +00:00