neondatabase/neon
How to contribute
This section covers the practical mechanics of working in the Neon repo: how to pick up work, how to format and lint, how to run tests, what to expect from review, and what tools you need installed locally.
For high-level project intent and code layout, start at Architecture. For setup, see Getting started.
Pull-request flow
The expected lifecycle is the one most Rust projects follow:
- Branch from
main. No long-lived feature branches; rebase on top ofmainbefore opening the PR. - Open a PR with a focused diff. "One change per PR" is the implicit rule. Splitting refactors from behavioral changes makes review tractable.
- Get at least one approval. From
CONTRIBUTING.md: "Get at least one +1 on your PR before you push." Smaller patches typically take a single review; large or cross-cutting ones go through more. - Keep CI green. Do not push to a PR that has a red CI even if you believe the failure is unrelated — the project asks contributors to help fix the root cause first.
- Squash on merge. PR titles become commit messages on
main; conventional-commit style (storage:,proxy:,compute:,chore:,fix:,feat:) is widely used but not strictly enforced. Look at the most recent dozen commits onmainfor current conventions.
External contributors trigger CI through a special "approved-for-ci-run" label: see .github/workflows/approved-for-ci-run.yml and the longer explanation in CONTRIBUTING.md. Maintainers must review the diff for safety before applying the label, because PRs from forks otherwise cannot access repository secrets.
Definition of done
A PR is "done" when, at minimum:
- It compiles with
cargo buildandcargo build --features=testing. ./run_clippy.shis clean../scripts/reformat(rustfmt + ruff format + ruff check + mypy) is clean.- Relevant
cargo nextest runpackages pass locally. - If the change touches Python:
poetry run ruff format .,poetry run ruff check ., andpoetry run mypy .from the repo root all pass. - For storage-system changes: at least one Python integration test exercises the new path, or there is an explicit reason in the PR description why one wasn't added.
The pre-commit hook (pre-commit.py, installed via make setup-pre-commit-hook) catches formatting and Python style before the push. CI catches the rest.
What's in the rest of this section
- Development workflow — branching, rebasing, splitting commits, dealing with the Postgres-fork submodules.
- Testing — Rust unit tests with
cargo nextest, Python integration tests withpytest, simulation tests withdesim. - Debugging — log conventions, common failure modes, how to attach
gdb/lldbto a crashed Postgres compute, flamegraphs. - Patterns and conventions — error-handling style, async patterns, how
tracingspans are used, naming. - Tooling —
cargo nextest,cargo deny,cargo hakari,ruff,mypy,make,redocly(for the OpenAPI specs), local CI helpers.
A note on the patched Postgres tree
vendor/postgres-v{14..17} are git submodules that hold lightly patched copies of upstream Postgres. Running make will check them out. If you change Postgres-side code (uncommon outside the compute team), you'll be working in those submodules, and your PR will need to pair with a PR in the neondatabase/postgres fork. See docs/core_changes.md for what kinds of changes Neon makes to Postgres and why.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.