Skip to content
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: Collect issues when listing packages instead of failing #9616

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

MarcelBochtler
Copy link
Member

Collect errors from the npm list command printed on stderr like:

npm error code ELSPROBLEMS
npm error missing: @angular/compiler-cli@^17.0.0, required by @angular-devkit/[email protected]
npm error missing: typescript@>=5.2 <5.5, required by @angular-devkit/[email protected]
npm error missing: @angular/compiler-cli@^17.0.0, required by @ngtools/[email protected]
npm error missing: typescript@>=5.2 <5.5, required by @ngtools/[email protected]
npm error A complete log of this run can be found in: /Users/bom1wa3/.npm/_logs/2024-12-16T10_06_55_007Z-debug-0.log

Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.06%. Comparing base (8bc47a4) to head (83223f5).
Report is 20 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9616      +/-   ##
============================================
+ Coverage     68.03%   68.06%   +0.02%     
  Complexity     1287     1287              
============================================
  Files           249      249              
  Lines          8826     8836      +10     
  Branches        920      921       +1     
============================================
+ Hits           6005     6014       +9     
- Misses         2432     2433       +1     
  Partials        389      389              
Flag Coverage Δ
funTest-docker 65.14% <100.00%> (+0.17%) ⬆️
funTest-non-docker 33.48% <ø> (+0.03%) ⬆️
test-ubuntu-24.04 35.84% <62.50%> (+0.03%) ⬆️
test-windows-2022 35.82% <62.50%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MarcelBochtler MarcelBochtler force-pushed the npm-list-issues branch 9 times, most recently from 18d448b to 6d76a0f Compare December 16, 2024 13:10
@MarcelBochtler MarcelBochtler marked this pull request as ready for review December 16, 2024 13:11
@MarcelBochtler MarcelBochtler requested a review from a team as a code owner December 16, 2024 13:11
These messages are printed on `stderr`, listing one dependency per line.

Signed-off-by: Marcel Bochtler <[email protected]>
In an upcoming commit, `stderr` will be passed to the `groupLines()`
function. The log file message should not be added as an `Issue`,
therefore add it as an ignorable prefix.

Signed-off-by: Marcel Bochtler <[email protected]>
If `npm list` returns with a non-zero exit code, do not throw an
exception and consequently stop the analysis.
Instead, collect the errors from `stderr` as `Issue`s and continue
analyzing the project, because useful dependency information may still
be available.

Resolves oss-review-toolkit#9551.

Signed-off-by: Marcel Bochtler <[email protected]>
@sschuberth sschuberth enabled auto-merge (rebase) December 16, 2024 14:55
@sschuberth sschuberth merged commit 81f58ea into oss-review-toolkit:main Dec 16, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants