mz-commit
Committing in Materialize
Read doc/developer/guide-changes.md for the full conventions on submitting and reviewing changes.
Pre-commit checklist
Before committing, run these and fix any warnings:
bin/fmt(formats.rs,.py, and.protofiles)bin/lint(can error if tools are missing; usebin/ci-builder run stable bin/lintas an alternative)cargo clippy --all-targets -- -D warnings
Do not manually update *.snap files.
Use cargo test followed by cargo insta accept to update snapshot files.
Rewrite datadriven test expectations with REWRITE=1 cargo test ....
PR titles and commit messages
Materialize uses squash merging, so the PR title becomes the commit subject on main.
- Use imperative mood: "Fix X" not "Fixed X" or "Fixes X".
- Be specific: "Fix panic in catalog sync when controller restarts" not "Fix bug".
- Prefix with area if helpful:
adapter:,storage:,compute:,sql:.
Write a thorough PR description explaining the rationale for the change.
Mention which tests were added or modified in the pull request description, but do not list which tests were run.
To auto-close issues, include Fixes database-issues#NNNN.
Add release notes for user-visible changes (should complete "This release will...").
Cargo.lock discipline
Never regenerate the entire Cargo.lock — bare cargo update bumps every semver-compatible dep and introduces unrelated breakage (e.g., os_info pulling in objc2 on macOS, chrono-tz changing timezone data, serde_path_to_error changing error formats).
- Adding a dep or changing features: just
cargo check. It updates only what's needed. - Updating one crate:
cargo update -p <crate>(add--precise <ver>to pin). - After any Cargo.lock change, review the diff:
Pin back anything that moved unexpectedly:git diff Cargo.lock | grep '^[+-]version' | head -40cargo update -p <crate> --precise <old-version>. - After rebase conflicts in Cargo.lock: resolve by taking HEAD's version then running
cargo check(notcargo update). This preserves existing pins while adding only what the new commits require.
Git conventions
- Work against the
mainbranch ofMaterializeInc/materialize. - Push branches to your fork.
- Pull requests target
mainonMaterializeInc/materialize. - Each PR should contain one semantic change.