internal/migration-manual-test-plan.md
Goal: validate that a legacy (non-bare) git cache and any SDK references are migrated correctly, and that this branch still operates the cache and SDKs after migration.
Use the scripted validator when you want the full flow with built-in assertions:
# Full validation + automatic cleanup
./scripts/manual-migration-test.sh --cleanup
Useful variants:
# Keep cache for manual inspection
./scripts/manual-migration-test.sh
# Force a specific release version instead of auto-detecting the 2nd latest stable
./scripts/manual-migration-test.sh --release-version 3.41.3
Script behavior:
.context/tmp/fvm-migration-cache).context/tmp/ (including migration output and fsck output)fvm version after running# Use an isolated cache so we do not touch your global ~/.fvm
export FVM_CACHE_PATH="$(pwd)/.context/tmp/fvm-migration-cache"
export FVM_USE_GIT_CACHE=true
git --version
dart --version
fvm --version
Expected:
rm -rf "$FVM_CACHE_PATH"
mkdir -p "$FVM_CACHE_PATH"
Expected:
$FVM_CACHE_PATH exists and is emptyUse a version prior to 4.0.2 to create a non-bare git cache.
# Legacy FVM (non-bare git cache)
dart pub global activate fvm 4.0.1
fvm --version
Pick versions:
Recommended way to select versions:
# Latest stable channel
fvm api releases --filter-channel stable --limit 1 --compress
# Latest beta channel
fvm api releases --filter-channel beta --limit 1 --compress
# Latest 2 stable releases (use the 2nd one as a "release" version)
fvm api releases --filter-channel stable --limit 2 --compress
Install the three versions (examples only; replace with real versions):
fvm install stable
fvm install 3.xx.y
fvm install beta
Expected:
$FVM_CACHE_PATH/versions/ contains stable, the release version, and beta$FVM_CACHE_PATH/cache.git exists and is a non-bare repoVerify legacy cache state:
git -C "$FVM_CACHE_PATH/cache.git" config --bool core.bare
Expected:
falseVerify alternates files exist (created by --reference clones):
find "$FVM_CACHE_PATH/versions" -path '*/.git/objects/info/alternates' -print -exec cat {} \;
Expected:
.git/objects in path)The migration logic lives on this branch (not in published FVM releases). From the repo root:
dart pub get
# Trigger EnsureCache -> ensureBareCacheIfPresent -> _migrateCacheCloneToMirror
FVM_CACHE_PATH="$FVM_CACHE_PATH" FVM_USE_GIT_CACHE=true \
dart run bin/main.dart install stable
Expected migration log messages:
Migrating cache clone to bare mirror...Creating bare mirror from local clone...Legacy cache migrated to bare mirror successfully!Updated alternates for <version> -> .../cache.git/objects (one per installed version)Note: A warning
Failed to setup local cache. Falling back to git clone.may appear after migration ifupdateLocalMirror()fails on the freshly converted bare repo. This does not affect migration correctness.
Verify migrated cache state:
git -C "$FVM_CACHE_PATH/cache.git" config --bool core.bare
Expected:
trueVerify alternates were rewritten to bare mirror path:
find "$FVM_CACHE_PATH/versions" -path '*/.git/objects/info/alternates' -print -exec cat {} \;
Expected:
.../cache.git/objects (no /.git/ in the path)Verify repository integrity:
git -C "$FVM_CACHE_PATH/cache.git" fsck --connectivity-only
Expected:
Verify list still works:
FVM_CACHE_PATH="$FVM_CACHE_PATH" FVM_USE_GIT_CACHE=true \
dart run bin/main.dart list
Expected:
"$FVM_CACHE_PATH/versions/stable/bin/flutter" --version
"$FVM_CACHE_PATH/versions/3.xx.y/bin/flutter" --version
"$FVM_CACHE_PATH/versions/beta/bin/flutter" --version
Expected:
rm -rf "$FVM_CACHE_PATH"
Expected: