Skip to content

Take only v-prefixed semantic version tags as releases [patch] - #248

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/217-version-tags-only
Oct 15, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/217-version-tags-only

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #217

Summary

GetTagsAsync returned every tag, and VersionCalculator and ChangelogGenerator took tags[0] as the last release. A wip-* tag sorts ahead of every v* tag, and an ios-v* tag is all a shallow tag-triggered checkout sees. Either one moved the version backwards (1.4.0 → 1.0.0) or turned the version into the tag name, and the run still exited 0.

  • GitService.GetTagsAsync now keeps only tags matching ^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?$ (GitService.IsVersionTag). It filters after listing, so the sort arguments are unchanged. Both callers, the version calculator and the changelog's previous-tag lookup, get the fix through this one method.
  • GitService.IsCommitTaggedAsync: decision for the issue's open checkbox. It now applies the same rule, so only a version tag on the commit marks it as already released. An ios-v* or wip-* tag no longer suppresses the release. It parses show-ref -d lines and peels ^{}, instead of searching the whole output for the hash as a substring. If you'd rather keep "any tag suppresses", revert that one hunk.

Tests (all in GitServiceTests)

  • Unit: [x-marker, wip-spike, v1.4.0, ios-v1.2.0, v1.4.0-rc.1, v1.3, v1.3.0] gives v1.4.0, v1.4.0-rc.1, v1.3.0. A list of only ios-v* tags gives an empty list.
  • Real repository, run through VersionCalculator: v1.3.0, v1.4.0, then wip-spike and ios-v1.2.0 on a later commit gives last tag v1.4.0. A repository whose only tag is ios-v1.2.0 falls back to v1.0.0-pre.0, and IsCommitTaggedAsync reports it as not released.
  • IsCommitTaggedAsync: a non-version tag on the commit gives false. A peeled annotated version tag gives true.
  • All 7 new cases fail against main's GitService.cs. The full suite passes: 875 passed, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PDfKv3rGKy33VQUkrTckdA


Generated by Claude Code

GetTagsAsync returned every tag, and the version calculator and changelog
took the first as the last release. A wip-* tag sorts ahead of every v* tag,
and an ios-v* tag is all a shallow tag-triggered checkout sees, so a stray
tag moved the version backwards or turned it into the tag's name, exit 0.

GetTagsAsync now keeps only tags matching v<major>.<minor>.<patch> with an
optional prerelease suffix. IsCommitTaggedAsync applies the same rule, so an
ios-v* or wip-* tag on the commit no longer suppresses its release.

Fixes #217

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDfKv3rGKy33VQUkrTckdA
@sonarqubecloud

Copy link
Copy Markdown

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.

Non-version tags (ios-v1.2.0, wip-spike) are taken as the last release, so the calculated version becomes the tag name or goes backwards

1 participant