Skip to content

Improve Version Management to Distinguish Between Development and Production Builds #36

@supitsdu

Description

@supitsdu

Currently, Clipper relies solely on Git tags to determine the version displayed using the -v flag. While this works well for production builds, it's not ideal for development environments where the codebase might not always be tagged.

This enhancement aims to provide a more informative and user-friendly approach to version management.

Proposed Changes:

  1. Development Version:
    • Introduce a default "dev" version string (e.g., "v0.0.0-dev") that is displayed when the code is run directly without being built (e.g., go run main.go).
    • Consider appending a timestamp or commit hash to the "dev" version for precise track of development builds.
  2. Build Version:
    • During the build process, continue using Git tags to determine the version if available.
    • If no tag is found, use a fallback version string (e.g., "v0.0.0-unreleased") to indicate that the build is not associated with a specific release.
  3. Display Logic:
    • Refactor the code to conditionally display the appropriate version based on whether the tool is running from a built binary or in development mode.

Goals:

  • Clarity: Provide clear and distinct version information to users, differentiating between development and production builds.
  • Flexibility: Allow developers to easily identify the specific version of the code they are running during development.
  • Maintainability: Make version management more robust and adaptable to different workflows.

Additional Considerations:

  • Configuration: Explore options to allow users to customize the development version string or override the default behavior.
  • Version Format: Decide on a standardized format for development versions (e.g., vX.Y.Z-dev+timestamp) to ensure consistency.

Metadata

Metadata

Assignees

Labels

enhancementNew feature requests or enhancements.versioningIssue or PRs related to version control

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions