-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add CVE Details and Single-Key Filtering for JSON Output in safety scan #643
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Could you add a unit test for the generated JSON output. |
Hey @jakub-safetycli, I added unit tests that pass locally- the issue I am facing is that the cve_details new section is only added in the latest scan code which I run locally as a module In the pre-existing test we invoke it via:
For my new tests running this way does not contain the latest changes since it is not deployed. I switched for my tests to use subprocess via:
but in the CI output it is not able to parse the stdout. Since the feature here is mostly straightforward and was easy to manually test I think it would be quicker to not get bogged down in this and add testing afterwards if it is strictly need. Please let me know what you think! |
@jakub-safetycli and I agreed to skip the automated tests for now as we were facing issues in the CICD. The code has been manually tested and works as expected. |
30c6f3e
to
0c4fb78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
c33d8b6
to
8cc5532
Compare
author Dylan Pulver <[email protected]> 1732560851 -0500 committer Dylan Pulver <[email protected]> 1734466348 -0500 gpgsig -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQR8hu+aMQHwGtOiprRYOGlsgKaxswUCZ2HbLAAKCRBYOGlsgKax s+jrAP97O2+K0k+c7YMwn0JuN9CCAKXSuOo+6e58xt2aThUWoQEA0B00lQhBAZVh qcZOk9sMdVXMHl308FNXDEWbCdFT6Qk= =4jd3 -----END PGP SIGNATURE----- feature/post-prototype feature/add-branch-name (#641) chore:Use specific safety schema version feature/cve-data-filter-flag (#643) chore/release-3.2.12 (#644) feat(utils.py): remove email verification feat(changelog): update version Auth added fix urljoin issue chore:Use specific safety schema version feat(utils.py): remove email verification feat(changelog): update version review changes switch to target drop prefixes fix return code check extract runtime info fix
This PR introduces the following enhancements to the safety scan command:
1. CVE Details in Detailed JSON Output
2. Single-Key Filtering for JSON Output
3. Improved Report Processing
Testing
Usage Examples
python -m safety scan --detailed-output --output json
: Includes the new cve_details section in the JSON output.python -m safety scan --detailed-output --output json --filter cve_details
: Outputs only the cve_details section.python -m safety scan --detailed-output --output json --filter meta
: Outputs only the meta section.These changes enhance the usability of the safety scan command by providing more actionable data and allowing users to filter output for specific use cases.