Add API to list all pipeline names in project
What does this MR do and why?
Describe in detail what your merge request does and why.
Add an API to list all the unique pipeline names in a project. This API will be used (in a follow-up MR) to list pipeline names on the pipeline search bar on the frontend (for example in the search bar in https://gitlab.com/gitlab-org/gitlab/-/pipelines).
This API will be used to list pipeline names similar to how branch names are listed on the pipeline search bar: .
The user will then select a name from the list, and the UI will show all pipelines with the selected name. (This will be implemented in a follow-up MR)
Query:
SELECT DISTINCT "ci_pipeline_metadata"."name" FROM "ci_pipeline_metadata" WHERE "ci_pipeline_metadata"."project_id" = 278964 ORDER BY "ci_pipeline_metadata"."name" ASC LIMIT 20 OFFSET 0
Query performance:
- 1st run: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/16209/commands/55678 (public link: https://console.postgres.ai/shared/0805b4a0-9837-4b6b-82b0-f5326a9ef512)
- 2nd run: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/16209/commands/55680 (public link: https://console.postgres.ai/shared/116fe587-536a-49fd-b6a2-9fb24140a944)
Migration:
main: == 20230309083722 AddProjectIdPipelineNameIndex: migrating ====================
main: -- transaction_open?()
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.6279s
main: -- index_exists?(:ci_pipeline_metadata, "project_id, name text_pattern_ops", {:name=>"index_ci_pipeline_metadata_on_project_id_name_text_pattern", :algorithm=>:concurrently})
main: -> 0.0198s
main: -- add_index(:ci_pipeline_metadata, "project_id, name text_pattern_ops", {:name=>"index_ci_pipeline_metadata_on_project_id_name_text_pattern", :algorithm=>:concurrently})
main: -> 0.0128s
main: == 20230309083722 AddProjectIdPipelineNameIndex: migrated (0.8542s) ===========
Revert migration:
main: == 20230309083722 AddProjectIdPipelineNameIndex: reverting ====================
main: -- transaction_open?()
main: -> 0.0000s
main: -- view_exists?(:postgres_partitions)
main: -> 0.0499s
main: -- indexes(:ci_pipeline_metadata)
main: -> 0.0098s
main: -- remove_index(:ci_pipeline_metadata, {:algorithm=>:concurrently, :name=>"index_ci_pipeline_metadata_on_project_id_name_text_pattern"})
main: -> 0.0032s
main: == 20230309083722 AddProjectIdPipelineNameIndex: reverted (0.0879s) ===========
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.