Skip to content

Add pagination to the access token table

What does this MR do and why?

User gitlab_qa has ~11k personal access tokens. It is slow to show all the access tokens at once, so we have added a pagination component to display them in batches of 100. This was one of the reasons for incident: gitlab-com/gl-infra/production#7163 (closed)

Screenshots or screen recordings

image

How to set up and validate locally

  1. On the rails console turn on the access_token_ajax feature flag:
bin/rails console
Feature.enable(:access_token_ajax)
  1. Generate 1000 personal access tokens for the root user (user_id: 1):
gdk psql
DO $$
  BEGIN 
    FOR X IN 1..1000 LOOP
      INSERT INTO "personal_access_tokens" (name, created_at, updated_at, user_id) VALUES (X, '2022-06-02', '2022-06-02', 1);
    END LOOP;
  END;
$$;
  1. Go to the personal token page: http://127.0.0.1:3000/-/profile/personal_access_tokens

To delete the generated tokens:

gdk psql
DELETE FROM "personal_access_tokens";

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports