Skip to content

Add prerelease version support with alpha/beta/rc tags#32

Open
disintegrator wants to merge 2 commits intomainfrom
claude/implement-spec-feature-Th30j
Open

Add prerelease version support with alpha/beta/rc tags#32
disintegrator wants to merge 2 commits intomainfrom
claude/implement-spec-feature-Th30j

Conversation

@disintegrator
Copy link
Owner

Summary

This PR adds comprehensive prerelease version support to Bumper, enabling release groups to publish unstable versions (alpha, beta, rc, etc.) before graduating to stable releases. The implementation includes new CLI commands, state management, and seamless integration with existing bump workflows.

Key Changes

  • New bumper pre command group with three subcommands:

    • bumper pre enter <group> --tag <tag>: Enter prerelease mode for a release group
    • bumper pre exit <group>: Exit prerelease mode and graduate to stable release
    • bumper pre status [group]: Show current prerelease state
  • Prerelease state management via .bumper/prerelease.toml:

    • Tracks tag, base version (from_version), and counter for each group
    • Minimal state file for easy version control integration
  • Modified bump file lifecycle:

    • During prerelease, processed bump files are moved to .bumper/prerelease/ instead of deleted
    • Enables CI/CD triggers based on file changes
    • On pre exit, all accumulated changes are consolidated into a single stable changelog entry
  • Intelligent version calculation:

    • Bump levels (major/minor/patch) dictate the target version, not naive counter increments
    • Accumulates bump levels from both processed and pending bumps
    • Resets counter when base version escalates, increments otherwise
    • Supports tag switching mid-prerelease while preserving base version
  • Enhanced bumper commit behavior:

    • Detects prerelease mode and calculates prerelease versions accordingly
    • Moves bump files to prerelease directory for groups in prerelease mode
    • Updates prerelease state (counter) after each commit
    • Remains a no-op when no pending bumps exist
  • Append-only changelog design:

    • Prerelease entries remain in history for full audit trail
    • Stable release entry consolidates all changes from prerelease cycle
    • Provides both detailed history and consolidated view for consumers

Implementation Details

  • New workspace/prerelease.go module handles all prerelease state operations
  • New commands/pre/ package with enter, exit, and status subcommands
  • Prerelease version calculation uses semantic versioning with proper escalation logic
  • Supports multiple groups in prerelease simultaneously with different tags
  • Full integration with existing config, git, and changelog systems
  • Comprehensive specification document (SPEC.md) included for reference

https://claude.ai/code/session_01UtmkqyhJFRtM8cgWD6dh3y

Implements the prerelease feature as specified in SPEC.md:

- Add `bumper pre enter <group> --tag <tag>` command to enter prerelease mode
- Add `bumper pre exit <group>` command to graduate to stable release
- Add `bumper pre status [group]` command to show prerelease state
- Modify `bumper commit` to handle prerelease mode:
  - Move bump files to .bumper/prerelease/ instead of deleting
  - Calculate prerelease versions based on accumulated and pending bumps
  - Update prerelease counter in state file

State management:
- Prerelease state tracked in .bumper/prerelease.toml
- Stores tag, from_version, and counter per group
- State file is removed when no groups are in prerelease

Version calculation:
- Bump levels dictate the base version from from_version
- Counter resets when base version escalates, increments otherwise
- Supports tag switching mid-prerelease (resets counter)

https://claude.ai/code/session_01UtmkqyhJFRtM8cgWD6dh3y
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.

2 participants