PySnooper icon indicating copy to clipboard operation
PySnooper copied to clipboard

Infrastructure improvement: AUTHORS bot

Open cool-RR opened this issue 6 years ago • 9 comments

@bittner Here's another one you might like. I want the upkeep of the AUTHORS file to be automated, basically running:

misc/generate_authors.py > AUTHORS

It would be cool to have a bot that automatically submits pull requests whenever the AUTHORS file is different than the one generated above (i.e. we just merged a new author.) Then I could approve that pull request with a click instead of having to maintain AUTHORS manually.

cool-RR avatar Apr 24 '19 12:04 cool-RR

Actually this could even be an open-source project in its own right, if you're looking for cool projects :)

cool-RR avatar Apr 24 '19 12:04 cool-RR

@cool-RR It seems that there is something like this here (I have never used it though): https://allcontributors.org/docs/en/bot/overview that does exactly what you are describing :)

lleontop avatar Apr 24 '19 12:04 lleontop

Nice, if you believe it can be customized to output the exact format of my simple script above into AUTHORS, I'll be happy to see a pull request for adding this bot. (Probably a pull request for the configuration, and I'll add the bot in the settings.)

On Wed, Apr 24, 2019 at 3:57 PM Loukas Leontopoulos < [email protected]> wrote:

@cool-RR https://github.com/cool-RR It seems that there is something like this here (I have never used it though): https://allcontributors.org/docs/en/bot/overview that does exactly what you are describing :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cool-RR/PySnooper/issues/41#issuecomment-486217116, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAN3SWDCDO32XX3BOPZKTLPSBKJLANCNFSM4HIDPJ4Q .

cool-RR avatar Apr 24 '19 12:04 cool-RR

Bots are en vogue. Let's reflect a bit, though, what the cases are where they're meant to be used:

  • When there are external circumstances or events that infer change (e.g. updated package dependencies, security threats, customer decisions or missing activity)

In the case of authors on this very repository it is much simpler: We always have a, at least one, event on this code base that can trigger an update. Hence, instead of a bot periodically visiting the repository or working with a subscriber-comsumer model this is really just about an event triggered by GitHub, e.g. an implementation may look like:

  • typically, a check on Travis that ensures the authors are complete, and
  • adding the author shall be the contributor's duty; when the checks don't pass there's no merging of the PR. Simple as that.

But sure, yeah, I know, everyone wants bots. :robot: And I'm the dog in the manger. Sorry! :smile:

bittner avatar Apr 24 '19 14:04 bittner

I share the resentment for bots. However, your approach increases manual work and frustration.

On Wed, Apr 24, 2019, 17:17 Peter Bittner [email protected] wrote:

Bots are en vogue. Let's reflect a bit, though, what the cases are where they're meant to be used:

  • When there are external circumstances or events that infer change (e.g. updated package dependencies, security threats, customer decisions or missing activity)

In the case of authors on this very repository it is much simpler: We always have a, at least one, event on this code base that can trigger an update. Hence, instead of a bot periodically visiting the repository or working with a subscriber-comsumer model this is really just about an event triggered by GitHub, e.g. an implementation may look like:

  • typically, a check on Travis that ensures the authors are complete, and
  • adding the author shall be the contributor's duty; when the checks don't pass there's no merging of the PR. Simple as that.

But sure, yeah, I know, everyone wants bots. 🤖 And I'm the dog in the manger. Sorry! 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cool-RR/PySnooper/issues/41#issuecomment-486260951, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAN3SRGVH5ISOBU7OS5XFTPSBTWFANCNFSM4HIDPJ4Q .

cool-RR avatar Apr 24 '19 14:04 cool-RR

Well, software development is about frustration, learning and a few happy moments of success.

How about a solution that looks like this?

$ tox -e authors
New author(s) added. You may now commit the updated AUTHORS file.

Does that sound like proper software development? Or more like frustration?

bittner avatar Apr 24 '19 15:04 bittner

tox -e authors is a nice addition, I'd welcome it.

I want to clarify what I meant about frustration: I mean that people will try to submit pull request and have it fail because the AUTHORS file isn't updated, and they'll have to go back and update that. This hurts the greater goal of getting people to contribute, which is more important than keeping an updated AUTHORS file.

Also consider it might be a bit tricky to generate AUTHORS before a pull request is submitted, you'll have to tweak the script to look at the pull request branch rather than master.

So right now:

  1. I support adding tox -e authors as a nice entry point to the script.
  2. I support configuring a bot to do pull requests to update the AUTHORS.

cool-RR avatar Apr 24 '19 15:04 cool-RR

An appropriate command to extract the authors information from the repository would be:

git log --format="%aN <%aE>" --reverse | sort --uniq

This wouldn't work on Windows, though, I guess. Any thoughts?

bittner avatar Apr 25 '19 11:04 bittner

Works for me on Windows with Bash, but I don't like it because it doesn't give the order that I want.

On Thu, Apr 25, 2019 at 2:51 PM Peter Bittner [email protected] wrote:

An appropriate command to extract the authors information from the repository would be:

git log --format="%aN <%aE>" --reverse | sort --uniq

This wouldn't work on Windows, though, I guess. Any thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cool-RR/PySnooper/issues/41#issuecomment-486640273, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAN3SWI5MK3T7HKDLMAGKDPSGLK3ANCNFSM4HIDPJ4Q .

cool-RR avatar Apr 25 '19 12:04 cool-RR