Process Gemfile.lock processing #3072 #3090
Merged
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.
This PR addresses the issue in #3072, where (in a scancode scan) the main gem that the gemfile.lock is for has been reported the same number of times as there are dependencies in the gemfile.lock and that the entire set of dependencies have been repeated the same amount of times.
The changes I've made in this PR was to update the GemfileParser to look for the gem that was created for the contents in the
PATH
section of the gemfile.lock and save it to a new attribute onGemfileParser
namedprimary_gem
.In
GemfileLockHandler.parse()
, if we have a primary gem from a gemfile.lock, we use that primary gem info as the base of the package data and we consider all other gems from that lockfile as a dependency of the primary gem. If there is no primary gem, then we collect all the dependencies and return them in a package with no name.