databricks-cli/libs
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
..
auth Fix IsServicePrincipal() only working for workspace admins (#732) 2023-09-05 11:20:55 +00:00
cmdio Add support for multiline descriptions when using template enums (#916) 2023-10-25 09:37:25 +00:00
config Function to convert Go struct back to `config.Value` (#935) 2023-11-15 09:19:51 +00:00
databrickscfg Improved usability of `databricks auth login ... --configure-cluster` flow by displaying cluster type and runtime version (#956) 2023-11-09 16:38:45 +00:00
diag Add configuration normalization code (#915) 2023-10-25 11:56:42 +00:00
env Added `env.UserHomeDir(ctx)` for parallel-friendly tests (#955) 2023-11-08 14:50:20 +00:00
errs Added ability for deferred mutator execution (#380) 2023-05-16 18:01:50 +02:00
filer Correctly overwrite local state if remote state is newer (#1008) 2023-11-24 11:15:46 +00:00
fileset Support .gitignore syntax in sync section and make sure it works recursively (#854) 2023-10-10 08:45:15 +00:00
flags Add override to support YAML inputs for apps (#921) 2023-10-27 18:57:26 +00:00
git Remove resolution of repo names against the Databricks Github account (#940) 2023-11-01 13:02:06 +00:00
jsonschema Remove validation for default value against pattern (#959) 2023-11-07 12:35:59 +00:00
locker Correct name for force acquire deploy flag (#656) 2023-08-15 19:03:43 +00:00
log Upgraded Go version to 1.21 (#664) 2023-08-15 13:50:40 +00:00
notebook Error out if notebook file does not exist locally (#261) 2023-03-21 18:13:16 +01:00
process Fixed flaky TestBackgroundCombinedOutputFailure (#978) 2023-11-10 14:09:02 +00:00
python Added `python.DetectInterpreters` and other utils (#805) 2023-10-03 10:47:09 +00:00
set Added support for sync.include and sync.exclude sections (#671) 2023-08-18 08:07:25 +00:00
sync Support .gitignore syntax in sync section and make sure it works recursively (#854) 2023-10-10 08:45:15 +00:00
tags Library to validate and normalize cloud specific tags (#819) 2023-09-29 08:49:08 +00:00
template Improve error message when path is not a bundle template (#985) 2023-11-22 12:25:16 +00:00
terraform Add bundle destroy command (#300) 2023-04-06 12:54:58 +02:00
testfile Refactor and cover edge cases in sync integration tests (#160) 2023-01-10 13:16:30 +01:00