Overview
Enable organization members to trigger automated code fixes by commenting @euni-bot /fix on issues or PRs. The GitHub App webhook should call the FastAPI backend, run the euni agent for code repair, and open a PR with results.
Tasks
-
Configuration
- Add
GH_APP_ID, GH_WEBHOOK_SECRET, GH_APP_PRIVATE_KEY, BOT_HANDLE, ORG_NAME to .env and load via configuration/github.py.
-
Utils
- Implement signature verification, JWT creation, and command parsing in
utils/github_sec.py.
-
GitHub Service Layer
-
AI Fix Logic
- Add
app/services/euni_fix.py with run_euni_fix(repo_dir, args) (placeholder for real AI/MCP integration).
-
Webhook Route
-
App Initialization
- Register webhook router in
app/__init__.py.
-
Deployment
- Update
docker-compose.yml with env vars and uvicorn command.
- Configure Nginx reverse proxy for
/github/webhook with SSL.
-
Testing
- Add
tests/app/test_github_webhook.py (mock payload, check command parsing & response flow).
Acceptance Criteria
-
When a member comments @euni-bot /fix:
- Bot posts a “started” placeholder.
- After fix, bot updates comment with PR link and short summary.
-
Only members of ORG_NAME can trigger the command.
-
Errors are handled gracefully with a failure comment.