fix(static_helpers): allow full github tag#7463
Conversation
3cdc42a to
d1c2d5d
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where mise incorrectly prepended a 'v' prefix to monorepo-style GitHub version tags containing '@' symbols (e.g., protoc-gen-elixir-grpc@v0.4.0), causing 404 errors when trying to fetch releases.
Key Changes:
- Added detection for full release tags containing
@vor@[digit]patterns to prevent automatic 'v' prefix addition - Modified version resolution logic to try full tags as-is without modification
- Enhanced error messages to clarify when tags are used without modification
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/backend/static_helpers.rs | Introduced FULL_TAG_PATTERN regex and looks_like_full_tag() function to detect complete release tags; updated try_with_v_prefix() to handle full tags without adding 'v' prefix; added comprehensive unit tests |
| e2e/backend/test_github_monorepo_version_tags | Added end-to-end test verifying correct behavior with monorepo-style version tags from the bug report scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
05d6c76 to
37091f4
Compare
|
@jdx what is the reason to care about the tag syntax at all when using GitHub? |
2bbaa79 to
e6415a7
Compare
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
e6415a7 to
87974e0
Compare
|
@jdx this one is passing now, could you give me a hand here. I added the unit test to showcase the situation. |
| /// Regex pattern for detecting full release tags (e.g., "name@v1.0.0", "tool@2.0.0", "tool@beta") | ||
| /// Matches @ followed by any non-whitespace characters, indicating a scoped/tagged version |
There was a problem hiding this comment.
I am just making this to work for myself, I wonder if there is a better way, honestly, I feel mise shouldn't make assumption around the tagging (such as enforcing the v* or SemVer neither)
| } else if looks_like_full_tag(version) { | ||
| // Version already contains version-like patterns (e.g., "name@v1.0.0") | ||
| // Don't add v prefix - the tag is already complete as specified | ||
| vec![version.to_string()] |
There was a problem hiding this comment.
I don't understand this PR, it is checking both variants without this change so it should work.
|
Close this, #7391 has been merged with provides the proper way to do this now |
Signed-off-by: Yordis Prieto yordis.prieto@gmail.com
Context
When installing tools from GitHub repositories that use monorepo-style version tags (e.g.,
protoc-gen-elixir-grpc@v0.4.0), mise incorrectly prepended avprefix, resulting in the wrong tag being requested:ml
Before the fix:
vprotoc-gen-elixir-grpc@v0.4.0❌ (404 Not Found)protoc-gen-elixir-grpc@v0.4.0✅