Contributing

Workflow

  1. Branch from main: feat/…, fix/…, refactor/…, docs/….

  2. Make the change, with its tests and its documentation.

  3. make check (lint, types, tests) must pass, as it does in CI.

  4. Open a pull request. CI runs the same checks; merging to main builds 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.py makes any call to an outside host fail. Fake the service instead (see the fakes in tests/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_under in pyproject.toml). New code comes with its tests; the minimum only goes up.

Style

  • ruff formats and lints (make lint, uv run ruff format), mypy checks types (make typecheck). Lines up to 100 characters.

  • Follow the conventions: English, few comments, settings from config, Airtable names from schema, 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).