Repository navigation
Conversation
✅ Deploy Preview for devspace-docs canceled.Built without sensitive environment variables
|
Force remote-preferred archive extraction only during initial sync, restoring the normal newer-local-file guard afterward. Cover all initial-sync strategies and subsequent-download protection with a real downstream archive regression test, and clarify the public documentation. Fixes devspace-sh#3351 Signed-off-by: Ausoj <23554726+Ausoj@users.noreply.github.com>
Ausoj
force-pushed
the
fix/initial-sync-remote-overwrite
branch
from
November 9, 2026 18:23
f92beea to
c8eafb7
Compare
This branch has not been deployed
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
Fixes #3351.
mirrorRemoteandpreferRemoteselect the container's conflicting file, but the downstream unpacker has always been created withforceOverride=false. Its newer-local-mtime guard can therefore veto the selected download and leave the files different.This change enables
forceOverridefor those two strategies only whileSync.initialSyncruns, and resets it withdeferon both success and error. The normal watcher/download path keeps its existing protection for newer local edits.preferNewestand the other initial-sync strategies retain their existing behavior; no new option or dependency is introduced.Also included:
Validation
Before the fix,
TestInitialSyncRemotePreferencefails formirrorRemoteandpreferRemote(got "local", want "remote"); the other five strategy cases pass. With the fix, the entire sync package passes.Run with the vendored dependencies:
Both commands passed on macOS ARM64 with Go 1.25.9 (matching CI's Go 1.25 series) and 1.26.2. Go formatting and
git diff --checkalso pass. The full documentation-site build was not run; the documentation change uses the page's existing MDX admonition syntax and changes no generated reference files.Native CLI comparison against a disposable Colima/K3s pod, with an older remote file and a newer differing local file,
--download-only --no-watch, and no local timestamp workaround:mirrorRemotepreferRemotepreferNewestLocal-only-file handling also remained correct: deleted by
mirrorRemote, retained by the other two download-only configurations. Remote-only files were downloaded and remote contents were unchanged. The temporary namespace was deleted afterward; the installed CLI was not replaced.History
The source history and reproduction are detailed in #3351. The mtime guard predates the strategy feature. Commit
df377765(introduced through #983 in February 2020) added the strategies, includingpreferNewest, and theforceOverrideargument together, but left the downstream constructor's argument hard-coded tofalse. This supports a missing integration at strategy introduction, without assuming the original author's intent.