Contributing¶
Workflow¶
Branch from
main:feat/…,fix/…,refactor/…,docs/….Make the change, with its tests and its documentation.
make check(lint, types, tests) must pass, as it does in CI.Open a pull request. CI runs the same checks; merging to
mainbuilds the images, it does not deploy (see Deployment).
Commit messages follow type(scope): what changed, for example
fix(shopify): keep the price of a sold unit.
Tests¶
make test # all tests, no network, coverage report
make test-live # also tests marked live (they use the development base in .env)
uv run pytest tests/test_auth.py -k app # a subset
Tests never reach the network:
tests/conftest.pymakes any call to an outside host fail. Fake the service instead (see the fakes intests/test_create_product_shopify.py).A test that really needs the development Airtable base is marked
@pytest.mark.live; it is skipped unless you pass--live. Avoid adding new ones.The test session uses fixed tokens (
test-app_token…), whatever is in your.env.To change a setting in a test:
monkeypatch.setattr(config, "NAME", value).CI fails under the coverage minimum (
fail_underinpyproject.toml). New code comes with its tests; the minimum only goes up.
Style¶
ruffformats and lints (make lint,uv run ruff format),mypychecks types (make typecheck). Lines up to 100 characters.Follow the conventions: English, few comments, settings from
config, Airtable names fromschema, loggers named after their module.Keep functions small and named after what they do; prefer deleting code to commenting it out.
Documentation¶
Update docs/ in the same pull request as the code. Pages are Markdown (MyST) built with Sphinx;
diagrams are Mermaid code blocks. make docs must build without warnings, as CI checks. A new
page goes in a table of contents (docs/index.md). A new setting goes in api/config.py,
.env.example and docs/configuration.md (a test checks it).