Repository navigation
Sort -alpha, -beta and -rc tags below their release - #158
Merged
Merged
Conversation
GetTagsAsync set versionsort.suffix with four separate git config calls, each of which overwrote the last, so only -pre survived. A v1.2.3-rc.1 tag then sorted above v1.2.3, and the version calculator and changelog took the release candidate as the latest release. Every call also rewrote the repository's .git/config. Pass the suffixes as repeated -c options on the tag listing instead. They accumulate for that one invocation and nothing is written to config. Also mark -rc versions as GitHub prereleases. Fixes #153 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EmfGBmvKNA36fj7HFaVgb
|
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.



Fixes #153
Problem
GitService.GetTagsAsyncrangit config versionsort.suffix "<s>"once for each of-alpha,-beta,-rcand-pre. Each call replaced the previous value, so only-prewas kept. That caused three problems:v1.2.3-rc.1sorted abovev1.2.3, soVersionCalculatorandChangelogGenerator, which both readtags[0], took the release candidate as the latest release..git/config, including on developer checkouts.ReleaseServicedid not treat-rcas a prerelease, so an RC was published as a full GitHub release.Change
GetTagsAsyncnow runs a singlegit -c versionsort.suffix=-alpha -c versionsort.suffix=-beta -c versionsort.suffix=-rc -c versionsort.suffix=-pre tag --list --sort=-v:refname. Repeated-coptions accumulate for that one invocation, and nothing is written to config. The argument string isGitService.ListTagsArguments, and the pipeline test's fake runner now matches on it.ReleaseServicealso marks-rcversions as prereleases.Tests
GetTagsAsync_RealRepository_SortsPrereleaseBelowItsRelease(rc/alpha/beta/pre) runs against a real temporary git repo with tagsv1.2.2,v1.2.3-<label>.1andv1.2.3. It asserts the orderv1.2.3, then the prerelease, thenv1.2.2, and that noversionsort.suffixends up in the repo config.GetTagsAsync_PassesEveryVersionSortSuffixWithoutWritingConfigreplaces the old test, which asserted the fourgit configcalls.ExecuteReleaseAsync_DetectsPrerelease_ReleaseCandidate.With the fix reverted, the rc/alpha/beta sort cases and the RC-prerelease test fail. With the fix, the full suite passes (748/748).
🤖 Generated with Claude Code
https://claude.ai/code/session_011EmfGBmvKNA36fj7HFaVgb
Generated by Claude Code