Thank you for your interest in contributing to Soar! This document covers the workflow and conventions that keep the contribution process smooth for everyone.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/soar.git cd soar - Add the upstream remote so you can pull in changes from the main project:
git remote add upstream https://github.com/pkgforge/soar.git
- Create a branch for your feature or bugfix.
- Make your changes, and add or update tests where it makes sense.
- Run the quality checks locally.
- Keep your branch current with upstream:
git pull upstream main --rebase
We follow the Conventional Commits specification. It keeps the history readable and easy to follow.
Each commit message consists of a header, an optional body, and an optional footer:
<type>(<scope>): <short summary>
<body>
<footer>
The header is mandatory (it can be looser if you expect the commits to be squashed):
- type: the kind of change. One of
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert. - scope: where the change lands, e.g.
cli,repo,package. - summary: present tense, not capitalized, no trailing period, under 72 characters.
feat(cli): add search filtering by package type
fix(repo): resolve metadata caching issue
The metadata cache wasn't invalidated when repository sources changed,
leading to stale package information. Rebuild the cache whenever source
files are modified.
Fixes #123
- Vague messages like "bug fix" or "update". Say what changed, and where it isn't obvious, why.
- Bundling unrelated changes into one commit.
- Ensure your code compiles and the quality checks pass before opening a PR.
- Reference any relevant issues in the description.
For work in progress you want early feedback on, or when there are known blockers:
- Open the PR as a Draft.
- Note in the description that it is a work in progress.
- Describe the specific blockers or where you need help.
- Convert to a regular PR once it is ready for final review.
- Use meaningful variable and function names.
- Comment what the code cannot say for itself: why a decision was made, what goes wrong without it, what a value is guarding against. A comment that restates the line below it is noise.
- Document public items, since they are what other crates and the docs see.
CI runs these, so running them first saves a round trip:
cargo test --locked --all-features --workspace
cargo +nightly fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warningsClippy runs with warnings denied, and formatting uses the nightly toolchain,
which honours options stable rustfmt ignores.
Migrations under crates/soar-db/migrations are the one part of a change that
cannot be undone on a user's machine, so they deserve a second look:
- The core database holds a user's installed packages. Assume every migration runs against real data that cannot be regenerated.
- The metadata database is a cache built from a repository index, so it can be thrown away and rebuilt.
- Rebuilding a table drops it, and dropping a table with a foreign key pointing
at it deletes the referencing rows. Turning foreign keys off is only possible
outside a transaction, which needs
run_in_transaction = falsein the migration'smetadata.toml. - Test a migration against a database that has rows in it, not an empty one.