-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-node: add GitHub status as a CI option
Some project in the org don't use Jenkins, which means PRChecker will never succeed for pull requests on those projects. These projects usually have Travis, AppVeyor or other CI systems in place, and those systems will publish the status to GitHub, which can be retrieved via API. This commit adds GitHub status as an optional way to validate if a PR satisfies the CI requirement. We need to check for the CI status in two fields returned by our GraphQL query: commit.status for services using the old GitHub integration, and commits.checkSuites for services using the new GitHub integration via GitHub Apps.
- Loading branch information
Showing
19 changed files
with
623 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "FAILURE" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "COMPLETED", | ||
"conclusion": "FAILURE" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "SUCCESS" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "COMPLETED", | ||
"conclusion": "FAILURE" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "IN_PROGRESS" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "FAILURE" | ||
} | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "PENDING" | ||
} | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "SUCCESS" | ||
} | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
} | ||
} | ||
} | ||
] | ||
|
24 changes: 24 additions & 0 deletions
24
test/fixtures/github-ci/status-failure-check-suite-succeed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "FAILURE" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "COMPLETED", | ||
"conclusion": "SUCCESS" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
|
24 changes: 24 additions & 0 deletions
24
test/fixtures/github-ci/status-succeed-check-suite-failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"commit": { | ||
"committedDate": "2017-10-26T12:10:20Z", | ||
"oid": "9d098ssiskj8dhd39js0sjd0cn2ng4is9n40sj12d", | ||
"messageHeadline": "doc: add api description README", | ||
"author": { | ||
"login": "foo" | ||
}, | ||
"status": { | ||
"state": "SUCCESS" | ||
}, | ||
"checkSuites": { | ||
"nodes": [ | ||
{ | ||
"status": "COMPLETED", | ||
"conclusion": "FAILURE" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
] | ||
|
Oops, something went wrong.