Search in accessible deploy keys
Hello,
In the latest gitlab releases, pagination was added to deploy keys. However, there is no search feature, creating issues if you want to add an existing deploy key when you have a lot of them. Before pagination, browser's search feature was good enought to find the key
Suggestion: add a search field on the deploy key list.
Thanks!
Proposed Solution:
Add a filtered search to the top of the deploy keys section:
Proposal |
---|
This filtered search would first work by searching for deploy key name OR SHA only.
Technical proposal
Adding proposed filtering logic requires both backend and frontend work.
Backend
The filtering of deployment keys is implemented in DeployKeysFinder
We need to add filtering for key
and title
fields of a DeployKey entity. The fingerprint_sha256
field already has an index in place. The title
doesn't have an index. Following our index guidelines I'd say we should not worry about that, as initial filtering by project/group should already decrease the data size enough.
The proposed API follows the Issues API shape and is the following:
Attribute | Type | Required | Description |
---|---|---|---|
search |
string | No | Searches deployment keys based on their title and key parameters, unless changed by in attribute |
in |
string | No | Modify the scope of the search attribute. Values are title , key , or a string joining them with comma. Default is title,key . |
We need to update DeployKeysController to accept new filtering parameters for the following endpoints:
-/deploy_keys/available_project_keys
-/deploy_keys/available_public_keys
-/deploy_keys/enabled_keys
Frontend
We should add a FilteredSearch component from @gitlab/ui
package and has to be added to the DeploymentKeysApp component.
We need to add two tokens to the FilteredSearch component for title and sha
We should also update the data fetching logic in GraphQl Resolvers that wraps the underlying REST calls, and the respective client-side graphql queries.