Skip to content

[vergo:patch-release]: fix NearestTag function to use exact prefix matching with regex patterns#30

Open
lpicanco wants to merge 1 commit intomasterfrom
fix.get-nearest-release.prefix
Open

[vergo:patch-release]: fix NearestTag function to use exact prefix matching with regex patterns#30
lpicanco wants to merge 1 commit intomasterfrom
fix.get-nearest-release.prefix

Conversation

@lpicanco
Copy link
Copy Markdown

@lpicanco lpicanco commented Oct 1, 2025

Fixed NearestTag function to use exact prefix matching with regex patterns instead of simple prefix checking.

This prevents false matches when tags have additional suffixes (e.g., searching for app-backend no longer incorrectly matches app-backend-kotlin-0.4.5).

@lpicanco lpicanco requested a review from chuckydev October 1, 2025 15:00
jsu03 added a commit that referenced this pull request Dec 16, 2025
Ensures functionality from: #30
@jsu03 jsu03 mentioned this pull request Dec 16, 2025
chuckydev pushed a commit that referenced this pull request Jan 12, 2026
* Improve performance of NearestTag function

    - fetch tags once: Get all tags upfront and build a hash map of commit_hash -> []tags
    - Filter by prefix first: Only consider tags with the matching prefix
    - Direct lookup: For each commit, directly check if it has any relevant tags
    - Performance is significantly improved for scenarios where it has to scan many commits to find the nearest tag

- Also allows NearestTag function to handle annotated tags correctly

* Add more prefixing tests

Ensures functionality from: #30
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.

1 participant