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

Yarn Audit Scan takes a lot of resources #68

Closed
nishils opened this issue Jul 15, 2019 · 2 comments
Closed

Yarn Audit Scan takes a lot of resources #68

nishils opened this issue Jul 15, 2019 · 2 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@nishils
Copy link
Contributor

nishils commented Jul 15, 2019

When scanning a few different repos like https://github.com/coinbase/rest-hooks, yarn audit --json will produce 19 GB which then get entirely placed into memory and is handled inefficiently. This particularly affects CI scans that may expect some sort of response from salus within a time period. Currently, Salus only outputs on completion.

There's a couple of options to fix this issue.

  1. Wait for upstream fix yarn audit --json produces large amounts of data yarnpkg/yarn#7404
  2. (Stop gap) Implement a heartbeat to prevent CI from timing out
  3. (Longer term if no upstream fix) Implement a streaming parser that de-dupes without having to load the entire file into memory.
@nishils
Copy link
Contributor Author

nishils commented Jul 16, 2019

2.6.0 addresses this by adding a heartbeat that emits every minute. This can turned off using the heartbeat flag (--heartbeat false). This flag also respects quiet mode.

2.6.1 (still in dev phase) will add in stream parsing. We will watch how well this does when yarn seems to run into issues. Sometimes yarn outputs without this enormous dataset and sometimes it does.

@nishils
Copy link
Contributor Author

nishils commented Aug 30, 2019

Planning to get a fix in 2.6.2 that allows to configure yarn audit scans to not include devDependencies configurable via a salus config file.

@nishils nishils added bug Something isn't working enhancement New feature or request labels Sep 3, 2019
@nishils nishils self-assigned this Sep 3, 2019
This was referenced Sep 27, 2019
@nishils nishils closed this as completed Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Development

No branches or pull requests

1 participant