Skip to content

Commit 819e13f

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent c4d7ba7 commit 819e13f

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
kind: change
3+
title: Pagination in the Combined Status API
4+
created_at: 2014-06-19
5+
author_name: bhuga
6+
---
7+
8+
We're getting close to bringing the [Combined Status API][1] out of preview
9+
mode, and have just a couple of small changes to make before it's :sparkles:.
10+
11+
First, we're now [paginating][2] combined status API calls. The combined status
12+
`state` field will always take all statuses into account, but we'll now only
13+
return 100 embedded statuses at a time.
14+
15+
Second, we're adding a `total_count` field, mirroring the Search API. This
16+
count represents the number of contexts submitted for the given commit.
17+
18+
As always, we're interested in [hearing your feedback][3].
19+
20+
[1]: /v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
21+
[2]: /v3/#pagination
22+
[3]: https://github.com/contact?form[subject]=Combined+Status+API

content/v3/repos/statuses.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ Users with pull access can access a combined view of commit statuses for a given
106106

107107
GET /repos/:owner/:repo/commits/:ref/status
108108

109-
The most recent status for each context is returned (up to 25), as well as a combined
110-
`state`. The `state` is `pending` to start, `failure` if any status reports as
111-
`error` or `failure`, `pending` if any context's latest status is `pending`, and
112-
`success` if the latest status for all contexts is `success`. (`null` is
113-
considered a distinct context)
109+
The most recent status for each context is returned, up to 100. This field
110+
[paginates](/v3/#pagination) if there are over 100 contexts.
111+
112+
Additionally, a combined `state` is returned. The `state` is one of:
113+
114+
* **failure** if any of the contexts report as error or failure
115+
* **pending** if there are no statuses or a context is pending
116+
* **success** if the latest status for all contexts is success
114117

115118
### Parameters
116119

lib/resources.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,7 @@ def text_html(response, status, head = {})
16291629
"state" => "success",
16301630
"name" => "octocat/Hello-World",
16311631
"sha" => COMMIT["sha"],
1632+
"total_count" => 2,
16321633
"statuses" => [
16331634
SIMPLE_STATUS.merge("context" => "continuous-integration/jenkins"),
16341635
SIMPLE_STATUS.merge("context" => "security/brakeman")

0 commit comments

Comments
 (0)