Skip to content

Latest commit

 

History

History
118 lines (92 loc) · 4.41 KB

CONTRIBUTING.md

File metadata and controls

118 lines (92 loc) · 4.41 KB

Contributing

Thanks for your interest in c-questdb-client. This guide covers what you need to know before opening a PR.

Where to ask questions

Repo layout

Path What lives here
questdb-rs/ Core Rust crate (questdb-rs on crates.io). Pure Rust; all protocol logic.
questdb-rs-ffi/ C ABI shim. Pure FFI exports — no business logic.
include/ Hand-maintained C / C++ headers. Not generated by cbindgen.
cpp_test/ C++ test suite. Mirrors C++ wrapper coverage.
system_test/ Python integration suites that spawn a real QuestDB server.
examples/ Buildable C / C++ examples.
ci/ Azure Pipelines YAML.
doc/ Long-form docs: build, release, security, considerations.

For a deeper tour see doc/DEV_NOTES.md.

Build & test

Full build instructions live in doc/BUILD.md. The short version for Rust-only work:

cd questdb-rs
cargo build --features almost-all-features
cargo test  --features almost-all-features

For the C / C++ side:

cmake -S . -B build -DQUESTDB_TESTS_AND_EXAMPLES=ON
cmake --build build
ctest --test-dir build

almost-all-features enables every cross-compatible feature flag at once (it deliberately omits the mutually-exclusive aws-lc-crypto / ring-crypto pair — see questdb-rs/Cargo.toml).

Coding standards

  • Rust: cargo fmt + cargo clippy --all-targets -- -D warnings must pass. The almost-all-features flag is the canonical lint target. Apply this to both questdb-rs/ and questdb-rs-ffi/.
  • C / C++: run python3 ci/format_cpp.py (config lives in .clang-format). CI pins clang-format 21.1.8 (pipx install clang-format==21.1.8); other versions reflow comments differently and will fail the check.
  • Comments: explain why, not what. The reviewers look closely at any comment that restates the code.
  • Unsafe Rust: keep unsafe blocks narrow and document the safety invariants the caller must uphold.
  • No new runtime dependencies in questdb-rs without discussion — the library statically links everything it ships.

Pre-commit hook

.githooks/pre-commit runs cargo fmt --check and cargo clippy on staged commits. It is opt-in — enable it once per clone:

git config core.hooksPath .githooks

CI coverage

PR CI runs the offline / mock-based suites only. The questdb submodule is not checked out (submodules: false in ci/run_tests_pipeline.yaml), so these suites do not run on every PR:

  • The 79 live-server-tests Rust tests in questdb-rs/
  • The C++ test_reader live suite
  • The Python failover system test (system_test/test_egress_failover.py)
  • The Python ingestion integration test (system_test/test.py)

End-to-end coverage against a real QuestDB broker lives in the separate TestVsQuestDBMaster job, which clones questdb/questdb master, builds the jar with JDK 25 + Maven, and runs the integration suites. That job is the gate for live-server correctness — PR CI alone does not prove it. Watch the job result before merging any change that touches the wire protocol, transport, or failover paths.

To reproduce the live suites locally:

git submodule update --init --recursive
# build the jar under questdb/core/target/ — see questdb/README.md
cd questdb-rs
cargo test --features live-server-tests

Submitting a pull request

  1. Branch off main. Keep the diff focused — unrelated refactors get split into separate PRs.
  2. Write or update tests. Bug fixes need a regression test; new public APIs need at least one usage test.
  3. Run cargo fmt, cargo clippy, and the relevant test suite locally before pushing.
  4. Open the PR against main with a description that explains the why. Link the issue if there is one.
  5. Watch CI. The TestVsQuestDBMaster job (see above) needs to pass for any protocol-level change.

By submitting a contribution, you agree it is licensed under the project's Apache 2.0 License.