Contributing¶
Thank you for considering contributing to azure-functions-db.
Development Setup¶
Requirements:
- Python 3.11+
- hatch for build and version management
- Ruff for linting and formatting
- mypy for type checking
Running Checks¶
make test # Run all tests
make lint # Run Ruff linter
make typecheck # Run mypy
make build # Verify package builds
Or run everything at once:
Branch Naming¶
Use the following prefixes:
feature/*— new functionalityfix/*— bug fixesdocs/*— documentation changesadr/*— architecture decision records
Pull Request Guidelines¶
Every PR should address:
- What is being changed.
- Why it is needed.
- Semantics impact — does this change delivery guarantees or API contracts?
- Migration — is a migration required for existing users?
- Tests — are tests added or updated?
Code Style¶
- Python type hints required on all public APIs.
- Public surface docstrings required (Google style).
- Use structured logging — no
printstatements (except in examples). - No direct SQL string concatenation.
- Ruff configuration:
select = ["E", "F", "I"],line-length = 100. - Never suppress type errors with
as any,@ts-ignore, ortype: ignore.
Documentation¶
- Keep README, PRD, and semantics documents consistent with each other.
- New features must include example updates.
- Semantics changes require an ADR (Architecture Decision Record).
- User-facing docs must always preserve this statement:
pseudo trigger / at-least-once / idempotent handler required
Test Requirements¶
- Unit tests for all new code.
- Adapter changes must include integration tests.
- Lease and checkpoint changes must include race condition tests.
- Coverage threshold: 90%.
See Testing for details on running and writing tests.
Principles¶
- PRs that change semantics must include an ADR or design note.
- New adapters may not be merged without contract tests.
- Public API additions must be accompanied by docs and example updates.
- Do not use language that overstates guarantees.