Skip to content

Unified output #410

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

Merged
merged 65 commits into from
Feb 29, 2020
Merged

Unified output #410

merged 65 commits into from
Feb 29, 2020

Conversation

SinghHrmn
Copy link
Contributor

@SinghHrmn SinghHrmn commented Feb 26, 2020

Fixes #409

This PR unify the output generation and also adds the functionality to generate a CSV file as the output.

Currently, we can only generate single type at once and that also CSV.
In Future, we can add functionality to drop a list or tuple of output types. Unification will also help in maintaining and upgrading the code faster and easier.

@terriko I've implemented this approach. But I'm a little nervous and need your guidance to know that is this a right approach?

terriko and others added 12 commits February 21, 2020 17:00
Fixes #342

Updated regex_find in utils.py and all the checkers using it (#331)

* Updated regex_find to return UNKNOWN
* modified cli.py to handle UNKNOWN results appropriately by not calling get_cves on an unknown, and instead printing a warning to the user.
* fixed icu.py, kerberos.py and libjpeg.py to also return unknown (since they weren't returning regex_find results directly)
* Sort lines in systemd to improve matching, add additional systemd test using ubuntu package
* Add systemd 242, 243 tests and new signatures
* Additional systemd signatures
@terriko
Copy link
Contributor

terriko commented Feb 26, 2020

It'll probably be late late this afternoon before I can review this in more detail, but at a glance it looks like you're going in a good direction.

@terriko
Copy link
Contributor

terriko commented Feb 27, 2020

Those are long comments, but it looks like a good direction with some fiddly bits around names that we can improve. Thanks for this; it looks really promising!

@SinghHrmn
Copy link
Contributor Author

@terriko thanks for giving your precious time and thanks for the explanation. You are really a great mentor. But I'd not be able to work on this till 28th Evening as I'm having my exam on 28th. I'll work on this on 28th evening. Thanks You !

@SinghHrmn
Copy link
Contributor Author

SinghHrmn commented Feb 28, 2020

@terriko I've updated some features of OutputEngines.py now it also checks if the filename that user is providing doesn't pre-exist. If the filename matches with another file we can switch to our randomly generated filename. Also, we check that the filename provided by the user can be opened. If we can't open then also we will switch to randomly generated filename.

Example Output:

cve_bin_tool.OutputEngine - WARNING - Failed to write at 'Myfilename.csv'. File already exists
cve_bin_tool.OutputEngine - INFO - Generating a new filename with Default Naming Convention
cve_bin_tool.OutputEngine - INFO - CSV output stored at /home/mastervulcan/gsoc-cve-bin-tool/cve-bin-tool/output.cve-bin-tool.2020-02-29.01:02:29.csv

Although I have one doubt. Should we print the whole path to the file? or switch to something less and only print the filename only.

@SinghHrmn SinghHrmn requested a review from terriko February 28, 2020 20:15
@terriko terriko mentioned this pull request Feb 28, 2020
@terriko
Copy link
Contributor

terriko commented Feb 28, 2020

I don't feel strongly one way or another about the full path, so let's leave it as it is for now and if people hate it maybe we'll revisit?

@terriko
Copy link
Contributor

terriko commented Feb 29, 2020

Okay, I think this is ready for merging. Thank you! This is definitely a good basis towards getting better output.

@terriko terriko merged commit f2652c2 into intel:master Feb 29, 2020
This was referenced Feb 29, 2020
@SinghHrmn
Copy link
Contributor Author

SinghHrmn commented Feb 29, 2020

@terriko It was never possible without your guidance. Thank you so much !

@SinghHrmn SinghHrmn deleted the unified_output branch March 4, 2020 18:00
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.

Unification Of Output Generation. Output types like CSV, JSON, etc.
8 participants