use pyenv or conda to create a virtual environment of python version=3.8 (env name=pr-decision-bot, we will use this environment name in the following text)
install mysql and create a database (here we name the database pr-decision-bot)
[optional] after creating your App, you can set the Display information by uploading a logo of your App
generate your own private key of your GitHub App (see GitHub Doc), and download it to your own path.
change the configuration of your installed App on GitHub in .env.yaml file (“APP” part)
change “APP_SLUG” according to your own settings, see GitHub Doc for more information.
change “PRIVATE_KEY_PATH” according to the path you store your private key (pem file).
change “PERSONAL_TOKEN” according to GitHub Doc. Here it uses the personal token just for the initialization of service, as the APP_ID will change if you change the setting of your own deployed App. Therefore, it just uses the token to access your current APP_ID. (The personal token is the token of whom your App is created by. For organization accounts, please use the token of the member that is allowed to manage all GitHub Apps belonging to this organization.)
change the configuration of the pull request decision making service in .env.yaml file (“SERVICE” part).
change the port (“PORT”) of your service.
change the number of hours of “REMIND_EVERY_HOURS”. This means how often do you want your pull requests receive the remind message.
change the number of hours needed for scheduler (“SCHEDULER”) to cycle (“CYCLE_MINUTES”). This represents how often does the background scheduler run for 1-round check.
start the service using the following commands (for windows server, you need to write your own shell). It will take some time for the training of the model. If your server’s performance is not good, try running command python app/prediction_service/trainer.py and train the model at somewhere else before the start of the service.
poetry shell
bash pr-decision-bot.sh start
stop/restart the service using the following commands (for windows server, you need to write your own shell):
Installation
environment installation
run commands to start the program
1. install python dependencies
2. migrate database
3. run the service
python app/prediction_service/trainer.py
and train the model at somewhere else before the start of the service.4. install your GitHub App
find your app through your app’s public link and install it to your target personal/organization account that want to use the app.
That’s it! You can use your own App now! Good luck!