Skip to content

Conversation

@saquibjawedbit
Copy link

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:

  • Added interactive sorting controls (ascending, descending, and reset) for columns such as "Affected by vulnerabilities", "Fixed by packages", and "Vulnerability id" in packages.html, packages_v2.html, and vulnerabilities.html. This allows users to easily change sort order directly from the UI. [1] [2] [3]
  • Introduced a "⇵ Reset" button next to pagination controls that resets sorting while preserving the current search term, improving usability for users navigating large result sets. [1] [2] [3]
Screenshot from 2025-12-06 17-14-21 Screenshot from 2025-12-06 17-13-01

Testing Enhancements:

  • Added new tests in test_sort_and_queries.py to 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.
  • Introduced an opt-in performance test (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.
  • Registered a custom perf marker in pytest.ini to allow selective running of performance tests.

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.

In UI and API, sort packages and vulnerabilities from newest to oldest.

1 participant