A base for stateless GitHub Bot,and one hosted implementation thereof.
See what is a Meeseeks and a MeeseeksBox.
See usage statistics.
We host MeeseeksBox(es) and will expose them as GitHub Integrations so you don't have to host and run your own. You can if you want, it should be pretty simple.
The advantage of having one and only one box, is to do cross repository operations (and fix security bugs).
The drawback is if there is a security issue, then we're screwed.
Head there and activate MeeseeksDev on repos you have access to.
On a repository with MeeseeksDev installed say: @MeeseeksDev Hello
to be
sure MeeseeksDev is correctly installed.
Enjoy
You might also want to tell your CI-integration (like travis-ci) not to test the push and the merge. To do so use:
branches:
except:
- /^auto-backport-of-pr-[0-9]+$/
If you want per-repository configuration, create a .meeseeksdev.yml
file at
the root of the repository. For now this file allow you to give fine-grained
permissions to users.
users:
<username>:
can:
- <command 1>
- <command 2>
- ...
<username>
can:
- ...
This will allow <username>
to ask @meeseeksdev
to perform above commands.
The conf file is the one that sits on the repository default branch (usually
master
).
Comment on a Pr or issue.
You may put multiple commands, one per line.
MrMeeseeks may not like what you ask, and just ignore you.
Respond with
Hello {user} look at me, I'm Mr Meeseeks
To test whether a Meeseeks understand you.
If issued from a PR which is merged, attempt to backport (cherry-pick the merge commit) on an older branch and submit a PR with this backport (on said branch)
Apply origin-pr labels and milestone to backport.
Repo admins only
Note: Cloning can take a long-time. So expect MrMeeseeks to be busy while this happen. Also heroku has a 2min deadline and other limitations, so MrMeeseeks can likely be killed. I haven't implemented a queue yet.
If issued from a PR, will apply black to commits made in this PR and push the updated commits.
You can also use "blackify" as an alias.
Repo admins only, we plan to make it available to PR authors as well.
MeeseeksDev Bot needs to be installed on the PR source repository for this to work. If it's not it will ask you to do so.
If issued from a PR, will apply pre-commit to this PR and push a commit with the changes made. If no changes are made, or the changes cannot be automatically fixed, it will show a comment in the PR and bail.
You can also use "precommit" as an alias.
Repo admins only, we plan to make it available to PR authors as well.
MeeseeksDev Bot needs to be installed on the PR source repository for this to work. If it's not it will ask you to do so.
(in progress)
If issued from a PR, will apply autopep8 to the current lines changed by this PR, and push an extra commit to it that fixes pep8.
Code in progress and due to GitHub API limitation only works if MeeseeksDev also available on Source repo of the PR.
Repo admins only, plan to make it available to PR author as well.
MeeseeksDev Bot need to be installed on the PR source repository for this to work. If it's not it will ask you to do so.
Needs MeeseeksBox to be installed on both current and target repo. Command issuer to be admin on both.
MeeseeksDev will open a similar issue, replicate all comments with links to first, migrate labels (if possible).
Close the issue. Useful when replying by mail
Reopen the issue.
Tag with said tags if availlable (comma separated, need to be exact match)
Remove said tags if present (comma separated, need to be exact match)
Issuer needs at least write permission.
If Mergeable, Merge current PR using said methods (merge
if no arguments)
You can be polite and use "please" with any of the commands, e.g. "@Meeseeksdev please close".
You can optionally use the word "run" in the command, e.g. "@Meeseeksdev please run pre-commit".
Most extension and new command for the MeeseeksBox are only one function, for example here is how to let everyone request the zen of Python:
from textwrap import dedent
@everyone
def zen(*, session, payload, arguments):
comment_url = payload['issue']['comments_url']
session.post_comment(comment_url,
dedent(
"""
Zen of Python ([pep 20](https://www.python.org/dev/peps/pep-0020/))
>>> import this
Beautiful is better than ugly.
Sparse is better than dense.
....
Although never is often better than *right* now.
Namespaces are one honking great idea -- let's do more of those!
```
"""
))
The `session` object is authenticated with the repository the command came from.
If you need to authenticate with another repository with MeeseeksBox installed `yield` the `org/repo` slug.
```python
@admin
def foo(*, session, payload, argument):
other_session = yield 'MeeseeksBox/MeeseeksBox'
if other_session:
print('you are allowed to access MeeseeksBox/MeeseeksBox')
other_session.do_stuff()
else:
session.post_comment("Sorry Jerry you are not allowed to do that.")
GitHub API does not allow to change permissions once given (yet). We don't want you to go though the process of reinstalling all integrations.
We would like to request less permission if necessary.
See CONTIBUTING.md for for information.
This is still alpha software, user and org that can use it are still hardcoded. If you want access open an issue for me to allowlist your org and users.
Because of GitHub API limitation, MeeseeksBox can not yet make the distinction between read-only and read-write collaborators.
heroku addons:create keen