Skip to content

Fix #195: make TAG_VERSION_PATTERN's tag prefix configurable - #202

Merged
gnodet merged 2 commits into
mainfrom
fix-195-make-tag_version_pattern-s-tag-prefix-co
Aug 25, 2026
Merged

gnodet merged 2 commits into
mainfrom
fix-195-make-tag_version_pattern-s-tag-prefix-co

Conversation

@gnodet

@gnodet gnodet commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds nisse.source.jgit.tagPrefix property to configure the tag prefix used when matching version tags. Default is empty (preserving the existing v? behavior). Setting it to e.g. jline- matches tags like jline-3.28.0.
  • Logs at INFO level when tags exist but none match the configured pattern, with a hint about the tagPrefix property. This addresses the silent fallback to 0.1.0 that confused new adopters.
  • Adds unit tests for buildTagVersionPattern() and integration tests verifying dynamic version resolution with prefixed tags.

Test plan

  • testBuildTagVersionPatternDefault — verifies empty/null prefix returns the original TAG_VERSION_PATTERN
  • testBuildTagVersionPatternCustomPrefix — verifies jline-, release-, camel- prefixes match correctly
  • testBuildTagVersionPatternWithQualifier — verifies qualifier extraction (e.g. -rc1) still works with custom prefix
  • testTagPrefixDynamicVersion — end-to-end: without prefix falls back to 0.1.0, with tagPrefix=jline- resolves from jline-1.0.0 tag
  • testTagPrefixExactMatch — HEAD is on a prefixed tag, version resolves exactly
  • All 39 existing tests pass (no regressions)

Closes #195

🤖 Generated with Claude Code

Add nisse.source.jgit.tagPrefix property to allow projects with
non-standard tag formats (e.g. jline-3.28.0, camel-4.8.0) to
configure the prefix used when matching version tags.

When empty (default), the existing v? behavior is preserved.
When set (e.g. tagPrefix=jline-), only tags with that prefix
are matched.

Also log at INFO level when tags exist but none match the
configured pattern, with a hint about the tagPrefix property.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 21 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 36a28909-ae28-44ad-829e-4ec989b1f93e

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea9f8d and 8fe47dc.

📒 Files selected for processing (2)
  • sources/jgit-source/src/main/java/eu/maveniverse/maven/nisse/source/jgit/JGitPropertySource.java
  • sources/jgit-source/src/test/java/eu/maveniverse/maven/nisse/source/jgit/JGitPropertySourceTest.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Add testUnmatchedTagsFallbackToDefault which creates a repo with
multiple non-standard tags (release-1.0.0, camel-2.0.0) and verifies:
- without tagPrefix, version falls back to 0.1.0 (the INFO log path)
- with tagPrefix=camel-, the correct tag is resolved

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet marked this pull request as ready for review August 25, 2026 08:04
@gnodet
gnodet merged commit 6d52b7d into main Aug 25, 2026
17 checks passed
@gnodet
gnodet deleted the fix-195-make-tag_version_pattern-s-tag-prefix-co branch August 25, 2026 08:06
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.

TAG_VERSION_PATTERN silently ignores non-standard tag formats

1 participant