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

Integrate scancode data #572

Merged
merged 2 commits into from
Mar 6, 2020
Merged

Conversation

nishakm
Copy link
Contributor

@nishakm nishakm commented Mar 5, 2020

These changes are work towards #480

The first commit adds a setter for file_type in the
FileData class. The second commit integrates
the scancode data into Tern's data model.

Signed-off-by: Nisha K [email protected]

Nisha K added 2 commits March 5, 2020 13:27
We need the ability to set the file_type after a FileData object
is instantiated as we may be able to get that data later. Added
a property setter for file_type and a test for the setter.

Work towards tern-tools#480

Signed-off-by: Nisha K <[email protected]>
This change uses the FileData class to store all the data scancode
collects. There are two scenarios this change tackles: one when
tern cannot collect file level data and hence a files list does not
exist within the ImageLayer object created during loading the image,
and one where tern has processed files in the image but doesn't have
any of the other data. In the case where we know the files in the
image layer, we introduce a function get_file_command() which will
get the correct command to invoke against a file rather than a
directory where the file exists.

In the analyze_layer() function, if the data retrieved after a scan
is a file, a FileData object is created and added to the ImageLayer
object. In the case of the analyze_file() function, for each FileData
object in the ImageLayer object, we run scancode and fill in the data
from the results.

This is work towards tern-tools#480

Signed-off-by: Nisha K <[email protected]>
@nishakm nishakm requested a review from rnjudge March 5, 2020 21:39
@rnjudge rnjudge merged commit c9ff72f into tern-tools:master Mar 6, 2020
@nishakm nishakm deleted the integrate-scancode-data branch March 18, 2020 22:41
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