Rebase without pipeline to skip refreshing external status check
What does this MR do and why?
Related issue: https://jihulab.com/gitlab-cn/gitlab/-/issues/2723
Upstream MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117022
Some Chinese users hope to rebase without pipeline action also
skip the external status check with the similar logic. So JH will
create the new status check response records with skipped
status
when the user click rebase without pipeline
. These skipped records
can be used to check if its last status is succeed, then the merge
action will not be blocked by original pending
status check result.
Screenshots or screen recordings
Before:
After:
Queries
Generated by MergeRequests::ExternalStatusCheck#status
Previously
SELECT "status_check_responses".*
FROM "status_check_responses"
WHERE "status_check_responses"."merge_request_id" = 87
AND "status_check_responses"."external_status_check_id" = 97
AND "status_check_responses"."sha" = '\xb83d6e391c22777fca1ed3012fce84f633d7fed0'
ORDER BY "status_check_responses"."id" DESC
LIMIT 1
Now
Use previous query and:
SELECT "status_check_responses".*
FROM "status_check_responses"
WHERE "status_check_responses"."merge_request_id" = 89
AND "status_check_responses"."status" != 2
AND "status_check_responses"."external_status_check_id" = 99
ORDER BY "status_check_responses"."id" DESC
LIMIT 1
How to set up and validate locally
Merge Requests
options
1. Config - In a project
Setting -> Merge Requests
page, chooseFast-forward merge
forMerge method
option. - Check these options for
Merge checks
: Pipelines must succeed / Skipped pipelines are considered successful / Status checks must succeed. - Add some status check rules in
Status checks
. - Click 'Save changes' button.
2. Rebase workflow
- Create a new MR, such as named
mr001
, confirm the first pipeline is passed. - Use
curl
orPostman
tool to request the API to Set status of an external status check, confirm all status check rules are passed. - Add a new commit in main branch.
- Refresh mr001 MR page, should see the
Rebase without pipeline
button displayed, click it. - Refresh mr001 MR page again, should see the
Merge
button displayed, and all the status check still remain the passed state. - Click the
Merge
button, the mr001 MR should be merged successfully.
由 xfyuan 编辑于