-
Notifications
You must be signed in to change notification settings - Fork 319
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
Npm: Fix querying of package details from private / scoped registries #5162
Conversation
3aacc33
to
a5a8a40
Compare
To avoid unnecessary remote queries, only do so if existing data is incomplete. Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
To be on the safe side, do this in any case in common code. Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
Codecov Report
@@ Coverage Diff @@
## main #5162 +/- ##
============================================
- Coverage 72.25% 72.21% -0.05%
+ Complexity 1929 1924 -5
============================================
Files 255 255
Lines 13684 13647 -37
Branches 1919 1918 -1
============================================
- Hits 9888 9855 -33
+ Misses 2791 2788 -3
+ Partials 1005 1004 -1
Continue to review full report at Codecov.
|
Do not unconditionally overwrite existing package data, but only if it is empty. Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
This is a preparation for an upcoming change that needs to run the `npm` command line tool from a static context. As a side effect when running `ort requirements`, `NpmCli` and `YarnCli` are now listed in the "Other tool" section instead of the "PackageManager" section. Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
c8a4f2f
to
7c6bd44
Compare
Bump the NPM version requirement from 5.7.* to 6.* in order to be able to use the `npm view` command to query details about a package from remote registries. This lifts two severe restrictions: - The original code was only able to query package details from the public NPM registry [1]. Private registries were not supported at all. - Custom registries defined for different NPM scopes were not supported. As a bonus, `npm view` seems to return more details than querying the registry API directly even for the public NPM registry. The downside is that performance is worse now, using `npm view` seems to be roughly 4 times slower (on Linux); the command unfortunately does not support batching. However, correctness should be more important than performance here, and a future improvement could parallelize the `parsePackage()` calls in general. [1]: https://registry.npmjs.org Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
Merging despite the unrelated |
Please have a look at the individual commit messages for the details.