-
Notifications
You must be signed in to change notification settings - Fork 92
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
Handle parsing a PackageId that is a raw registry url into a Crate #758
base: master
Are you sure you want to change the base?
Conversation
b57c8b0
to
b4bfa7b
Compare
Looking a bit further it looks like in 1.77/1.78 cargo switched to packeg id spec. Should I add a todo comment for implementing the parsing of the package id spec completly and cleaning up the old package id parsing? Other than that I would consider this ready for review. |
7ff2109
to
cadabce
Compare
I have replaced the manual URL parsing code, |
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.
I'm glad you found a package to parse the IDs :D
Left a small comment. Also, as before, I think we should not set the version to "unknown"
if it's missing, but error out instead, as I don't know how the rest of Crater would handle it.
I think I missed that remark last time, I will change that then. |
instead of manual disecting the string
as sugested by epage rust-lang/cargo#15048 (comment)
59184f2
to
83c1482
Compare
Ok, I have rebased to resolve merge conflicts and addressed your remarks regarding turning missing version into I think how I handle the |
- github strips `.git` suffixes when attempting to create a new repo ending in `.git` so this should be unambiguouse - for other repos I hope they also don't allow creating repos with names ending in `.git`
83c1482
to
a3b18eb
Compare
Tags, Branches and non-hex revs now result in |
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.
Thanks! ❤️
|
Ok, I have now updated the |
I noticed that a lot of errors that I would expect to be categorized as
DependsOn(_)
would end up asUnknown
instead.It looks like cargo sets the
package_id
field in the json output toregistry+https://github.com/rust-lang/crates.io-index#{crate_name}@{crate_version}
which wan't handled byCrate::try_from
.As a result no crate would be inserted into the
deps
set and it wasn't able to differentiate between an emptydeps
set due to no errors in dependencies and an emptydeps
set because thepackage_id
s field of failing deps couldn't be parsed into aCrate
.