alexellis / derek

Reduce maintainer fatigue by automating GitHub
https://github.com/alexellis/derek/blob/master/USER_GUIDE.md
MIT License
806 stars 72 forks source link

Hacktoberfest update #136

Closed burtonr closed 4 years ago

burtonr commented 4 years ago

Description

Updates to the Hacktoberfest feature from the comments on the original PR #134

Motivation and Context

How Has This Been Tested?

Deployed Derek from my repo: burtonr/derek:pr-hacktoberfest7 Currently running on https://github.com/burtonr/testing

Types of changes

Checklist:

burtonr commented 4 years ago

This is a draft as I still need to update the documentation.

More importantly, I cannot figure out how or why the "sign-off" comment/check is still being run...

Screenshot from 2019-10-10 00-14-14

It seems no matter what happens, the sign-off comment is added. Perhaps it's a race where the "isSpam" is not yet returned, but the next feature is run

jonatasbaldin commented 4 years ago

Should we make a time check to see if the PR date is in October? We'd probably lower the false positives 🤔

burtonr commented 4 years ago

Found the cause of the multiple comments/labels was the individual events on the pull request by each of the actions performed by the hacktoberfest handler. Add label, close, add comment.

To prevent the additional handlers from firing, I've re-arranged the hacktoberfest handler to first close the PR, then do the other things. In addition, I've added the State to the Pull Request type so that the Action and State are verified to not be "closed" before calling the handlers.

Link to the repo used for testing this: https://github.com/burtonr/more-bots-2

Note: The image used for these tests was created before updating the message to say "Thanks for your interest...". The message has since been updated.

"Spam" PR:

Screenshot from 2019-10-13 23-19-49

Readme change with signed off commit:

Screenshot from 2019-10-13 23-27-36

Code file change without signoff:

Screenshot from 2019-10-13 23-30-09