Probot is a framework for building GitHub Apps in Node.js/TypeScript. It abstracts away the complexity of receiving and validating webhooks, authenticating as a GitHub App, and making API calls via an authenticated Octokit client. The system provides a `Probot` class that manages webhook event handling, an `Octokit` instance with plugins for throttling, retry, pagination, and enterprise compatibility, and a `Server` class for HTTP routing. Key entry points include the `run()` function for CLI usage, `createNodeMiddleware()` for serverless or custom server integration, and direct use of the `Probot` class for programmatic control. The architecture is modular: the `Probot` class initializes webhooks and Octokit, the `Server` class handles HTTP requests and proxies webhooks via Smee.io for local development, and the `Context` class provides helpers for extracting repository, issue, and pull request information from webhook payloads. External dependencies include the Octokit ecosystem, pino for logging, bottleneck for rate limiting, and ioredis for optional Redis-backed throttling. The codebase is well-structured with extensive test coverage and supports multiple runtimes (Node.js, Deno, Bun).
This repository implements an AI-powered code review bot for GitHub. It listens for pull request events (opened, synchronize) and uses OpenAI's language models (or Azure OpenAI, GitHub Models) to automatically review code diffs and post inline comments and summary reviews. The system supports multiple deployment modes: a Probot-based GitHub App, a GitHub Action, an AWS Lambda function, and a Vercel serverless function. The core logic is in `src/bot.ts` (event handling, file filtering, review creation) and `src/chat.ts` (LLM API abstraction). The architecture is a monolith with adapter layers for each platform. External dependencies include the OpenAI/LLM API, GitHub API via Octokit, and minimatch for glob-based file filtering. The bot is configurable via environment variables for model selection, prompt customization, language, and file inclusion/exclusion patterns. It also implements an incremental review feature to reduce API costs by only re-reviewing files changed since the last bot review.