Skip to content

Fix version prefix detection for libraries without v-prefix - #7

Merged
partouf merged 1 commit into
mainfrom
fix-version-prefix-detection
Aug 16, 2025
Merged

Fix version prefix detection for libraries without v-prefix#7
partouf merged 1 commit into
mainfrom
fix-version-prefix-detection

Conversation

@partouf

@partouf partouf commented Aug 13, 2025

Copy link
Copy Markdown
Member

Summary

  • Fixed incorrect target_prefix: v generation for libraries that don't use 'v' prefixes in their tags
  • Preserved user-friendly auto-detection when users type version numbers without prefixes

Problem

The ce-library-wizard was incorrectly generating target_prefix: v for libraries like FusedKernelLibrary that use tags like Beta-0.1.9 without any 'v' prefix. This was reported in compiler-explorer/infra#1755

Root Cause

The check_github_release_exists function was checking both with and without 'v' prefix when validating a specific tag. When checking if vBeta-0.1.9 exists, it would also check Beta-0.1.9, find it exists, and incorrectly return true.

Solution

  • Modified check_github_release_exists to only check the exact version specified
  • Added check_git_tag_with_fallback function for cases where we want user-friendly fallback behavior
  • The smart auto-detection still works: users can type 1.0.0 and it will correctly detect if the repo uses v1.0.0

Test Results

# FusedKernelLibrary (no v prefix)
determine_version_format('Beta-0.1.9') → prefix=None# nlohmann/json (uses v prefix) 
determine_version_format('3.11.2') → prefix='v'determine_version_format('v3.11.2') → prefix='v'

🤖 Generated with Claude Code

The check_github_release_exists function was incorrectly checking both
with and without 'v' prefix, causing false positives when determining
if a specific tag format exists. This led to incorrect target_prefix
generation for libraries like FusedKernelLibrary that don't use 'v'
prefixes in their tags.

Changes:
- Modified check_github_release_exists to only check the exact version
- Added check_git_tag_with_fallback for user-friendly version detection
- Preserved the smart auto-detection feature for user convenience

This fixes the issue where libraries without 'v' prefix were incorrectly
getting target_prefix: v in their configuration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@partouf
partouf merged commit 7759ca7 into main Aug 16, 2025
1 check passed
@partouf
partouf deleted the fix-version-prefix-detection branch August 16, 2025 13:48
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