Skip to content

Latest commit

 

History

History
130 lines (92 loc) · 3.65 KB

File metadata and controls

130 lines (92 loc) · 3.65 KB

Contributing

Test Deployment

You will need to have an account in Heroku.

Log in to Heroku:

heroku login

If creating, run:

heroku create meeseeksdev-$USER --stack heroku-26

Otherwise, run:

heroku git:remote -a meeseeksdev-$USER

Stack and Python version

The app runs on the heroku-26 stack. The Python version is pinned in .python-version (Heroku's runtime.txt is no longer used). To check or change the stack of an existing app:

heroku stack -a meeseeksdev-$USER            # list stacks, current one is starred
heroku stack:set heroku-26 -a meeseeksdev-$USER

A stack change only takes effect on the next deploy, so push afterwards.

Then run:

git push heroku $(git rev-parse --abbrev-ref HEAD):master
heroku open

To view the logs in a terminal window, use:

heroku logs --app meeseeksdev=$USER -t

GitHub App Configuration

Create a GitHub App for testing on your account Homepage URL: https://meeseeksdev-$USER.herokuapp.com/ Webhook URL: https://meeseeksdev-$USER.herokuapp.com/webhook Webhook Secret: Set and store as WEBHOOK_SECRET env variable Private Key: Generate and store as B64KEY env variable

Grant write access to content, issues, and users. Subscribe to Issue and Issue Comment Events.

Install the application on your user account, at least in your MeeseeksDev fork.

Heroku Configuration

You will need a Github token with access to cancel builds. This

This needs to be setup on the Heroku Application settings

On the Config Vars. section set the following keys::

GITHUB_INTEGRATION_ID="<App ID of the Application>"
B64KEY="<B64 encoding of entire pem file>"
GITHUB_BOT_NAME="<meeseeksdev-$USER>"
WEBHOOK_SECRET="<value from the webhooks add above>"
PERSONAL_ACCOUNT_NAME="<account name>"
PERSONAL_ACCOUNT_TOKEN="<github personal access token with repo access>"

Optionally:

SUPERUSERS="<comma separated github usernames>"

Superusers are treated as administrators on every repository the bot is installed on, whatever their actual GitHub permissions are there. This is meant for whoever operates the deployment, so that the bot does not refuse their commands on repositories they do not have admin rights to. A leading @ is accepted and the comparison is case insensitive, so SUPERUSERS="@Carreau" and SUPERUSERS="carreau" are equivalent. Leave it unset to give nobody special treatment.

Code Styling

MeeseeksDev has adopted automatic code formatting so you shouldn't need to worry too much about your code style. As long as your code is valid, the pre-commit hook should take care of how it should look. pre-commit and its associated hooks will automatically be installed when you run pip install -e ".[test]"

To install pre-commit manually, run the following::

pip install pre-commit
pre-commit install

You can invoke the pre-commit hook by hand at any time with:

pre-commit run

which should run any autoformatting on your code and tell you about any errors it couldn't fix automatically. You may also install black integration into your text editor to format code automatically.

If you have already committed files before setting up the pre-commit hook with pre-commit install, you can fix everything up using pre-commit run --all-files. You need to make the fixing commit yourself after that.

Some of the hooks only run on CI by default, but you can invoke them by running with the --hook-stage manual argument.