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

Build a bot #58

Closed
kentcdodds opened this issue Jul 11, 2017 · 43 comments
Closed

Build a bot #58

kentcdodds opened this issue Jul 11, 2017 · 43 comments
Assignees
Labels
help wanted Extra attention is needed priority: critical

Comments

@kentcdodds
Copy link
Collaborator

I think it's clear that there's interest in the all-contributors spec. There are 259 .all-contributorsrc files on GitHub!

I think that even more people would receive the gratitude they deserve if we had a bot to automate things for us. My vision is I could open an issue or even comment on an issue or pull request with something like:

Hey @AllContributorsBot, please add @soandso to contributors for answering questions and helping with docs

And magic would happen. Anyone wanna do this?!?!?!

@kentcdodds kentcdodds added the help wanted Extra attention is needed label Jul 11, 2017
@kentcdodds
Copy link
Collaborator Author

Note: I think that it would only work if the comment/issue came from someone with commit rights, or if the bot responded with: "Awaiting committer approval" and a committer could respond with: "Approved" or something 👍

@tunnckoCore
Copy link

tunnckoCore commented Jul 21, 2017

Huh! Sounds fantastic, yea! 🎉

@karanjthakkar
Copy link

@kentcdodds let me give this idea a spin over the weekend. I like building bots and shizz. 👻

@gr2m
Copy link

gr2m commented Aug 16, 2017

I recently wrote a tutorial about creating a github app: https://github.com/gr2m/github-app-example. Together with glitch you can get one going in no time, it’s amazingly simple. Holler if you have any questions

@kentcdodds
Copy link
Collaborator Author

Thank you @karanjthakkar and @gr2m! @karanjthakkar, can't wait to hear how it goes 🎉

@karanjthakkar
Copy link

@kentcdodds I made like a really quick flowchart thingy to articulate how I understand the flow for this entire implementation: https://docs.google.com/drawings/d/1D488z_lG-6U9RFFvh1WnXKt7vziP02UGgUf42I49UKw/ I'd love to hear what you think before I go ahead and make something 🙈

@kentcdodds
Copy link
Collaborator Author

Sounds perfect! Thanks!

@gr2m
Copy link

gr2m commented Aug 20, 2017

Note: I think that it would only work if the comment/issue came from someone with commit rights, or if the bot responded with: "Awaiting committer approval" and a committer could respond with: "Approved" or something 👍

Maybe this is something for later, but I’d love if a comment from a non-commiter mentioning @AllContributorsBot would end up in a pull-request instead of a direct change :)

I’m really excited for this, my offer stands to help with building the actual bot. I’ll absolutely evaluate to add it to the @hoodiehq community

@kentcdodds
Copy link
Collaborator Author

Whelp, I've given it some time and this is as far as I got: https://glitch.com/edit/#!/time-discovery

The test repo is here: https://github.com/kentcdodds/temp and the issue I'm using right now is here: kentcdodds/temp#1

I'm stuck at the part where the bot needs to push the all-contributors branch because it doesn't have permission (I think it's unauthenticated and I'm unsure how to authenticate it). Once we get that working then we can create a PR out of the branch and we'll be close!

Help is appreciated!

@karanjthakkar
Copy link

karanjthakkar commented Sep 30, 2017

@kentcdodds I'm assuming the private key in the glitch project is for https://github.com/apps/welcome-bot-kentcdodds-test Can you try adding it to collaborators for https://github.com/kentcdodds/temp and see if the push works after that?

@gr2m
Copy link

gr2m commented Sep 30, 2017

@kentcdodds I’d be happy to help you out! You should absolutely check out https://probot.github.io, it will make your life so much easier. It gives you a node-github instance which is pre-authenticated as the bot, so as long as you gave the github app the right permissions to update content on the repo and enabled webhooks for issue_comments, it should all just work.

Here is an example bot I wrote with probot: https://github.com/gr2m/wip-bot. If you like we can pair on this a bit tomorrow?

@kentcdodds
Copy link
Collaborator Author

Thank you @gr2m!

My glitch is actually using probot (based on your wonderful tutorial!).

The problem is I don't think there's a way to make a commit and push it to a branch on a repo via the GitHub API (at least I couldn't find one), so I'm using raw git commands instead (take a look at the glitch, it's pretty simple). The problem is when I run the git push command.

I won't be available to pair tomorrow, but maybe the next day? 😀

@tunnckoCore
Copy link

@kentcdodds, i can't find it too, but it should totally possible, because Renovate is using APIs (GitLab's and Github's) to do that. And probably GK works that way too.

@gr2m
Copy link

gr2m commented Oct 1, 2017

The problem is I don't think there's a way to make a commit and push it to a branch on a repo via the GitHub API

Oh I do that all the time :) For example, see these lines here: https://github.com/octokit/fixtures/blob/master/lib/notify-about-fixtures-changes.js#L84-L103. It creates a branch, on that branch it creates a few files (which also creates a commit) and then creates a pull request for that branch.

See the create/update file APIs at https://developer.github.com/v3/repos/contents/

@jerodsanto
Copy link

@kentcdodds @gr2m I want this to exist! Is there a way I can hop in and help out? Or even take the ball and run with it if y'all aren't actively pursuing this?

LMK, thanks 💚

@kentcdodds
Copy link
Collaborator Author

Yes, if you want to build this yourself, please do!

@gr2m
Copy link

gr2m commented Nov 8, 2017

go for it @jerodsanto, happy to help out with GitHub API / App / Probot questions

@tech4him1
Copy link

Does someone have a bot in progress? I'd be happy to help out with an existing one if there is, or start work on one myself if there is no work in progress.

@gr2m
Copy link

gr2m commented Dec 9, 2017

just do it :)

@TheLarkInn
Copy link

See @sokra's openbot

@RichardLitt
Copy link

@TheLarkInn I wasn't able to find that on their profile; can you link to it?

@tunnckoCore
Copy link

tunnckoCore commented Mar 23, 2018

@RichardLitt, it is @open-bot I suppose?

@TheLarkInn
Copy link

TheLarkInn commented Mar 23, 2018 via email

@patcon
Copy link
Contributor

patcon commented Mar 26, 2018

Love this idea. Just a heads up, about a story I read lately:
Building Bots to mend Broken Badges (or how to get your GitHub account suspended)

If I'm understanding intent in this issue correctly, the idea is to have the bot take action when a config file is present? If so, a config file existing might not be enough to assume consent (through GitHub's ToS) to have a bot post in the repo. Might need a default flag for "bots_invited": true or something :)

@gr2m
Copy link

gr2m commented Mar 26, 2018

@patcon you would build this as a GitHub app, the consent would be that the a repository maintainer would install the GitHub app :)

There are some folks interested in building this using Probot (a GitHub app framework) over at probot/ideas#46

@jakebolam
Copy link
Collaborator

2K+ now. Anyone started something?

@kentcdodds
Copy link
Collaborator Author

2K+ now.

That is 🤯

I have no plans to work on this personally. But it would be cool!

@jakebolam
Copy link
Collaborator

It seems the all-contributors-bot name is already taken. Has someone set something up?
@tech4him1 @jerodsanto @gr2m

@tech4him1
Copy link

tech4him1 commented Jan 8, 2019

@jakebolam It's not mine. I believe it was already taken when I looked into it over a year ago: #58 (comment).

@jakebolam
Copy link
Collaborator

Thanks @tech4him1. I've got around this for now and I'm starting to make some progress https://github.com/all-contributors/all-contributors-bot
Not fully working yet, but getting close (for the first basic happy path)

@Berkmann18
Copy link
Member

How's the progress in that?
It's definitely a great thing to have and I'll love to help.

@jakebolam
Copy link
Collaborator

Hey @Berkmann18. Progress is coming along nicely. The bot posted it's first PRs today:
all-contributors/app#17 🎉

I've started providing updates on this issue: all-contributors/app#5

It would be great to get help! I think it should be at a point where you can start looking through the code/issues. We are currently fairly blocked on the v8 release of probot (all-contributors/app#7)

@Berkmann18
Copy link
Member

Berkmann18 commented Jan 11, 2019

@jakebolam So essentially this issue depends on all-contributors-bot#5 which depends on all-contributors-bot#7 which depends on probot#774; in other words, holding this one until probot updates their @octokit/rest dependency right?
Or is there something else that can be done in the meantime?

@jakebolam
Copy link
Collaborator

Yes that's correct, so some of the other issues can be worked on (I've just been using unit tests/TDD on them). I can link them all here tomorrow if you like (on the phone right now).

One that comes to mind is the NLP stuff like: all-contributors/app#15

@Berkmann18
Copy link
Member

@jakebolam Sure, I'm no expert in making probots or NLP (although I'm eager to learn/improve in both) but I'll have a look at the NLP one.

@gr2m
Copy link

gr2m commented Jan 11, 2019

in other words, holding this one until probot updates their @octokit/rest dependency right?

I’m optimistic that we will be able to release probot@8.0.0-beta today :) stay tuned :) Love that you create this bot! I want to use it so much!

@jakebolam jakebolam reopened this Jan 12, 2019
@jakebolam
Copy link
Collaborator

@gr2m awesome news!

@gr2m
Copy link

gr2m commented Jan 12, 2019

I didn’t quite finish the beta release train yet, but I’ve manually published 8.0.0-octokit-16-preview, install it with

npm install probot@octokit-16-preview

If you run into any problems check out the change notes here: probot/probot#774 (comment)

Thanks!

@jakebolam
Copy link
Collaborator

https://github.com/all-contributors/all-contributors-bot is running a preview version of probot, and things are looking good.

Development is unblocked!

@jakebolam
Copy link
Collaborator

jakebolam commented Jan 14, 2019

@all-contributors please add tbenning for design

@allcontributors
Copy link
Contributor

@jakebolam

I've put up a pull request to add @tbenning! 🎉

@matbrgz
Copy link
Contributor

matbrgz commented Jan 27, 2019

Bot is awesome. Is it complete?

@jakebolam
Copy link
Collaborator

It's got most features, just working on polishing now.

Feel free to start promoting it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed priority: critical
Projects
None yet
Development

No branches or pull requests