Skip to content

codeintel: Paginate configuration policies

Warren Gifford requested to merge ef/paginate-policies into main

Created by: efritz

This PR adds pagination to configuration policies. In the first draft we just returned an unlimited set of data from the database. This can have pretty adverse effects for large number of policies and I wanted to get this in before branch cut in case customers really try to auto-index everything at once. This should make the UI and worker stable against some kinds of large loads.

Screen Shot 2021-11-18 at 2 56 25 PM Screen Shot 2021-11-18 at 2 56 34 PM Screen Shot 2021-11-18 at 2 57 05 PM Screen Shot 2021-11-18 at 2 56 54 PM

Backend changes:

  • Rewrote GetConfigurationPolicies to take limit, offset, and search conditions.
  • Update upload expirer to use new function. Instead of combining all global policies and repository-defined policies, we ask each repository for all policies that apply to them and iterate those.
  • Update index scheduler in the same way.
  • Update the GraphQL layer to return a policy connection resolver instead of a list to enable pagination.

Frontend changes:

  • Break apart tabs in configuration policy page so that we have one repository configuration view and one site-admin configuration view
  • Use filtered connection to display policies (😓)
  • Move delete button into configuration policy page so it matches the flow of indexes/upload records

Remaining work:

  • Fixing navigation back to the list view when deleting a configuration policy
  • Fixing navigation back to the list view when updating a configuration policy

Merge request reports

Loading