Skip to content

Introduce Internal API for searching environment names

Shinya Maeda requested to merge introduce-environment-search-endpoint into master

What does this MR do?

This MR introduces an internal API for searching environment names from a given query.

End point Acceptable params Results
/*namespace_id/:project_id/environments/search query (String, Required) environment names (String) (e.g. ["review/patch-1", "review/patch-2"])

The returned values will be used as suggestions for users, like the following image.

feature-flag__new-dropdown

We avoid using public API /api/v4/projects/:project_id/environments, because of performance reasons, for example,

  1. It contains unnecessary attributes which could weigh on network bandwidth.
  2. It uses pagination which could take way more entries than frontend requires.

Example

Query: http://localhost:8181/root/too-many-secret-variables/environments/search.json?query=review

Result: ["review/1","review/2","review/3","review/master_1","review/master_2"]

What are the relevant issue numbers?

Related https://gitlab.com/gitlab-org/gitlab-ee/issues/9439

Does this MR meet the acceptance criteria?

Edited by Shinya Maeda

Merge request reports