bundle/deploy/lock: write deployment_version.json on every CreateVersion#5385
Closed
shreyas-goenka wants to merge 1 commit into
Closed
bundle/deploy/lock: write deployment_version.json on every CreateVersion#5385shreyas-goenka wants to merge 1 commit into
shreyas-goenka wants to merge 1 commit into
Conversation
Replaces the placeholder version=0 with a real monotonic counter. After acquiring the lock, CreateVersion reads deployment_version.json (if it exists), increments the counter, writes it back under the same lock, and returns the new version number. The first deployment creates version 1. The write goes through a newStateFiler callback so tests can inject an in-memory filer without hitting the workspace API. Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacks on #5314.
Replaces the placeholder
version=0with a real monotonic counter stored at{state_path}/deployment_version.jsonalongside the lock file.What changed:
CreateVersionreadsdeployment_version.json, increments the counter, writes it back under the same lock, and returns the new version number (first deployment = 1).newStateFilercallback onworkspaceFilesystemLockdefaults tofiler.NewWorkspaceFilesClient; overridable in tests.export_test.go— no workspace API needed.File format (
state_path/deployment_version.json):{"version": 3}Test plan
go test ./bundle/deploy/lock/... ./bundle/phases/...green./task lint-qclean