代码托管 CODEARTS REPO-获取合并请求的变化:响应示例

时间:2024-11-30 15:28:38

响应示例

状态码: 200

OK
{
    "result": {
        "id": 42466,
        "iid": 2,
        "project_id": 892155,
        "title": "新建文件 111",
        "description": "merge \"1\" into \"master\"\n新建文件 111",
        "state": "opened",
        "created_at": "2024-03-24T11:29:56.000+08:00",
        "updated_at": "2024-04-10T17:34:06.000+08:00",
        "target_branch": "master",
        "source_branch": "1",
        "user_notes_count": 2,
        "upvotes": 0,
        "downvotes": 0,
        "author": {
            "id": 6916,
            "name": "Online_L0_CodeHub",
            "username": "5cb39fe67a2b465283c1463a87274980",
            "state": "active",
            "name_cn": "Online_L0_CodeHub"
        },
        "source_project_id": 892155,
        "target_project_id": 892155,
        "labels": [],
        "work_in_progress": false,
        "merge_when_pipeline_succeeds": false,
        "merge_status": "can_be_merged",
        "sha": "43b573473948e13934379993943ac5deea7cd391",
        "should_remove_source_branch": false,
        "force_remove_source_branch": false,
        "web_url": "https://test.com/dcf7e8cde4474a4e8219921f564c32d6/test_no_readme/merge_requests/2",
        "time_stats": {
            "total_time_spent": 0
        },
        "squash": false,
        "merge_request_type": "MergeRequest",
        "subscribed": true,
        "changes_count": "1",
        "diff_refs": {
            "base_sha": "ca4cf1a049e286032b25e1604f44f2969818b3f5",
            "head_sha": "43b573473948e13934379993943ac5deea7cd391",
            "start_sha": "ca4cf1a049e286032b25e1604f44f2969818b3f5"
        },
        "user": {
            "can_merge": true
        },
        "added_lines": 5,
        "removed_lines": 0,
        "changes": [
            {
                "old_path": "111",
                "new_path": "111",
                "a_mode": "0",
                "b_mode": "100644",
                "file_path": "111",
                "new_file": true,
                "renamed_file": false,
                "deleted_file": false,
                "diff": "@@ -0,0 +1,5 @@\n+1\r\n+2\r\n+3\r\n+4\r\n+5\n\\ No newline at end of file\n",
                "binary": false,
                "too_large": false,
                "collapsed": false,
                "added_lines": 5,
                "removed_lines": 0,
                "content_sha": "43b573473948e13934379993943ac5deea7cd391",
                "submodule": false,
                "expanded": true,
                "diff_refs": {
                    "base_sha": "ca4cf1a049e286032b25e1604f44f2969818b3f5",
                    "head_sha": "43b573473948e13934379993943ac5deea7cd391",
                    "start_sha": "ca4cf1a049e286032b25e1604f44f2969818b3f5"
                },
                "mode_changed": true,
                "file_type": "text_type"
            }
        ]
    },
    "status": "success"
}
support.huaweicloud.com/api-codeartsrepo/zh-cn_topic_0000002050968029.html