Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

mmarchini
Copy link
Contributor

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
Copy link
Contributor Author

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

@mmarchini
Copy link
Contributor Author

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.

@joyeecheung joyeecheung added the Work In Progress PR's that are in progress label Oct 4, 2019
@codecov
Copy link

codecov bot commented Oct 10, 2019

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
Copy link
Contributor

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

@mmarchini
Copy link
Contributor Author

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
Copy link
Contributor Author

@joyeecheung do you mind removing the WIP tag?

@joyeecheung joyeecheung removed the Work In Progress PR's that are in progress label Dec 9, 2019
@joyeecheung
Copy link
Member

@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
Copy link
Contributor Author

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

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
Copy link
Contributor Author

Rebased

@@ -91,6 +92,10 @@ class Session {
return this.config.waitTimeMultiApproval;
}

get ciType() {
return this.config.ciType || 'jenkins';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make github-check the default now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. If we set github-check as the default, ncu will not warn users that Jenkins jobs didn't ran on a nodejs/node Pull Request, since Travis and GitHub Actions also publish to GitHub Check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we'll need to add extra logic for Travis v.s. Jenkins status updates, then. Until then it always warns unless you do ncu-config set ciType github-check since the bot (or people) no longer posts that comment to the PRs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the bot (or people) no longer posts that comment to the PRs

Which comment? The bot is still commenting when a CI starts.

@joyeecheung joyeecheung merged commit aecac72 into nodejs:master Mar 9, 2020
@joyeecheung
Copy link
Member

Thanks for the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants