Introduce Internal API for searching environment names
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.
We avoid using public API /api/v4/projects/:project_id/environments
, because of performance reasons, for example,
- It contains unnecessary attributes which could weigh on network bandwidth.
- 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?
-
Changelog entry added, if necessary - [-] Documentation created/updated via this MR
- [-] Documentation reviewed by technical writer or follow-up review issue created
-
Tests added for this feature/bug - [-] Tested in all supported browsers
-
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides - [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
-
Security reports checked/validated by reviewer
Edited by Shinya Maeda