Skip to content

New feature-flag and pagination logic for personal access token

What does this MR do and why?

Issue #367837. As per Issue

  1. We Introduced new Feature-flag with name access_token_pagination
  2. We Introduced pagination logic in Personal Access Token controller behind the feature flag

Screenshots or screen recordings

Screenshot_2022-06-29_at_5.23.19_PM

How to set up and validate locally

To check the pagination is working properly. Please follow the steps

  1. Enable the feature-flag access_token_pagination from rails console
bin/rails console
Feature.enable(:access_token_pagination)
  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. Access the api end-point for personal access tokens with page parameter
http://localhost:3000/-/profile/personal_access_tokens.json?page=2

You should be able to view data in json format

MR acceptance checklist

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

Edited by Smriti Garg

Merge request reports