Skip to content

Repository Review API

Choldrim edited this page Apr 26, 2016 · 6 revisions

home page: https://rr.deepin.io

API Base

https://rr.deepin.io/api/v1

创建请求

POST /review

headers

  • str: Access-Token - 用户token

参数

  • str: topic - 对这次合并请求的简单描述
  • str: comment - 对这次合并的详细描述
  • str: base - 基础仓库(需要填写完整url,如:http://pools.corp.deepin.com/deepin)
  • str: base_codename - 基础仓库的代号,如unstable
  • str: rpa - ppa仓库(需要填写完整url,如:http://pools.corp.deepin.com/ppa/dstore)
  • str: rpa_codename - ppa仓库的代号,如unstable
  • str: shell - 暂时为保留字段,直接回复空字符即可

返回数据

{
    "failed": false,
    "result": {"review_id": 23}
}

获取所有review状态信息

GET /reviews

headers

  • str: Access-Token - 用户token

参数

返回数据

{
    "failed": false,
    "result": {
        "reviews":[{
                "id": 23,
                "topic": "balaba",
                "base": "http://packages.deepin.com/deepin",
                "base_codename": "unstable",
                "rpa": "http://pools.corp.deepin.com/ppa/dstore",
                "rpa_codename": "experimental",
                "status": "open",
                "submit_timestamp": 1456999262
            },
            {
                "id": 24,
                "topic": "balaba",
                "base": "http://packages.deepin.com/deepin",
                "base_codename": "unstable",
                "rpa": "http://pools.corp.deepin.com/ppa/dstore",
                "rpa_codename": "experimental",
                "status": "open",
                "submit_timestamp": 1456999262
            }
        ]
    }
}

获取单个review状态信息

GET /review/:review_id

headers

  • str: Access-Token - 用户token

参数

返回数据

{
    "failed": false,
    "result": {
        "id": 23,
        "topic": "balaba",
        "base": "http://packages.deepin.com/deepin",
        "base_codename": "unstable",
        "rpa": "http://pools.corp.deepin.com/ppa/dstore",
        "rpa_codename": "experimental",
        "comment": "comment",
        "shell": "echo hello world",
        "status": "open",
        "submit_timestamp": 1456999262,
        "comments":[
            {
                "submitter": "choldrim",
                "content": "look good to me ;)",
                "create_timestamp": 1456999262,
                "score": 1
            },
            {
                "submitter": "wangyanli",
                "content": "start testing",
                "create_timestamp": 1456999262,
                "score": 0
            },
            {
                "submitter": "wangyanli",
                "content": "test failed",
                "create_timestamp": 1456999262,
                "score": 0
            }
        ]
    }
}

评论接口

POST /comment/:review_id

headers

  • str: Access-Token - 用户token

参数

  • str: content - 评论内容
  • int: score - 评分(-1 | 0 | 1)

返回数据

{
    "failed": false,
    "result": ""
}

测试结果接口

POST /test_result/:review_id

headers

  • str: Access-Token - 用户token

参数

  • str: comment - 评论内容
  • bool: passed - 测试结果

返回数据

{
    "failed": false,
    "result": ""
}

合并

POST /merge/:review_id

headers

  • str: Access-Token - 用户token

参数

返回数据

{
    "failed": false,
    "result": ""
}

反馈仓库合并结果

POST /merge_result/:review_id

headers

  • str: Access-Token - 用户token

参数

  • bool: passed - 仓库合并通过与否
  • str: content - 附加的合并结果展示(可返回跳转到对应地址的url链接)

返回数据

{
    "failed": false,
    "result": ""
}

丢弃

POST /abandon/:review_id

headers

  • str: Access-Token - 用户token

参数

返回数据

{
    "failed": false,
    "result": ""
}

重新触发review

POST /retrigger_review/:review_id

headers

  • str: Access-Token - 用户token

参数

返回数据

{
    "failed": false,
    "result": ""
}

官方仓库推送通知(用于刷新review状态)

POST /repo/official_release

参数

返回数据

{
    "failed": false,
    "result": ""
}
ps: 所有返回的数据中,failed字段为false的表示处理过程中没有异常,处理正确之意。
Clone this wiki locally