Cover computeReleaseInfo: channel selection, assisted gating, migration fallback - #864
Merged
Merged
Conversation
…on fallback apps/server/src/release-info.ts owned the assistedRequired classification for the update path but had no direct tests (release-auto-check.test.ts mocks it away). Adds 24 tests pinning the deriveCurrentTag store/semver chain, stable-vs-latest channel selection with the gh-failure git-tag fallback, updateAvailable classification, assisted metadata parsing through the real release-metadata module (required/recommended/ appliesFrom/malformed-fence hard failure), pending-migration summary mapping and evaluator-crash degradation, and progress emission ordering with the finally-null contract. 7-mutant battery: 7/7 killed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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
apps/server/src/release-info.tsowns theassistedRequiredclassification for the update path but had zero direct coverage —release-auto-check.test.tsmockscomputeReleaseInfoaway entirely. This was the top-ranked gap from the last test-enforcer coverage audit.Adds
apps/server/test/release-info.test.ts(24 tests, no product code changes):v-prefix fallback from app version, plain-semver regex rejection of prerelease versions, null when nothing is known.absoluteLatestTagkeeps the newest overall; latest channel takes prereleases; unknown channel settings coerce to stable; all-prerelease stable case yieldslatestTag: null;gh release listfailure falls back to sorted local git tags with thev-prefix filter.release-metadataparser: required mode forcesassistedRequired, recommended does not,appliesFromabove the current install skips the gate, and a malformeddispatch-updatefence hard-fails withok: falsebefore any tarball work.toSummary(no manifest internals leak), per-file errors join intomigrationsError, an evaluator crash degrades intomigrationsError+assistedRequiredinstead of a failed result, and no evaluation runs when no update is available.finally emit(null)contract on both success and failure paths.All I/O boundaries are mocked (
runCommand, settings, release store, evaluator) — nothing can touch real git/gh/network/~/.dispatch.Validation
pnpm run check✅ · server unit suite 2390 passed / 8 skipped ✅ · web 541 ✅ · E2E 175 passed / 12 skipped ✅ · live lane 11 passed, zero leaked tmux sessions ✅vi.resetAllMocks, fully-typed evaluator payloads viasatisfies PendingMigrationsResult), nits applied.🤖 Generated with Claude Code