You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keep Local Quick Start recreate on the image its data already uses - #1083
Recreate container reuses the image reference stored for the instance, normally the floating documentdb-local:latest, and pulls it again. latest is now DocumentDB 1.2, which updates the extensions on an existing data volume at startup, and going back to 1.0 on that data isn't supported. So a user who removes the container to apply a new telemetry level, as the user manual says to, gets their data upgraded for good while setup says the image was kept. Start, Stop and Restart are not affected.
Pinning the default tag would only help new instances, since every existing record already stores :latest. So the record now keeps the image's repo digest, read from the container at setup, on every reconcile, and before a recreate removes the old container. A recreate runs that digest, pulling it only if the image was pruned, with the instance's recorded engine.
An older record that only has a tag runs the local image without pulling. If that image is gone too and the volume still exists, setup stops and explains that pulling may upgrade the data; the user can pull it and retry. Configure, the Preparing image stage and the ready page say which image was reused or downloaded, and don't promise the exact original image for a tag-only record. An in-place upgrade path is left for later.
Also corrects two comments: DocumentDB Local supports serverStatus from 1.2.
Tested with unit and browser-scenario tests; nothing was run against real containers.
A recreate pulled the stored tag again, normally :latest. Now that
:latest is DocumentDB 1.2, that image updates the extensions on the
existing volume at startup and the older image can't run it afterwards,
so Recreate container upgraded the data for good while setup said the
image was kept.
Store the image's repo digest when the container is created or adopted,
and recreate from it, pulling only when it is not local. A record that
only has a tag runs the local image; if that is gone too, setup stops
rather than pull a possibly newer one.
Signed-off-by: Guanzhou Song <[email protected]>
Make image reuse and exact-image downloads visible before and after recreation, while retaining completed setup details and truthful legacy fallbacks.
Co-authored-by: Copilot <[email protected]>
Added commit 5caea70 to make recreation's behind-the-scenes work understandable before and after it runs:
Configure: recreation-specific wording and action, with an explanation of the saved image. Legacy tag-only records do not promise an exact original image.
Progress: “Preparing image” reports whether the saved/local image was reused without downloading or the exact saved image was downloaded.
Done: keeps the completed stage list and expandable Details, plus a concise success-box summary of confirmed data/credential reuse, image handling, and the running server's DocumentDB version when available. Users can review the evidence or simply read the summary.
This makes clear what will happen and what actually happened, without adding another confirmation dialog. Regression tests, localization, and related docs were updated.
Validation: Case 1 passed (build, 556 targeted tests, 47 browser-scenario tests). All Case 2 commands passed: l10n, prettier-fix, l10n:check, lint, build, typecheck:tests, full Vitest (9,420 passed; 1 skipped), and package. Packaging emitted non-fatal dependency/CSS warnings. No real-container or manual UX testing was performed. The separate committed AI pre-review/author-decision record required by CONTRIBUTING §6 is still absent; these check results do not replace that review.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Container recreation still relies on mutable tags or stale, unverified image pins, allowing incompatible images to run against existing volumes and risking irreversible upgrades or unsafe downgrades.
This PR adds safeguards to Local Quick Start in the DocumentDB extension for Visual Studio Code, aiming to prevent container recreation from unintentionally upgrading existing data.
Changes:
Records running-image digests and distinguishes exact-image reuse from legacy local-tag reuse.
Updates recreation guidance, progress messages, success summaries, and documentation.
Adds runtime, service, router, and UI regression coverage, with updated browser scenarios.
A pin kept from an earlier container goes stale once a replacement has run a newer image on the data, and a recreate would then start the older image on upgraded data.
Signed-off-by: Guanzhou Song <[email protected]>
A recreate that finds the old container still there removed it before anything recorded its image, so a tag-only record could then start a newer local image on the data.
Signed-off-by: Guanzhou Song <[email protected]>
Running the tag let it move between the check and docker run, or be pulled implicitly if it was gone, either of which can start a newer image on the data.
Signed-off-by: Guanzhou Song <[email protected]>
… empty
An engine hiccup made setup say the image was gone and suggest pulling it, which would replace a local image the data can still run.
Signed-off-by: Guanzhou Song <[email protected]>
Tomasz Naumowicz (@tnaum-ms) Reviewed and accepted 5caea70, thanks. It works with the later fixes: the image disposition is computed after the replaced container's image is pinned.
Copilot's four findings are fixed (09f231a, 0caa008, 7b10ce2, 6e881cd) and recorded in iterations/15-recreate-image-pin-review.md. Those pushes dismissed your approval, so could you take another look?
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Recreation can follow mutable image tags and irreversibly upgrade existing volumes when image inspection fails, digest persistence is delayed, or a volume reappears during a pull.
An inconclusive digest inspection (undefined) triggers a registry pull even when the saved image is cached, so an offline recreation can fail unnecessarily. It is also reported as downloadedPinned at QuickStartService.ts:1266, even if the pull transfers nothing. Distinguish confirmed absence from inspection failure before pulling, and report a download only when that outcome is established.
Update recreation announcements to match the recreation action
On recreation, the Configure announcer still tells users to start DocumentDB Local, and the provisioning announcer still says “Setting up DocumentDB Local.” These announcements do not match the new Recreate container action and recreation status. Choose the messages using isRecreate and recreating at LocalQuickStart.tsx:2517–2521, and regenerate the localization bundle.
Restore completed stage facts when resuming recreation
After a readiness timeout, reopening the panel restores stage statuses but not their facts, and waitLonger only emits waiting-stage facts. A successful resumed recreation therefore falls back to “All set” and loses the saved-image outcome and completed-stage details. Retain the completed facts with the resumable operation and restore them when the panel opens or resumes.
Review result: there are valid issues to address before merge.
High — data safety (QuickStartService.ts:1107–1124): if the existing container inspection or image pin fails, the code still removes that container and can fall back to its mutable saved tag. The non-quiet inspection is also unbounded/non-cancellable, and cancellation is not checked before removal.
High — data safety (QuickStartService.ts:1191–1215, 1294–1305): when a tag is pulled while the volume is absent, a volume restored during the pull is accepted because the later guard excludes reusing; the pulled image can then run against that data.
High — pin durability (QuickStartService.ts:1437, 1725–1734): the discovered digest is only persisted after readiness succeeds. Discarding a timed-out recreation can remove the container but keep the volume and mutable tag record.
Medium — truthful image status (QuickStartService.ts:1253–1267): an inconclusive image inspection can still lead to a pull and be reported as downloadedPinned, even if the image was already local.
Medium — screen-reader wording (LocalQuickStart.tsx:2517–2521): Configure and provisioning announcements still say “start” / “setting up” during recreation.
Medium — resumed details (QuickStartService.ts:1800–1821, LocalQuickStart.tsx:1000–1041): reopening after a readiness timeout loses earlier stage facts; resume emits only waiting-stage events, so the success summary/details cannot recover the saved-image outcome.
The optional telemetry classification suggestion is useful but not a merge blocker; I would defer it. This was static review only; I did not run a reproduction or test against real containers. The PR CI run #3649 passed. The unrelated Dependabot quarantine run failed because the quarantine and ready-to-merge labels are missing.
Podman empties RepoDigests once the tag points elsewhere, so an instance still running an older DocumentDB was never pinned and a recreate could start the newer tag on its data.
Signed-off-by: Guanzhou Song <[email protected]>
An image with no digest fell back to the tag, and a failed inspect still removed the container. Run the container's own image by ID, and stop before removal when the inspect fails and the record names only a tag.
Signed-off-by: Guanzhou Song <[email protected]>
A recreate that failed readiness left the tag in the record, so a retry could follow it after it moved.
Signed-off-by: Guanzhou Song <[email protected]>
A run that replaced an earlier attempt's provisioning record deleted it on failure, taking the only credentials for the reused volume.
Signed-off-by: Guanzhou Song <[email protected]>
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
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.
Recreate container reuses the image reference stored for the instance, normally the floating
documentdb-local:latest, and pulls it again.latestis now DocumentDB 1.2, which updates the extensions on an existing data volume at startup, and going back to 1.0 on that data isn't supported. So a user who removes the container to apply a new telemetry level, as the user manual says to, gets their data upgraded for good while setup says the image was kept. Start, Stop and Restart are not affected.Pinning the default tag would only help new instances, since every existing record already stores
:latest. So the record now keeps the image's repo digest, read from the container at setup, on every reconcile, and before a recreate removes the old container. A recreate runs that digest, pulling it only if the image was pruned, with the instance's recorded engine.An older record that only has a tag runs the local image without pulling. If that image is gone too and the volume still exists, setup stops and explains that pulling may upgrade the data; the user can pull it and retry. Configure, the Preparing image stage and the ready page say which image was reused or downloaded, and don't promise the exact original image for a tag-only record. An in-place upgrade path is left for later.
Also corrects two comments: DocumentDB Local supports
serverStatusfrom 1.2.Tested with unit and browser-scenario tests; nothing was run against real containers.