Repository navigation
Collect manifest information from multiple files, not just Bowerfile - #240
Conversation
|
These are the results, working from a It's a significant improvement! Compare that to the current main branch: The number of missing licenses has been cut in half, and about 700 more versions are included in the final registry. I would like to keep looking at the exclusions file to see if any packages are suspiciously failing, but on the whole this is a nice improvement over the current stats. |
|
The tests are failing because I added a Licensee test; we’re going to have to add that to CI as a CLI tool. |
|
Whew, sorry, had to do a little CI fixup (case sensitivity is a bear!), but this is now actually good to go. |
f-f
left a comment
There was a problem hiding this comment.
Great work @thomashoneyman! I left a bunch of small comments, and this is almost ready to go
Co-authored-by: Fabrizio Ferrai <fabrizio.ferrai@gmail.com>
|
Some of my responses to your comments are only showing up in the review, and not in this main PR view, so you might have to read them in the review tab. Thanks for your comments! I believe I've addressed everything. |
| state <- AVar.take var | ||
| AVar.put (modify state) var |
There was a problem hiding this comment.
Great! Then since we repeat this pattern many times I was wondering if it'd be worth making a helper that takes, does stuff, and then puts, so that we reduce clutter. No strong opinion on this though, feel free to ignore
| } | ||
|
|
||
| res <- API.readOperation "test/fixtures/issue_comment.json" | ||
| res <- API.readOperation "test/Fixtures/issue_comment.json" |
There was a problem hiding this comment.
Oh, I didn't realize then - thanks for the pointer. I have a slight preference for the lowercase version (I am definitely traumatized by macOS' filesystem shenanigans with that) so I'd appreciate if you can switch to that, but no worries if you wouldn't like to
Co-authored-by: Fabrizio Ferrai <fabrizio.ferrai@gmail.com>
Closes #233, #220, #218. Supersedes #234.
This PR implements a
LegacyImportscript instead of aBowerImportscript, because we now look at multiple files to try and import a manifest instead of just the Bowerfile. Those files include theLICENSE,package.json,bower.json, andspago.dhallandpackages.dhallfiles.Implementing the pipeline using multiple files to produce the manifest required shuffling around quite a bit, but the majority of the code moved into the
constructManifestFieldsfunction which produces the license and dependencies for a package from a combination of the available files.There are two other notable changes:
withCachefunction works a little differently. First, it no longer requiresEncodeJsonandDecodeJsoninstances, because you can be storing something like aLICENSEfile; it now usesString. Second, thewithCachefunction now takes anImportError -> Booleanfunction that allows you to cache files even if producing the file throws an exception. The exception is stored instead of the file contents, and when the file is read the exception is thrown. With this in place we can remove all thefilterFailedPackagesstuff, which is a bit error-prone, and we no longer need to read in the excluded packages.Errortype has been changed around a little to accommodate the new files we're fetching. There's now aResourceErrorthat represents that files related to the package couldn't be fetched.MissingBowerfilehas been replaced since it's not really an error any more, andNoDependencyFilestook its place to represent that both a spago and bower file are missing.