Obtaining the Status of a Merge Request
Function
This API is used to obtain the status of a merge request.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
codeartsrepo:repository:getMergeRequest |
Read |
- |
- |
- |
- |
URI
GET https://{hostURL}/v4/repositories/{repository_id}/merge-requests/{merge_request_iid}/mergeable-state-out
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repository_id |
Yes |
Integer |
Definition You can query the project list to obtain the repository ID by calling the API used to query user's all repositories. Constraints N/A Default Value N/A Value range: 1~2147483647 |
|
merge_request_iid |
Yes |
Integer |
Definition MR internal ID (IID). Value range: 1~2147483647 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints N/A Range 1–100,000 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
merge_request_id |
Integer |
Definition MR ID. Value range: 0~2147483647 |
|
state |
Boolean |
Definition Mergeable status of an MR. Constraints
|
|
conflict_passed |
Boolean |
Definition Whether the MR conflict gate passes the check. Constraints
|
|
non_ff_passed |
Boolean |
Definition Whether to rebase an MR. Constraints
|
|
merged_by_user_passed |
Boolean |
Definition Whether the current user has the permission to merge the current MR. Constraints
|
|
work_in_progress_passed |
Boolean |
Definition Whether the MR WIP gate check is passed. Constraints
|
|
resolve_discussion_passed |
Boolean |
Definition Whether the MR review comment gate check is passed. Constraints
|
|
ci_state_passed |
Boolean |
Definition Whether the MR pipeline gate is passed. Constraints
|
|
merge_by_self_passed |
Boolean |
Definition Whether the current user has the permission to merge the self-created MR. Constraints
|
|
can_force_merge |
Boolean |
Definition Whether the current user can forcibly merge the current MR. Constraints
|
|
vote_passed |
Boolean |
Definition Whether the MR scoring gate check is passed. Constraints
|
|
e2e_check_passed |
Boolean |
Definition Whether the gate check indicating an MR must be associated with CodeArts Req is passed. Constraints
|
|
all_issues_passed |
Boolean |
Definition Whether the gate check for all E2E ticket number verification of an MR is passed. Constraints
|
|
only_one_issue_passed |
Boolean |
Definition Whether the gate check indicating an MR can only be associated with one ticket number is passed. Constraints
|
|
approval_reviewers_required_passed |
Boolean |
Definition Whether the gate check for an MR review is passed. Constraints
|
|
approval_approvers_required_passed |
Boolean |
Definition Whether an MR approving gate check is passed. Constraints
|
|
evaluation_passed |
Boolean |
Definition Whether the MR score evaluation gate check is passed. Constraints
|
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. |
|
error_msg |
String |
Definition Error message. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. |
|
error_msg |
String |
Definition Error message. |
Example Requests
GET https://{endpoint}/v4/repositories/1/merge-requests/1/mergeable-state-out
Example Responses
Status code: 200
OK
{
"merge_request_id" : 1,
"state" : true,
"conflict_passed" : true,
"non_ff_passed" : true,
"merged_by_user_passed" : true,
"work_in_progress_passed" : true,
"resolve_discussion_passed" : true,
"ci_state_passed" : true,
"merge_by_self_passed" : true,
"can_force_merge" : true,
"vote_passed" : true,
"e2e_check_passed" : true,
"all_issues_passed" : true,
"only_one_issue_passed" : true,
"approval_reviewers_required_passed" : true,
"approval_approvers_required_passed" : true,
"evaluation_passed" : true
}
Status code: 401
Unauthorized
{
"error_code" : "CH.00000002",
"error_msg" : "Recognize authentication information failed."
}
Status code: 404
Not Found
{
"error_code" : "CH.00402000",
"error_msg" : "The repository does not exist. Check and try again."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
|
401 |
Unauthorized |
|
404 |
Not Found |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot