alexellis / derek

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

Add Hacktoberfest feature #134

Closed burtonr closed 5 years ago

burtonr commented 5 years ago

Description

This change adds the new feature hacktoberfest The goal of this feature is to find flyby pull requests that are considered spam. A pull request that is a first time contributor, not signed, and only changing markdown (md) files is assumed to be spam. If the contributor has read the contribution guide, they would have signed their commit, and the handler would have no affect. Otherwise, the pull request is closed, and an invalid label is added indicating that this PR should not be counted

Signed-off-by: Burton Rheutan rheutan7@gmail.com

Motivation and Context

How Has This Been Tested?

Added unit tests to verify the "markdown only" function works as expected.

Unfortunately, I was unable to deploy and test as my deployment of Derek was not able to access the secret for some reason. I've run out of time this evening to debug further.

Types of changes

Checklist:

We can update the documentation once this feature passes an Alpha/Beta phase of testing

burtonr commented 5 years ago

I've built the container with this change available here: burtonr/derek:pr-hacktoberfest

burtonr commented 5 years ago

Just found out that the fetchPullRequestCommits() does not return the list of files, although it is available in the struct. I will need to add another method for getting the files.

burtonr commented 5 years ago

@alexellis I've updated the changes to include the new fetchPullRequestFiles() function. The updated image is here: burtonr/derek:pr-hacktoberfest3

Tested with a lot of support from @rgee0 :100:

Screenshot from 2019-10-03 21-05-13

To confirm this will not affect legitimate, signed, PRs:

Screenshot from 2019-10-03 21-10-26

alexellis commented 5 years ago

The screenshots look good. I would like to see a message from Derek explaining as briefly as possible what happened / why. This is to mitigate honest mistakes

burtonr commented 5 years ago

I've added a message to the handler with a link to the contributing guide as well as the Hacktoberfest "Quality Standards" here: https://hacktoberfest.digitalocean.com/details#quality-standards

Available in the image burtonr/derek:pr-hacktoberfest5

Screenshot from 2019-10-04 08-28-00

burtonr commented 5 years ago

As a "good to know", the Hacktoberfest site does recognize the "spam" tagged by this feature

Screenshot from 2019-10-04 08-42-26

alexellis commented 5 years ago

This is looking good.

Can we show there is no regression? Does it still work with the regular pull request use-case for DCO and for labels?

Just the user guide needs updating now, in an additional commit please.

alexellis commented 5 years ago

I'll merge so we can start trying it out. Please take a look at the naming question and send another PR to amend, also update the user guide.

burtonr commented 5 years ago

Thank you! I'll do those minor updates and the user guide this evening in a new PR

alexellis commented 5 years ago

https://github.com/alexellis/derek/releases/tag/0.9.2