[ANE-2297] include the archive name in paths for vendored deps and first-party-license scans #1520
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Delivers ANE-2297
When we show license results from an archive that we find using a first-party license-scan or a vendored dependency, we do not show the archive filename in the license path. This can make it hard for the user to figure out where the license is actually coming from.
For example, if I have an archive in
vendored/files/random-name.zipthat unzips to a directory calledtools, the path that we show to the user will look likevendored/files/tools/LICENSE.txt.It would be better if the path was
vendored/files/random-name.zip/tools/LICENSE.txt, which lets the user know exactly where that license was found.This PR fixes that for first-party license scans and CLILicenseScan style vendored dependencies. It does not fix it for ArchiveUpload style vendored dependencies.
Unfixed:
Fixed:
Acceptance criteria
Testing plan
Here is an example project to test with:
licenses-in-zip.zip
It includes two vendored dependencies. One that is just a directory containing an MIT license. The output from this should be unchanged. The other is a zip file that contains a BSD-3 license.
Scan it with the current production release of
fossa. You'll see that the path to the BSD-3 license looks like the "unfixed" screenshot above.Then scan with this branch. The path to the BSD-3 license should now look like the "fixed" screenshot above.
You can also see the difference using
fossa license-scan fossa-deps. Look for the path to the BSD-3 license. Forfossa, it will be "vendored/file/tools/bsd-new.LICENSE". Forfossa-devit will be "vendored/file/random-name.zip/tools/bsd-new.LICENSE".Now repeat that with a first-party license scan.
You should once again see that the path to the BSD-3 license looks like the "fixed" screenshot above.
Risks
I did not fix this for ArchiveUploads, but I think that's okay. It will give us another reason to move customers to ArchiveUploads.
This will change the output we provide, which may surprise users. I think it's what we should have done in the first place, though, so I think the change is worth it.
Metrics
References
ANE-2297
Checklist
docs/.docs/README.msand gave consideration to how discoverable or not my documentation is.Changelog.md. If this PR did not mark a release, I added my changes into an## Unreleasedsection at the top..fossa.ymlorfossa-deps.{json.yml}, I updateddocs/references/files/*.schema.jsonAND I have updated example files used byfossa initcommand. You may also need to update these if you have added/removed new dependency type (e.g.pip) or analysis target type (e.g.poetry).docs/references/subcommands/<subcommand>.md.