Pull Requests — Beluga AI
This guide describes the process for submitting changes to Beluga AI, from opening an issue to getting your code merged. The process is designed to minimize wasted effort: early issue discussion prevents duplicate work, CI checks catch problems before review, and focused PRs are easier to review and merge.
Before You Start
Section titled “Before You Start”These steps save time for both you and the reviewers. A quick issue check prevents duplicate work, and design discussions for larger changes ensure your approach aligns with the framework’s architecture before you invest time in implementation.
- Check existing issues — Search GitHub Issues to see if someone is already working on what you have in mind.
- Create an issue if one doesn’t exist. This helps avoid duplicate work and gives maintainers a chance to provide early feedback.
- Discuss design for large changes — For significant features, architectural changes, or new providers, open an issue or start a Discussion to align on the approach before writing code.
Branch Naming Convention
Section titled “Branch Naming Convention”Branch names use a prefix that matches the type of change. This makes it easy to identify the nature of a branch at a glance in branch listings and CI logs:
| Prefix | Use for |
|---|---|
feat/ | New features |
fix/ | Bug fixes |
docs/ | Documentation changes |
refactor/ | Code refactoring |
test/ | Test additions or fixes |
chore/ | Maintenance tasks |
Examples:
feat/anthropic-streamingfix/agent-nil-pointerdocs/rag-tutorialrefactor/core-error-typestest/memory-store-coveragechore/update-golangci-lintMaking Changes
Section titled “Making Changes”-
Create a branch from
main:Terminal window git checkout maingit pull upstream maingit checkout -b feat/my-feature -
Make your changes following the Code Style Guide.
-
Write tests for any new or changed behavior. See the Testing Guide.
-
Run the full check suite before pushing:
Terminal window make checkThis runs formatting, linting, and all tests in one command.
-
Commit with Conventional Commits format:
Terminal window git commit -m "feat(llm): add streaming support for Anthropic"
Opening a Pull Request
Section titled “Opening a Pull Request”-
Push your branch to your fork:
Terminal window git push origin feat/my-feature -
Open a PR against
mainon the Beluga AI repository. -
Fill out the PR template — provide a clear description of what your change does and why.
-
Link related issues — Use keywords like
Closes #123orFixes #456in the PR description to auto-close issues on merge.
PR Checklist
Section titled “PR Checklist”Before requesting a review, make sure:
- All tests pass (
make test) - Linter passes (
make lint) - Code is formatted (
make fmt) - New or changed behavior has tests
- Documentation is updated if public API changed
- Commit messages follow Conventional Commits format
- PR description clearly explains the change
Review Process
Section titled “Review Process”The review process is intentionally sequential: automated checks first, then human review. This ensures that reviewers spend their time on design and correctness, not on formatting or lint issues that machines can catch.
- Automated checks run first — CI must pass before a maintainer reviews.
- A maintainer will review your PR, usually within a few business days.
- You may receive feedback — this is normal and part of the collaborative process. Address comments by pushing additional commits.
- Once approved, a maintainer will squash-merge your PR into
main.
What Reviewers Look For
Section titled “What Reviewers Look For”Reviewers evaluate changes against the framework’s consistency guarantees and the patterns described in the Architecture documentation. In a framework with 19 registries that all follow the same contract, consistency is as important as correctness:
- Correctness and test coverage
- Adherence to Code Style and project patterns (registry, middleware, hooks)
- Clear, focused scope — one concern per PR
- Performance implications for hot paths (streaming, tool execution, retrieval)
- Backward compatibility
CI Checks
Section titled “CI Checks”The following checks must pass before merge:
| Check | Description |
|---|---|
| Lint | golangci-lint with project configuration (13 linters including gosec, staticcheck, errcheck) |
| Build | go build ./... and go mod tidy verification |
| Unit Tests | All unit tests pass with race detector enabled |
| Integration Tests | Integration tests pass (build tag integration) |
| Snyk | Dependency vulnerability scanning with severity thresholds |
| Trivy | Filesystem and dependency scanning (SARIF results in GitHub Security tab) |
| govulncheck | Go vulnerability database scan with symbol-level reachability |
| gosec | Static security analysis (SARIF results in GitHub Security tab) |
| Gitleaks | Secret detection |
| License Compliance | Dependency license verification |
| SonarCloud | Code quality and maintainability analysis (internal PRs) |
| Greptile | AI-powered code review via GitHub App (automatic on every PR) |
If a CI check fails, click the details link to see the logs and fix the issue.
After Merge
Section titled “After Merge”- Your branch is automatically deleted after merge.
- Changes will appear in the next release — see Release Process.
- If your change is user-facing, it will be included in the auto-generated changelog.
Tips for Good PRs
Section titled “Tips for Good PRs”These guidelines come from experience with the review process and reflect what makes PRs merge faster:
- Keep changes small and focused. A PR that does one thing well is easier to review and less likely to introduce bugs. In a framework this size, small PRs also reduce merge conflicts.
- Write a clear description. Explain what changed and why. Reviewers shouldn’t have to read every line of code to understand the purpose.
- One concern per PR. Don’t mix a bug fix with a refactor or a new feature with a dependency update. This also helps with changelog generation — each PR maps cleanly to a changelog entry.
- Include before/after examples when changing behavior — this helps reviewers verify correctness without running the code locally.
- Respond to feedback promptly. If you disagree with a suggestion, explain your reasoning — healthy discussion leads to better code.