Skip to content

Add `central_pipeline` to monorepo API response

路志远请求将feat-monorepo-ci-project合并到main-jh

What does this MR do and why?

Related issue: https://jihulab.com/gitlab-cn/gitlab/-/issues/3524

Add the central_pipeline field to the return value of the GET API.

Query SQLs

Click to expand
-- ::Ci::PipelinesFinder.new(project, user, { updated_after: created_at }).execute
SELECT
  "ci_pipelines"."id",
  "ci_pipelines"."ref",
  "ci_pipelines"."sha",
  "ci_pipelines"."before_sha",
  "ci_pipelines"."created_at",
  "ci_pipelines"."updated_at",
  "ci_pipelines"."tag",
  "ci_pipelines"."yaml_errors",
  "ci_pipelines"."committed_at",
  "ci_pipelines"."project_id",
  "ci_pipelines"."status",
  "ci_pipelines"."started_at",
  "ci_pipelines"."finished_at",
  "ci_pipelines"."duration",
  "ci_pipelines"."user_id",
  "ci_pipelines"."lock_version",
  "ci_pipelines"."auto_canceled_by_id",
  "ci_pipelines"."pipeline_schedule_id",
  "ci_pipelines"."source",
  "ci_pipelines"."config_source",
  "ci_pipelines"."protected",
  "ci_pipelines"."failure_reason",
  "ci_pipelines"."iid",
  "ci_pipelines"."merge_request_id",
  "ci_pipelines"."source_sha",
  "ci_pipelines"."target_sha",
  "ci_pipelines"."external_pull_request_id",
  "ci_pipelines"."ci_ref_id",
  "ci_pipelines"."locked",
  "ci_pipelines"."partition_id"
FROM
  "ci_pipelines"
WHERE
  "ci_pipelines"."project_id" = 1017
  AND "ci_pipelines"."source" != 12
  AND "ci_pipelines"."updated_at" >= '2023-02-20 13:28:10.323476'
ORDER BY
  "ci_pipelines"."id" DESC
-- pipeline.variables.any? do |variable|
--   variable.key == PIPELINE_BRANCH_VARIABLE_KEY && variable.value == @branch_name
-- end
SELECT
  "ci_pipeline_variables"."key",
  "ci_pipeline_variables"."value",
  "ci_pipeline_variables"."encrypted_value",
  "ci_pipeline_variables"."encrypted_value_salt",
  "ci_pipeline_variables"."encrypted_value_iv",
  "ci_pipeline_variables"."pipeline_id",
  "ci_pipeline_variables"."variable_type",
  "ci_pipeline_variables"."partition_id",
  "ci_pipeline_variables"."raw",
  "ci_pipeline_variables"."id"
FROM
  "ci_pipeline_variables"
WHERE
  "ci_pipeline_variables"."pipeline_id" = 643

Screenshots or screen recordings

Currently MR will not bring about UI changes.

Our final goal is:

Before After

How to set up and validate locally

Just like this: How to set up and validate locally

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

路志远 编辑于

合并请求报告

加载中