Skip to content

Auto increment version on creating release based on the latest version found in a git tag#26

Merged
darthsharp merged 17 commits intomainfrom
feature/versionautoincrement
Feb 15, 2026
Merged

Auto increment version on creating release based on the latest version found in a git tag#26
darthsharp merged 17 commits intomainfrom
feature/versionautoincrement

Conversation

@darthsharp
Copy link
Copy Markdown
Contributor

No description provided.

- Introduced `CreativeCoders.GitTool.Base` with `VersionBuilder` for managing semantic versions.
- Added `VersionAutoIncrement` enum to support automated version increment logic.
- Integrated new `.csproj` file for unit tests and updated the solution file with the new project reference.
…Tool.Base` into the test project

- Introduced `VersionBuilderTests` covering version parsing, validation, and increment logic.
- Updated solution to include `CreativeCoders.GitTool.Tests` project.
- Added project reference to `CreativeCoders.GitTool.Base` in the test project.
…code for enhanced versioning management.

- Introduce `VersionBuilder` improvements: return-chaining methods and better validation logic.
- Add `VersionUtils` for parsing and validating semantic versions.
- Enhance `CreateReleaseCommand` with auto-incremented version generation.
- Refactor tag commands with better error handling and messaging.
- Introduce `VersionFormatKind` and `VersionFormatException` for version handling.
- Upgrade `.NET` dependencies to match `CreativeCoders` version updates.
- Add CLI options validation for better user feedback.
- Introduce `ListVersionsCommand` to display version tags, with sorting options.
- Add `GitRepositoryExtensions` and `VersionTag` for improved version tag handling.
- Replace `CreateReleaseCommand`'s version tag fetching logic with reusable methods.
- Implement `VersionComparer` for semantic version comparison.
- Minor enhancements to `VersionBuilder` and `VersionUtils` for parsing and validation.
…eCommand`

- Introduced `ConfirmAutoIncrementVersion` option to validate user intent during version increment.
- Added return code for release creation abortion.
- Updated `VersionAutoIncrement` enum to reorder values for consistency.
…rement

- Extend `VersionBuilder` methods (`IncrementMinor`, `IncrementMajor`) to allow resetting lower parts.
- Introduce `ResetLowerVersionPartsOnAutoInc` option in `CreateReleaseOptions` for configurable behavior.
- Update `CreateReleaseCommand` to handle the new reset logic during version auto-increment.
…rsionBuilder`

- Added `VersionComparerTests` and `VersionUtilsTests` to validate version comparison, parsing, and normalization logic.
- Enhanced `VersionBuilder` with additional methods to increment versions without resetting lower parts.
- Updated `VersionBuilderTests` to include test cases for new methods and edge cases.
- Improved `VersionUtils.RemoveTrailingVersionPrefix` to handle empty or null inputs gracefully.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements auto-increment version functionality for release creation, allowing developers to automatically increment versions based on git tags rather than manually specifying version numbers. The PR introduces a comprehensive versioning system with utilities for parsing, comparing, and building semantic versions.

Changes:

  • Added versioning infrastructure including VersionBuilder, VersionComparer, and VersionUtils classes with comprehensive unit tests
  • Enhanced CreateReleaseCommand to support auto-increment via --increment flag (Major/Minor/Patch) with optional confirmation prompts
  • Added ListVersionsCommand to display all version tags in the repository with optional descending sort
  • Improved DeleteTagCommand to handle cases where tags don't exist locally but may exist remotely
  • Updated package dependencies across the solution (Microsoft.Extensions.* 10.0.2→10.0.3, CreativeCoders.* 6.5.0→6.6.0)

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/CreativeCoders.GitTool.Tests/CreativeCoders.GitTool.Tests.csproj New test project for versioning functionality with xunit, FakeItEasy, and AwesomeAssertions
tests/CreativeCoders.GitTool.Tests/Base/Versioning/VersionUtilsTests.cs Unit tests for version validation and prefix removal utilities
tests/CreativeCoders.GitTool.Tests/Base/Versioning/VersionComparerTests.cs Unit tests for semantic version comparison logic
tests/CreativeCoders.GitTool.Tests/Base/Versioning/VersionBuilderTests.cs Comprehensive tests for version building and increment operations
source/GitTool/CreativeCoders.GitTool.Base/Versioning/*.cs Core versioning classes: VersionBuilder, VersionComparer, VersionUtils, VersionTag, and supporting types
source/GitTool/CreativeCoders.GitTool.Cli.Commands/ReleaseGroup/Create/CreateReleaseOptions.cs Added auto-increment options with validation requiring either explicit version or increment specification
source/GitTool/CreativeCoders.GitTool.Cli.Commands/ReleaseGroup/Create/CreateReleaseCommand.cs Implemented auto-increment logic with tag fetching, version calculation, and optional user confirmation
source/GitTool/CreativeCoders.GitTool.Cli.Commands/ReleaseGroup/Create/VersionAutoIncrement.cs Enum defining increment types (Patch, Minor, Major)
source/GitTool/CreativeCoders.GitTool.Cli.Commands/ReleaseGroup/ListVersions/*.cs New command to list version tags with sorting options
source/GitTool/CreativeCoders.GitTool.Cli.Commands/TagGroup/Delete/DeleteTagCommand.cs Enhanced to check tag existence before deletion and provide informative messages
source/GitTool/CreativeCoders.GitTool.Cli.GtApp/Program.cs Added .UseValidation() to enable options validation framework
source/GitTool/CreativeCoders.GitTool.Base/ReturnCodes.cs Added return codes for LocalTagNotFound and ReleaseCreationAborted
GitTools.sln Added new test project to solution
*.csproj (multiple) Updated NuGet package versions across solution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/CreativeCoders.GitTool.Tests/Base/Versioning/VersionBuilderTests.cs Outdated
Comment thread source/GitTool/CreativeCoders.GitTool.Base/Versioning/VersionUtils.cs Outdated
Comment thread source/GitTool/CreativeCoders.GitTool.Base/Versioning/VersionUtils.cs Outdated
Comment thread tests/CreativeCoders.GitTool.Tests/Base/Versioning/VersionUtilsTests.cs Outdated
Comment thread source/GitTool/CreativeCoders.GitTool.Base/Versioning/VersionFormatException.cs Outdated
@darthsharp darthsharp merged commit 5c6702f into main Feb 15, 2026
6 checks passed
@darthsharp darthsharp deleted the feature/versionautoincrement branch February 15, 2026 09:59
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