Contributing
PatchBase is open source and we welcome contributions. This guide covers the basics of getting your changes merged.
Before you start
If you're planning a significant change (new feature, refactoring, breaking change), please open an issue first to discuss it. This avoids wasted work if the change doesn't fit the project's direction.
For bug fixes and small improvements, feel free to open a pull request directly.
Development workflow
- Fork the repository and clone your fork
- Create a branch for your change:
git checkout -b fix-some-bug
- Make your changes following the code conventions below
- Run the linter:
golangci-lint run
- Run tests:
bazel test //...
- Commit and push your branch
- Open a pull request on the
patchbase/patchbaserepository
Code conventions
- Error handling: wrap errors with
fmt.Errorf("...: %w", err) - Filesystem abstraction: use
afero.Fswhen an abstraction is needed — don't add a localfswrapper package - Unused parameters: name them
_in the signature, not_ = paramin the body - Testing: use
testify/assertandtestify/require, nott.Fatalf - Build files: after changing Go imports, run
bazel run //:gazelleto regenerateBUILD.bazel - New tests: if Gazelle adds a
go_testtarget, annotate it withsize = "small" - No trailing blank lines at the end of files
Pull request review
All PRs are reviewed for correctness, security, and code quality. Here's what reviewers look for:
- Does the change solve the problem it claims to?
- Are there security implications (especially around auth, SSH, or credentials)?
- Does it follow the existing code style and conventions?
- Are there tests for new functionality?
- Does it handle errors properly?
Reporting issues
If you find a bug, please open an issue with:
- A clear title and description
- Steps to reproduce
- Expected vs. actual behavior
- Relevant logs or error messages
- Your OS, PatchBase version, and host setup
License
PatchBase is licensed under the Apache License 2.0. By contributing, you agree that your contributions will be licensed under the same license.