vulnerablecode icon indicating copy to clipboard operation
vulnerablecode copied to clipboard

Option to filter Vulnerable and Non Vulnerable Packages

Open Rishi-source opened this issue 11 months ago • 5 comments

Implement vulnerable package filtering functionality in package search

Fixes : #1759

Feature Added:

  1. Vulnerable package filtering in package search
  2. Ability to filter packages as vulnerable-only, non-vulnerable-only, or all packages

Changes Made:

  1. Updated PackageSearch view in views.py
  2. Modified PackageSearchForm in forms.py
  3. Updated packages.html template with dropdown for vulnerability filtering
  4. Updated PackageV2ViewSet view in api_v2.py

Feature Added:

  1. Vulnerable package filtering in package search
  2. Ability to filter packages as vulnerable-only, non-vulnerable-only, or all packages

Tests Added:

  1. Added test in test_api_v2.py and test_view.py to test the filter.

Screenshot 2025-04-20 at 9 07 17 AM

Signed-off-by: Rishi Garg [email protected]

Rishi-source avatar Jan 24 '25 17:01 Rishi-source

Hi @TG1999 , please review this Pull request.

Rishi-source avatar Feb 17 '25 02:02 Rishi-source

@Rishi-source your code change and PR description do not add up, these things are nowhere to be found in the diff.

Tests Added:

  1. test_package_search_vulnerable_only_filter in PackageSearchTestCase
  2. Validates creation of vulnerable and non-vulnerable packages
  3. Checks vulnerability relationship creation

Changes Made:

  1. Updated PackageSearch view in views.py
  2. Modified PackageSearchForm in forms.py
  3. Updated packages.html template with dropdown for vulnerability filtering
  4. Added JavaScript to handle URL parameter updates for vulnerability filter

keshav-space avatar Apr 18 '25 09:04 keshav-space

the tests are not added because first I want to get the implementation to get reviewed .previously they where added but Apologies for not removing the test part from the description after I have removed them from the code changes.

Rishi-source avatar Apr 18 '25 09:04 Rishi-source

I’ll update the description I have changed the code in the PR but forgotten to change the previous description

Rishi-source avatar Apr 18 '25 09:04 Rishi-source

@keshav-space I have addressed the review points and I have added tests can you please review the changes again and let me know if any other thing is needed.

Rishi-source avatar Apr 22 '25 11:04 Rishi-source