Skip to content

v0.1.4: --prerelease CLI flag on update + update check#8

Merged
StuartMeeks merged 1 commit into
mainfrom
update-prerelease-flag
May 23, 2026
Merged

v0.1.4: --prerelease CLI flag on update + update check#8
StuartMeeks merged 1 commit into
mainfrom
update-prerelease-flag

Conversation

@StuartMeeks

@StuartMeeks StuartMeeks commented May 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds --prerelease to update and update check so downstream apps (e.g. pl-app) can opt into prerelease tags for one command invocation without touching the DI-registered SelfUpdaterOptions.IncludePrereleases default. Absence of the flag preserves today's behaviour exactly.
  • Threads a bool? includePrereleasesOverride through the source-query chain (IUpdateSource.GetLatestAsyncIUpdateChecker.CheckAsyncISelfUpdater.GetLatestReleaseAsync) as default interface methods, so existing external IUpdateSource implementers compile unchanged. null defers to the source's captured default; true/false force inclusion or exclusion.
  • The update-check cache now keys on (channel, includePrereleases) so a --prerelease answer doesn't pollute the next default update check (and vice versa). v0.1.3 cache files read as non-prerelease — matches their actual provenance.

Why DIM over modifying interface signatures inline?

v0.1.3 set a precedent for inline parameter additions (onConflict on ISelfUpdater.InstallAsync), but the README bills IUpdateSource as the primary extension point. Breaking it on a patch bump risks downstream churn that a DIM avoids. External implementers can opt into the new overload later if they want to honour the flag.

Out of scope (deliberately)

  • Extending the parameterless ISelfUpdater.InstallAsync(progress, ct) for symmetry — CLI doesn't use that path (TOCTOU-safe GetLatestReleaseAsync + InstallAsync(release, ...) instead). Can be added later if a library caller needs it.

Test plan

  • dotnet build — clean (TreatWarningsAsErrors=true).
  • dotnet test — 171 passing (was 164; 7 new).
    • Command-level: flag-on/flag-off override plumbing for both update and update check.
    • Source-level: HttpGitHubReleaseSource hits /releases (not /releases/latest) when includePrereleasesOverride: true even if constructed with includePrereleases: false.
    • Checker-level: cache key isolation between default and prerelease answers.
  • dotnet build -c Release — produces NextIteration.SpectreConsole.SelfUpdate.0.1.4.nupkg + .snupkg in artifacts/packages/.
  • Maintainer to verify against a downstream consumer (e.g. pl-app update check --prerelease against a repo with an RC tag) before cutting the release.
  • Maintainer to publish to NuGet.

🤖 Generated with Claude Code

@StuartMeeks StuartMeeks changed the title v0.1.4: --prerelease CLI flag on update + update check v0.1.4: --prerelease CLI flag + PreservePaths migration note May 23, 2026
Adds a per-invocation `--prerelease` opt-in to the `update` and
`update check` commands. Downstream apps (e.g. pl-app) need a way to
test RC builds at the CLI without flipping the DI-registered
`SelfUpdaterOptions.IncludePrereleases` default. Absence of the flag
preserves today's behaviour exactly.

The override threads through the source-query chain alongside the
existing `channel` parameter. To keep `IUpdateSource` (the README's
"primary extension point") backward-compatible, the new overload on
`IUpdateSource`, `IUpdateChecker`, and `ISelfUpdater` is added as a
default interface method that delegates to the existing one — external
implementers compile unchanged; they only override the new overload if
they want to honour `--prerelease`. `null` defers to the source's
captured default; `true`/`false` force inclusion or exclusion.

Cache change: the per-user JSON cache now keys on
`(channel, includePrereleases)` so a `--prerelease` answer doesn't
pollute the default `update check` cache, and vice versa. v0.1.3 cache
files (missing the new field) are read as non-prerelease — matches
their actual provenance, no migration needed.

Tests: 7 new (164 → 171, all green). Covers flag-on/flag-off override
plumbing for both commands, source endpoint switching on override, and
cache key isolation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@StuartMeeks StuartMeeks force-pushed the update-prerelease-flag branch from c76efd7 to a396d6c Compare May 23, 2026 04:35
@StuartMeeks StuartMeeks changed the title v0.1.4: --prerelease CLI flag + PreservePaths migration note v0.1.4: --prerelease CLI flag on update + update check May 23, 2026
@StuartMeeks StuartMeeks merged commit d3d7d8c into main May 23, 2026
4 checks passed
@StuartMeeks StuartMeeks deleted the update-prerelease-flag branch May 23, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant