nodejs / node-core-utils

CLI tools for Node.js Core collaborators
https://nodejs.github.io/node-core-utils/
MIT License
234 stars 106 forks source link

git-node: add GitHub status as a CI option #369

Closed mmarchini closed 4 years ago

mmarchini commented 4 years ago

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.

mmarchini commented 4 years ago

I'll add docs later, since they'll go to the same place as the docs in #367.

mmarchini commented 4 years ago

Oh no, I thought eslint would fix those lines, but it can't autofix max-len :(

I'll fix it manually and update the PR.

codecov[bot] commented 4 years ago

Codecov Report

Merging #369 into master will increase coverage by 0.29%. The diff coverage is 88.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #369      +/-   ##
==========================================
+ Coverage   75.98%   76.28%   +0.29%     
==========================================
  Files          21       21              
  Lines        1445     1480      +35     
==========================================
+ Hits         1098     1129      +31     
- Misses        347      351       +4     

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 66037a6...c915920. Read the comment docs.

sam-github commented 4 years ago

Even though node uses jenkins, the jenkins results are pushed to github, so this approach might work for node as well.

mmarchini commented 4 years ago

Even though node uses jenkins, the jenkins results are pushed to github, so this approach might work for node as well.

Yes, but it's less reliable since sometimes the bot won't update the status correctly.

mmarchini commented 4 years ago

@joyeecheung do you mind removing the WIP tag?

joyeecheung commented 4 years ago

@mmarchini Can you rebase this branch? The Jenkins status in the Node.js repo are fairly stable now, so it would be good to use this for Node as well. Thanks!

mmarchini commented 4 years ago

On my list. Will try to get this done today or next week.

mmarchini commented 4 years ago

Rebased

joyeecheung commented 4 years ago

Thanks for the PR :)