Home of a (WIP) rewrite of the homu bors implementation in Rust.
- An
axumweb server listens on a/githubendpoint for webhooks related to a GitHub app of the bot. - The webhooks are converted to
BorsEvents and executed. - The bot stores data in a database and performs queries and commands on attached GitHub repositories using the GitHub REST API.
Directory structure:
database/migrationSeaORMmigrations that are the source of truth for database schema
database/entity- Automatically generated
SeaORMDB entities, which are generated from a (Postgre) database.
- Automatically generated
src- Code of the bot
You must have sea-orm-cli installed for the following commands to work.
$ cargo install sea-orm-cliYou must also set up a DATABASE_URL environment variable. You can use SQLite for local testing,
but when entities are regenerated, it should be done against a Postgre database!
$ export DATABASE_URL=sqlite://bors.db?mode=rwc- Generate a new migration
$ sea-orm-cli migrate -d database/migration/ generate <name> - Change the migration manually in
database/migration/src/<new-migration>.rs. - Apply migrations to a Postgre DB. (You can use Docker for that).
$ sea-orm-cli migrate -d database/migration/ up - Re-generate entities, again against a Postgre DB.
$ sea-orm-cli generate entity -o database/entity/src --lib