Auto increment version on creating release based on the latest version found in a git tag#26
Merged
darthsharp merged 17 commits intomainfrom Feb 15, 2026
Merged
Conversation
- 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.
…, simplifying comparison logic.
…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.
…eateReleaseOptions`
There was a problem hiding this comment.
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.
… minor and patch increments
…IGitServiceProviders` and `MergeDevelopToMain` logic.
…across `VersionUtils` and associated tests.
… `CreateReleaseOptions` validation and update help texts for clarity.
…lid version formats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.