Skip to content

Allow pipelines to be filtered by name in public pipelines API

Reuben Pereira requested to merge rp/pipeline-api-filter-name into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Allow the public pipelines API to take an optional name parameter. If provided, the response will only contain pipelines whose name match the given parameter.

Additionally, the response of the API will now also contain the pipeline name.

I didn't modify the existing PipelineBasic entity since it is used in a lot of places. To avoid having to change all places at once (changes would be required to avoid N+1 queries), I've introduced a new entity called PipelineBasicWithMetadata.

This is an SQL query when the API is called with name and ref parameters: https://console.postgres.ai/gitlab/gitlab-production-ci/sessions/17268/commands/58083.
ref was chosen randomly from the existing set of parameters that the API accepts.

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.

Edited by Reuben Pereira

Merge request reports