Default Reviewer

With default reviewers, you define which project members are automatically added as reviewers to code reviews of a repository.

Attributes

repository

The ID of the repository that the membership is for. When requesting, you can expand it to the full repository object by including the query parameter expand=repository.

  • Type: string
  • Required: true

person

The ID of the person (user/collaborator). When requesting, you can expand it to the full person object by including the query parameter expand=person.

  • Type: string
  • Required: true

Operations

GET /projects/:project_id/repositories/:repository_id/default_reviewers

Lists all default reviewers for a repository, with optional limit and offset parameters, as a metadata-results object.

Example request

curl -X GET \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/default_reviewers

Example response

{
"metadata": {
"more_results": false,
"next_offset": 0,
"total_count": 1,
"count": 1
},
"results": [
{
"api_status": 200,
"api_timestamp": "2018-10-25T09:29:37Z",
"repository": {
"id": "acme",
"uuid": "f90da853-c5f2-4e55-9fa5-773e83b78784"
},
"person": {
"id": "johndoe",
"uuid": "a942b42f-14d8-4675-b9e4-ce4a4e5f69de",
"type": "user"
}
}
]
}

POST /projects/:project_id/repositories/:repository_id/default_reviewers

Adds a default reviewer for a repository. The person must have a project or repository role, either directly or through a group.

Example request

curl -X POST \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
-H "Content-Type: application/json" \
-d '{ "id": "a942b42f-14d8-4675-b9e4-ce4a4e5f69de" }' \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/default_reviewers

Example response

{
"api_status": 201, "api_timestamp": "2018-10-25T09:29:37Z", "repository": { "id": "acme", "uuid": "f90da853-c5f2-4e55-9fa5-773e83b78784" }, "user": { "id": "johndoe", "uuid": "a942b42f-14d8-4675-b9e4-ce4a4e5f69de", type: "user" } }

DELETE /projects/:project_id/repositories/:repository_id/default_reviewers/:person_id

Removes a person from default reviewers. Returns the removed default reviewer.

Example request

curl -X DELETE \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/default_reviewers/a942b42f-14d8-4675-b9e4-ce4a4e5f69de

Example response

"api_status": 200,
"api_timestamp": "2018-11-28T10:12:28Z",
"repository": { "id": "acme", "uuid": "f90da853-c5f2-4e55-9fa5-773e83b78784"
},
"user": { "id": "johndoe", "uuid": "a942b42f-14d8-4675-b9e4-ce4a4e5f69de",
"type": "user"
} }