Want to use Robb Oat in your repo? Install the app. Want to hack on Robb Oat itself? Read on.
Sign up and request access to Codex. You'll need your Organization ID and an API key.
Create your own dev GitHub App with this config:
Key | Value |
---|---|
GitHub App name | some variation of "My Robb Oat Dev App" |
Homepage URL | https://github.com/robb-oat/server |
Webhook URL | whatever https://smee.io/new gives you |
Permissions | Repository - "Read and Write" for Contents, Issues, and Pull Requests |
Subscribe to events | Issue comment, Issues, Pull Request * |
Generate a private key. You'll use it to configure your local server in a minute. Also note your App ID.
Fork this repo and install your dev app on your fork. Turn on issues in your fork so you can test out Robb Oat there.
To build (requires Python 3):
make
Required config in local.env
:
OPENAI_ORG_ID=<see above>
OPENAI_API_KEY=<see above>
GITHUB_APP_ID=<see above>
GITHUB_APP_PRIVATE_KEY=<see above> # fold to one line, and don't include the '---- BEGIN/END ----'
GITHUB_BOT_USER_ID=<see below>
Here's what's up with the bot user ID. GitHub automatically provisions a bot user account to act on behalf of your app. We want to constrain some of our activity based on whether the bot is involved. For example, we only want the bot to respond to reviews on its own pull requests. We have to subscribe to all pull request review comment events for the repo, so we need to filter down to only comments on the bot's own PRs. There are some potential ways to make this determination dynamically, but they feel brittle enough and the stakes are high enough (it would suck if Robb Oat pushed commits for every pull request comment in a busy repo) that we ask you to set this value explicitly. You can find it by visiting:
https://api.github.com/users/your-app-slug[bot]
That's your-app-slug
plus [bot]
. Here is the link for the production Robb
Oat bot user to illustrate:
https://api.github.com/users/robb-oat[bot]
Grab the "id" from there and set it for GITHUB_BOT_USER_ID
.
Optional config in local.env
:
DJANGO_SENTRY_DSN=<go get one at sentry.io>
To setup the database:
./dev migrate
To run locally:
./dev
Install the smee client and start it like so:
$ smee --url https://smee.io/deadbeef --port 8000 --path /webhook
Now you can try it out! Create an issue in your fork, and if all goes well you should see a pull request from your dev app in under a minute. Robb Oat attempts to fix all issues it understands, which are issues that start with a link to code on GitHub followed by a blank line followed by instructions to change the linked code.
For a good hello world create an issue with content like this:
https://github.com/${username}/${fork-name}/blob/${sha}/robboat/templates/homepage.html#L6
Say program instead of friend, and use a different emoji.
Here's an example. To troubleshoot, use your smee.io dashboard or the "Advanced" tab on your dev app.
Happy hacking!