Skip to content

Reviews API

KuiKui edited this page Jul 3, 2012 · 1 revision

List reviews

GET http://crew-server/api.php/projects/:project_id/reviews

Parameters : none

Return : JSON array of reviews (code 200) or message if it's failed (code 400)

[
  {
    "Id": 83,
    "RepositoryId": 2,
    "Name": "execute-in-appdomains",
    "BaseBranchName": "master",
    "CommitReference": "24825e75cadc1c6bf3cae79096d18fccc30d697b",
    "LastCommit": "7abbb643e27a0f7a6a681c6efb938ce8d64d273e",
    "LastCommitDesc": "Add a sample Release folder to test the updating app with",
    "IsBlacklisted": 0,
    "ReviewRequest": 0,
    "Status": 2,
    "CommitStatusChanged": "7abbb643e27a0f7a6a681c6efb938ce8d64d273e",
    "UserStatusChanged": 7,
    "DateStatusChanged": "2012-04-18 09:04:30",
    "CreatedAt": null,
    "UpdatedAt": "2012-04-18 09:04:30"
  },
  {
    "Id": 419,
    "RepositoryId": 2,
    "Name": "mustache",
    "BaseBranchName": "master",
    "CommitReference": "a1d65579fc591ec23e04b5b407220f4dd5f5cbef",
    "LastCommit": "990d393d2055f9df05b7c5a084f1151a639f40e4",
    "LastCommitDesc": "mustache'd strings and sets and pagination",
    "IsBlacklisted": 0,
    "ReviewRequest": 0,
    "Status": 2,
    "CommitStatusChanged": "990d393d2055f9df05b7c5a084f1151a639f40e4",
    "UserStatusChanged": 7,
    "DateStatusChanged": "2012-04-18 09:05:17",
    "CreatedAt": null,
    "UpdatedAt": "2012-04-18 09:05:17"
  }
]

Review status code :

  • 0 : review pending
  • 1 : review OK
  • 2 : review KO
  • -1 : error

Get a review

GET http://crew-server/api.php/projects/:project_id/reviews/:branch_name

Parameters : none

Return : JSON array of review fields (code 200) or message if it's failed (code 400 or 404)

{
  "Id": 419,
  "RepositoryId": 2,
  "Name": "mustache",
  "BaseBranchName": "master",
  "CommitReference": "a1d65579fc591ec23e04b5b407220f4dd5f5cbef",
  "LastCommit": "990d393d2055f9df05b7c5a084f1151a639f40e4",
  "LastCommitDesc": "mustache'd strings and sets and pagination",
  "IsBlacklisted": 0,
  "ReviewRequest": 0,
  "Status": 2,
  "CommitStatusChanged": "990d393d2055f9df05b7c5a084f1151a639f40e4",
  "UserStatusChanged": 7,
  "DateStatusChanged": "2012-04-18 09:05:17",
  "CreatedAt": null,
  "UpdatedAt": "2012-04-18 09:05:17"
}

Request a review

POST : http://crew-server/api.php/projects/:project_id/reviews

Parameters :

  • branch : feature branch
  • base_branch : branch to diff with
  • commit : feature branch commit to compare with base branch

Return : none (code 200 or 201) or message if it's failed (code 400, 404 or 422)

Delete a review

DELETE http://crew-server/api.php/projects/:project_id/reviews/:branch_name

Parameters : none

Return : none (code 200) or message if it's failed (code 400 or 404)