-
Notifications
You must be signed in to change notification settings - Fork 611
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
Started working on having the ability to have a different license for each version of a crate. #787
Conversation
… their corresponding licenses.
…he license and validate it. Additionally, Made NewCrate.crate_or_update take an immutable self instead of mutable because it was no longer necessary.
…odableVersion return it.
… their corresponding licenses.
…he license and validate it. Additionally, Made NewCrate.crate_or_update take an immutable self instead of mutable because it was no longer necessary.
…odableVersion return it.
… their corresponding licenses.
…he license and validate it. Additionally, Made NewCrate.crate_or_update take an immutable self instead of mutable because it was no longer necessary.
…odableVersion return it.
…he license and validate it. Additionally, Made NewCrate.crate_or_update take an immutable self instead of mutable because it was no longer necessary.
…odableVersion return it.
…hey can still be used in production.
Looks like rustfmt is still sad :( I'm not sure why it's different... I'm going to try running it on here. |
This is going well!! I love the I tried out the code locally, and publishing versions locally was doing what I would expect as far as continuing to update the crate license, continuing to reject invalid licenses, and starting to keep track of the licenses in the versions table 💯 One small issue I found when running I'm going to file a separate issue for that, because I think we should be able to make it not null, but I'm not sure how it's happening, if it's something that's been fixed or not, so I think in this PR we should support a null license. Currently, though, when
I think on line 30 of update-licenses.rs we can just change the type annotation from Since I'm not sure how crates.io is creating crates with null licenses, you can change a crate in your database to have a null license in
Thank you!!! Let me know if you have questions!!! |
…tly have a license.
src/bin/update-licenses.rs
Outdated
assert!(num_updated > 0); | ||
let license: Option<String> = row.get("license"); | ||
|
||
if let Some(license) = license { |
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.
nice use of if let
!
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.
Looks great and the script works great with null licenses now too! ❤️
This is some work towards fixing #736