Skip to content

Native versioning Phase 3 — bv version command #233

Description

@rdeago

Sub-issue of #229. Depends on Phase 1.

Expose version inspection and advancement as a first-class bv command, independent of the release workflow.

Scope

  • Add bv version show and bv version advance <major|minor|stable|unstable>.
    • show prints: current version string, latest version, latest stable version, IsPublicRelease, IsPrerelease, current branch. A --json flag would dump the same data as a machine-readable object (consider for follow-up if scope grows).
    • advance loads VersionFile, applies ApplyVersionSpecChange(kind), saves version.json. A --commit flag (off by default) creates a commit with a conventional message; without it, the file is modified on disk for the user to review and commit manually.
  • CLI shape depends on the state of the Cake.Frosting removal proposal:
    • If Cake is still in place: add flat tasks VersionShowTask / VersionAdvanceTask (CLI: bv version-show, bv version-advance <kind>). The current CommandLineParser does not support bv <task> <subcommand>.
    • If Cake has been removed (i.e., if Drop Cake.Frosting from Buildvana.Tool #228 has been completed): add a Spectre.Console.Cli branch command (bv version show, bv version advance <kind>) with shared settings for --verbosity etc.
    • The underlying logic is identical in both cases; only dispatch differs.
  • Reuse the existing VersionFile.ApplyVersionSpecChange and VersionService.ComputeVersionSpecChange without modification where possible.
  • Add help text and usage examples consistent with the rest of bv's help output.

Acceptance criteria

  • dotnet bv version show (or version-show) prints the current version info without needing nbgv installed.
  • dotnet bv version advance minor (or version-advance minor) rewrites version.json with the bumped spec; subsequent bv version show reflects the change.
  • --commit creates a well-formed commit when passed; absent the flag, the working tree is modified and left for the user.
  • No regression in bv release, which internally invokes the same underlying version-advance logic.

Metadata

Metadata

Assignees

Labels

area:code[issue/PR] affects project code (excluding tests).area:deps[issue/PR] adds, updates, or removes dependencies.enhancement[issue/PR] requests / implements new or improved functionality.refactor[issue/PR] requests / implements a refactor of existing code without affecting functionality.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions