Improve Sorting, Pagination, and Test Coverage for Vulnerabilities and Packages Search (Fixes #1754) #2053
+590
−72
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 pull request introduces significant improvements to the sorting, pagination, and test coverage for the vulnerabilities and packages search pages and also fixes #1754 . The main changes include adding user-friendly sorting controls to the UI, implementing a "Reset" button for search and sorting, and adding both correctness and performance tests to ensure efficient query execution at scale.
User Interface Improvements:
packages.html,packages_v2.html, andvulnerabilities.html. This allows users to easily change sort order directly from the UI. [1] [2] [3]Testing Enhancements:
test_sort_and_queries.pyto verify correct sorting behavior for packages and vulnerabilities, and to assert that the number of database queries remains efficient (bounded) for key search and sort operations.test_perf_scale.py) that bulk-creates large numbers of packages and vulnerabilities, then measures query count and execution time for searches at scale. This test is disabled by default and can be enabled via an environment variable.perfmarker inpytest.inito allow selective running of performance tests.