Implement pagination for /pipelines/:pipeline_id/variables API for error budget for Pipeline Authoring
https://about.gitlab.com/handbook/engineering/error-budgets/
Overview
Based on the initial research that was performed in !341291, it was determined that the response times for the /pipelines/:pipeline_id/variables
API were around 200ms
based on the Grafana dashboards.
The screenshot is noted below:
Additionally, the response time percentiles logs are noted below too:

Proposal

Since the database query below is properly indexed:
SELECT "ci_pipeline_variables".* FROM "ci_pipeline_variables" WHERE "ci_pipeline_variables"."pipeline_id" = $PIPELINE_ID
It was determined that an optimization that can be done is adding pagination to this endpoint to behave similarly to the /api/projects/:id/variables
API. However, this will introduce a breaking change for existing API users. Due to that impact, the recommendation is for this to be implemented in conjunction with the next major release of 15.0
, which is scheduled for May 22, 2022