-
-
Notifications
You must be signed in to change notification settings - Fork 264
Cleans the version, as univers was rejecting the version with ':' #2055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| try: | ||
| v_obj = GentooVersion(version) | ||
| except Exception: | ||
| v_obj = GentooVersion(clean_ver(version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid general exceptions
|
|
||
| def clean_ver(v): | ||
| # removes ":something" which univers rejects | ||
| return v.split(":", 1)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain in more detail what the main error is there? If this is a univers bug, we can fix it in univers or we can ignore and log the invalid version if it truly is invalid.
I think we should not clean the version in VulnerableCode instead, we should use univers library to do this, or just log the invalid version and skip it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, yeah so according to me the versions having ':'were getting rejected, that's why I performed a cleaning sort of function. And yes I think we can use the fix in univers .
if you want then I can give it a try to fix the same in univers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arka-Saha OK, let's just log the invalid version without cleaning it so the importer can run without any issues . Then create an issue in the univers library with all invalid versions and give it a try.
|
@Arka-Saha Gentle ping, could you update this PR or fix the DCO? I’d like to acknowledge your effort in trying to fix this issue, since we are migrating the Gentoo importer to advisory V2 |
univers was rejecting versions containing ":"
so, I added some code to clean it, 1. First tries the original version 2. if error, cleans the version 3. tries again until working.
I hope this result is upto the mark, but do let me know if there is any discrepancies. Looking forward for your reviews, and sorry for being this late, my apologies.
Thank You!