Skip to content

Add API to bulk merge MR list in monorepo mode

路志远请求将feat-monorepo-add-post-api合并到main-jh

Related issue: https://jihulab.com/gitlab-cn/gitlab/-/issues/3147 | Dependent MR: Add API to query MR list in monorepo mode

What does this MR do and why?

Add an API to bulk merge MR list in monorepo mode

POST /{project_path}/-/merge_requests/{mr_id}/bulk_merge

Screenshots or screen recordings

When user clicks 全部合并, this new API will be requested.

How to set up and validate locally

  1. Turn on feature flag. And make sure there is already a valid ~"GitLab Premium"

    Feature.enable(:ff_monorepo)
  2. Under the same Group, create multiple Projects

  3. Create an MR in each Project, and these MRs meet the following conditions

    • have the same source_branch
    • have monorepo label
  4. Call this new API:

    PROJECT_PATH=flightjs/Flight
    MERGE_REQUEST_ID=24
    YOUR_COOKIES_FROM_BROWSER='...'
    curl --location --request POST 'http://127.0.0.1:3000/$PROJECT_PATH/-/merge_requests/$MERGE_REQUEST_ID/bulk_merge' \
    --header 'Cookie: $YOUR_COOKIES_FROM_BROWSER' \
    --data ''
  5. Refresh the page of a single MR and expect to see that the MR is being merged and then merged.

MR acceptance checklist

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

路志远 编辑于

合并请求报告