fix: sanitize artifacthub version string for semver compliance#845
fix: sanitize artifacthub version string for semver compliance#845parthivsaikia wants to merge 5 commits intomeshery:masterfrom
Conversation
Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
Summary of ChangesHello @parthivsaikia, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where version strings from ArtifactHub, when prefixed with a 'v' (e.g., "v2022.06.14"), failed strict semantic versioning validation. By implementing a Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an important issue with semver compliance for versions from ArtifactHub by removing the 'v' prefix. The change is straightforward and uses strings.TrimPrefix effectively. My main feedback is regarding testing. While the fix itself is correct, it's not covered by automated tests. I've added a comment suggesting the addition of unit tests to ensure this fix is robust and to prevent future regressions. This will improve the overall quality and maintainability of the code.
Signed-off-by: PARTHIV PRATIM SAIKIA <parthivsaikia985@gmail.com>
|
Thank you for your contribution! @parthivsaikia 🎉 Let's discuss this PR during the Meshery Development Meeting today. Meshery Development Meeting | December 10th, 2025 |
leecalcote
left a comment
There was a problem hiding this comment.
@parthivsaikia, thanks for this. Will you provide numbers showing the before and after here? I'm concerned that while this change will be helpful to some models that it will be detrimental to others...
|
@leecalcote There are total 5 models affected by this change. Those are:
And this change doesn't introduce any detrimental effect to the other models. |
|
@parthivsaikia, why is this bug only affecting such a small number of models? |
|
@leecalcote only these models are failing because they don't follow the correct standard of versioning (e.g. 1.0.0). The maintainers have incorrectly added a prefix 'v' in the versions making it look like "v1.0.0". |
Description
This PR updates the ArtifactHub generator to sanitize upstream version strings. Specifically, it uses strings.TrimPrefix to remove the leading v (e.g., converting v2022.06.14 to 2022.06.14) before assigning it to the model version. This ensures compliance with the strict Semantic Versioning checks enforced by the Masterminds/semver library and resolves validation errors for valid upstream charts.
This PR fixes #843
Notes for Reviewers
Verified locally that the fix properly strips the prefix.
The change is isolated to generators/artifacthub/package.go.
Signed commits