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

Oppiabots response when a PR fails a check suite #110

Merged
merged 5 commits into from
Aug 10, 2020

Conversation

jameesjohn
Copy link
Contributor

Explanation

Comments on the PR and assigns the PR author when the PR fails a check suite.
This feature has been tested at jameesjohn/comment-on-pr#41

Checklist

  • I have successfully deployed my own instance of Oppiabot.
    • You can find instructions for doing this here.
  • I have manually tested all the changes made in this PR following the manual tests matrix.

Copy link
Contributor

@ankita240796 ankita240796 left a comment

Choose a reason for hiding this comment

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

Hi @jameesjohn, looks good overall, took first pass, PTAL. Thanks!

lib/ciChecks.js Show resolved Hide resolved
lib/ciChecks.js Outdated
// limitations under the License.

/**
* Check for CI test failure and pings PR author.
Copy link
Contributor

Choose a reason for hiding this comment

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

This function checks for...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

lib/ciChecks.js Outdated
Comment on lines 25 to 27
// A checksuite might fail due to a merge to develop. We don't need to
// check for these since they are not failures related to a pull request.
if (checkSuite.pull_requests.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I did not understand this part - are you talking about the failure which happens when we merge to develop before running tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some checks fail in develop due to a PR being merged. These checks are not affiliated to any pull request since they happened on the develop branch, and as a result, will lead to an empty pull_requests array from the payload.

Copy link
Contributor

@ankita240796 ankita240796 Aug 7, 2020

Choose a reason for hiding this comment

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

Ah ok - thanks for explaining. Add your reply to the comment in file as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

lib/ciChecks.js Show resolved Hide resolved
lib/ciChecks.js Outdated
body:
'Hi @' +
prAuthor +
', there are some failing CI checks in your latest push, PTAL' +
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also add a link to the failing test?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, add in the comment that if you think that the test is a flake please file an issue before restarting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, add in the comment that if you think that the test is a flake please file an issue before restarting.

Done

Can we also add a link to the failing test?

No, because what we are listening to is the check suite and not the individual check run.
I didn't think it will be okay for oppiabot to comment on every failing test which is why I'm checking for a failure in the check suite.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, makes sense.

@jameesjohn jameesjohn assigned ankita240796 and unassigned jameesjohn Aug 7, 2020
Copy link
Contributor

@ankita240796 ankita240796 left a comment

Choose a reason for hiding this comment

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

Just one minor nit, LGTM! Feel free to submit after resolving, Thanks!

lib/ciChecks.js Outdated
Comment on lines 25 to 27
// A checksuite might fail due to a merge to develop. We don't need to
// check for these since they are not failures related to a pull request.
if (checkSuite.pull_requests.length > 0) {
Copy link
Contributor

@ankita240796 ankita240796 Aug 7, 2020

Choose a reason for hiding this comment

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

Ah ok - thanks for explaining. Add your reply to the comment in file as well.

Copy link
Contributor

@ankita240796 ankita240796 left a comment

Choose a reason for hiding this comment

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

Lgtm - I have one query though - tests finish at different time - so will be ping user multiple times if there are more than one failures at different time?

@jameesjohn
Copy link
Contributor Author

Since we are listening on check suite, we will ping the user once (after all the tests are completed).

@oppiabot
Copy link

oppiabot bot commented Aug 10, 2020

Hi @jameesjohn. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

Copy link
Contributor

@ankita240796 ankita240796 left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks @jameesjohn! Let me know when I should deploy.

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.

2 participants