pivotal / LicenseFinder

Find licenses for your project's dependencies.
MIT License
1.73k stars 340 forks source link

Add ability to truncate additional output #826

Open heydonovan opened 3 years ago

heydonovan commented 3 years ago

Hi Team --

We are trying to reduce the output size when running the license scanning tool over on GitLab. Currently the license scanning tool is producing more than 8MB of logs. We tried passing in various environment variables to further reduce the output, but the flags are either not working or just aren't reducing it enough. Here is the current command:

license_management report --prepare-no-fail --format=json --save=gl-license-scanning-report.json --no-recursive --no-debug --quiet

Are there additional flags we might be able to pass to further reduce the output? I'm not seeing --no-debug or --quiet in license_finder --help. The jobs over on GitLab are truncated which is why we are trying to do this, so we can see the errors at the end (when/if things go wrong).

cf-gitbot commented 3 years ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

xtreme-shane-lattanzio commented 3 years ago

Hi @heydonovan ! There is a --quiet option which basically reduces output that would be shown with the say command on our code. LicenseFinder is built off of the thor cli gem which is what it is doing. Are you talking about reducing the report itself or just the CLI output? Do you have an example of output that you would not like to see? If you are referring to error output, it is possible the code is crashing before it can even suppress it. The quiet command is more about reducing report output itself.

osher commented 2 years ago

Hi, I have a mono repo of about 30 services and about 80 packages, the bulk of them is nodejs. the output is so big that the builder trancates it and we don't get to see the bottom lines.

From all the junk that is print as a huge tree of nested package.jsons - all that is relevant is the fields: name, versions, dependencies, devDependencies and optionalDependencies. We do want this to be included in the output to confirm a propper execution.

But all the rest there are pure noise... many many other fields some with very long values - like readme, and maintainers list...

Actually - the keys in the tree could be <name>@<version> - and then we don't need to repeat them in the mapped values - but I suspect these are implementation details discrete to nodejs - donno, you see what you can do

Also - there's a bug in the output - we're using a company registry for proprietary packages, so the registry base url is NOT https://registry.npmjs.com but our own. We do use scopes, but not consistently (yet).

I explored npm_package.rb to see if I can be of any help to PR, and I suspect I'm practically looking right at it, but do not know ruby to see it... sorry...