* chore: prepare v4.1.0 release
* fix: drop git fsck from mirror refresh hot path
The bare-mirror refactor (#1018) ran `git fsck --connectivity-only` on
every cache update, which walks the entire object graph. On Windows that
push the test job past its 30 min timeout. Restore the 4.0.x behaviour:
fetch first, only fall back to fsck as part of recovery on fetch failure.
Surface the integrity check explicitly via `fvm doctor` so users still
have a way to validate the mirror.
* test: drop redundant install tests to speed up unit suite
The unit `test-os` job is doing real Flutter SDK clones that overlap
heavily with the dedicated integration-test job. Trim the dupes.
- Delete `version_format_workflow_test.dart`: soft-skips on every CI
runner (Flutter not in PATH), and its error helper warned-instead-of-
failed when commands unexpectedly succeeded. Effective coverage: zero.
- Drop the `Install command flags` group in `enhanced_install_test.dart`:
--setup is already exercised by `install_command_test.dart`, and the
--skip-pub-get / both-flags tests only assert exitCode and cache
presence — not that the flag actually changed behaviour.
- Drop the `Install version formats` group in the same file: v-prefix
parsing is unit-tested in `version_format_test.dart`; channel-suffix
versions are covered by 2.2.2@beta/2.2.2@dev in
`install_command_test.dart`; and the f4c74a6ec3 commit hash is an
exact duplicate.
Estimated Windows savings: ~7 min off the unit job.
* test: add install flag and version format coverage
Restore install command flag/format tests and add a version format
workflow integration test exercising channels, semver, forks, and aliases.
* test: prime the shared git mirror that the test suite reads from
`tool/grind.dart` was running `fvm install stable` against the user's
default cache config, which warms `~/fvm/cache.git` — a different path
than the shared `~/fvm_test_cache/gitcache` declared in
`test/testing_utils.dart`. The test mirror was never primed, so any test
that called `FlutterService.install()` directly (bypassing
`ensure_cache.workflow.dart`) hit an empty cache, fell back to a full
remote Flutter clone, and burned multiple minutes on Windows.
Replace the misleading `fvm install stable` with `tool/prime_test_cache.dart`,
a small entry point that builds an `FvmContext` pointed at the test mirror
path and calls `GitService.updateLocalMirror()` — same FVM primitive, no
env-var override, no raw `git clone --mirror`. Extract the test mirror path
into the shared helper so the prime script and `testing_utils.dart` agree
on a single source of truth.
* ci: bump test-os timeout to 45m and harden verifyMirrorIntegrity
Final review before tagging 4.1.0:
- Move `_isBareRepository` inside the try/catch in
`verifyMirrorIntegrity`. The helper throws `ProcessException` when the
directory exists but is not a git repository (because
`ProcessService.run` defaults to `throwOnError: true`); catching it
maps that case to `false` so `fvm doctor` reports "Corrupt" instead of
crashing.
- Bump `test-os` `timeout-minutes` 30 -> 45. With the fsck regression
fixed and the test mirror primed (4 -> 0 fallback warnings on every
platform), Windows is genuinely ~27m of test work; matching the
existing 45/60 budgets used by `integration-test`/`migration-test`
gives ~18m of headroom for runner variance.
* fix: pin git clone working directory in FlutterService._cloneSdk
`runGit` was being invoked without `processWorkingDir`, causing the spawned
git process to inherit Dart's `Directory.current`. Under concurrent test
execution (or any caller that mutates cwd), git could be left without a
valid working directory mid-clone and fail with "Unable to read current
working directory: No such file or directory" / "remote did not send all
necessary objects" - even when the clone payload had downloaded fully.
Pin the clone process cwd to `versionDir.parent` (created up front) so
git's working directory is always present and owned by the operation in
flight.
* Revert "test: prime the shared git mirror that the test suite reads from"
This reverts commit 3448624c933a1f7d577f297ae584f2f6e809cedc.
* chore: drop verifyMirrorIntegrity and the doctor cache section
Scope creep added alongside the fsck hot-path fix. Removing now to keep
4.1.0 minimal: the production fix is the fsck removal in
_refreshExistingMirror; the integrity helper and doctor section were
not requested. Users who hit cache corruption will still get the
existing recovery (fetch failure -> repair -> recreate) on the next
install.
* test: restore version_format_workflow_test.dart in dart_test.yaml paths
The file was re-added on disk in b2703eca but its path entry was not
restored, leaving it as an orphan that never runs. Add it back to the
paths list to match the on-disk reality. Soft-skips on CI (Flutter not
in PATH), so zero CI cost.