NOTE: This study was completed at the end of July 2025. Thus, this bot was inactivated and this repository was set to archival mode.
- Python 3.11+
- Pip
- A running Redis-compatible server
- A running database server (MySQL is known to work)
- A working JDK installation (JDK 17.0.13 is known to work)
See pyproject.toml for more specific requirements.
This section is applicable to the first node.
- Clone repository from GitHub, and cd into it.
- Create a Python virtual environment,
python -mvenv venv - Activate the virtual environment,
source venv/bin/activate - Install minimum necessary packages, with
pip install -e . - Generate a secret key and copy to the clipboard:
python manage.py shell -c "from django.core.management import utils; print(utils.get_random_secret_key())". - Copy
env.templateto.envand edit according to your local configuration (see also Configuration). - Create migration files for the database:
python manage.py makemigrations - Create database tables:
python manage.py migrate - Collect static files:
python manage.py collectstatic - Create an administrative user,
python manage.py createsuperuser
On all remaining nodes, complete steps 1--4, copying the .env file and make any necessary changes.
On all nodes which will run the worker, complete the following additional steps to install gumtree.
- Activate the virtual environment,
source venv/bin/activate - Install the gumtree support packages,
pip install -e .[gumtree_support]. - Initialize GumTree submodules,
git submodule update --init --recursive. - Navigate to the gumtree directory,
cd gumtree - Build gumtree,
./gradlew build - Navigate to the gumtree parser directory (
cd ../gumtree-parser), and pre-build the tree-sitter parsers by running the following commands:./tree-sitter-parser.py ../test-data/py/arg-type/with.py python./tree-sitter-parser.py ../test-data/php/arg-definition/with.php php./tree-sitter-parser.py ../test-data/r/args-default/with.r r./tree-sitter-parser.py ../test-data/rb/local/with.rb ruby./tree-sitter-parser.py ../test-data/ts/arg-type/with.ts typescript
This section is applicable to all nodes running the worker service.
- Copy the file
template-typechangebot-worker.servicetotypechangebot-worker.service. - Edit the file, taking special care to set the
WorkingDirectorysetting to the installation directory, and theUsersetting to the user which will the worker will be run as. - Copy
typechangebot-worker.serviceto the/etc/systemd/system/directory. - Reload the systemd daemon with
systemctl daemon-reload. - Enable and start the service with
systemctl enable --now typechangebot-worker.
Configure your webserver/WSGI installation following vendor directions. If using Ubuntu and Apache, Digital Ocean's guide may be helpful.
The following environment variable must be configured in a .env
file. This file must be available on all nodes, and all nodes must be
uniformly configured.
SECRET_KEYNecessary configuration parameter to ensure application security. See above.ALLOWED_HOSTSComma-separated list of allowed host names, see also Django documentationURL_ROOTPath from domain root to app, normally/, but may be/tcbotor similar based on your configuration.DATA_DIRAbsolute path to directory containing stored repositories.
The following must be collected from GitHub's application management UI.
GITHUB_APP_KEYSeparate newlines with literal\nGITHUB_APP_IDGITHUB_APP_CLIENT_SECRET
GUMTREE_DIRLocation of GumTree binaries. Note, the example configuration will only needTODOreplaced with the path to the installation directory.GUMTREE_TREE_SITTER_DIRLocation of the GumTree treesitter parser. Note, the example configuration will only needTODOreplaced with the path to the installation directory.
DATABASE_URLadj-database-urlcompatible database URL. Make sure to install the relevant database drivers (necessary packages for MySQL are available with themysqloptional dependency set).
CELERY_BROKER_URLURL for Redis access. See also Celery documentation. It is recommended that you use a database number specific to this project.