|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thank you for contributing to the Qoder Cloud Agents Python SDK. |
| 4 | + |
| 5 | +## Development workflow |
| 6 | + |
| 7 | +1. Create a focused branch from the latest `main`. |
| 8 | +2. Keep each pull request limited to one independently reviewable change. |
| 9 | +3. Use Conventional Commits, for example `fix(forward): preserve request id`. |
| 10 | +4. Open a pull request and wait for all required checks before merging. |
| 11 | + |
| 12 | +GitHub `main` is the source of truth. Do not develop against or copy changes from the internal CI mirror. |
| 13 | + |
| 14 | +## Setup and checks |
| 15 | + |
| 16 | +Python 3.10 or newer is supported. Python 3.12 is used for deterministic documentation generation. |
| 17 | + |
| 18 | +```bash |
| 19 | +python3 -m pip install uv |
| 20 | +uv sync --extra dev --locked |
| 21 | +uv run make lint |
| 22 | +uv run make typecheck |
| 23 | +uv run make test |
| 24 | +uv run make docs-check |
| 25 | +``` |
| 26 | + |
| 27 | +The default test command excludes account-backed integration tests and must not require network access or credentials. |
| 28 | + |
| 29 | +## Test layers |
| 30 | + |
| 31 | +- **Unit and contract tests** live under `tests/` and run with `uv run make test`. |
| 32 | +- **Integration tests** live under `tests/integration/` and must not import implementation from `examples/`. Copy `.env.live.example` to `.env.live`, use a dedicated test account, and run `uv run make test-live-all`. |
| 33 | +- **Examples** are runnable documentation. Tests must not import from `examples/`; use each example's `--help` mode for a no-network smoke check. |
| 34 | + |
| 35 | +Never commit `.env.live`, tokens, credentials, generated logs, or test output. Integration scenarios must register cleanup immediately after creating a resource. Run them explicitly with `QODER_RUN_LIVE=1`; they are not part of public pull-request CI. |
| 36 | + |
| 37 | +## API and contract changes |
| 38 | + |
| 39 | +When adding or changing an endpoint: |
| 40 | + |
| 41 | +1. Update the relevant modules under `src/qca/forward/` or `src/qca/managed/` and their public types. |
| 42 | +2. Add focused contract expectations under `tests/`; do not derive the expected contract solely from the implementation under test. |
| 43 | +3. Cover synchronous and asynchronous clients where both expose the behavior. |
| 44 | +4. Regenerate API documentation with `uv run make docs` and verify it with `uv run make docs-check`. |
| 45 | +5. Call out the corresponding Go and TypeScript work in the pull request, or explain why the change is language-specific. |
| 46 | + |
| 47 | +Contract fixtures are maintained manually. A passing fixture test proves consistency with this repository, not automatically with service routes or the other SDKs. |
| 48 | + |
| 49 | +## Compatibility conventions |
| 50 | + |
| 51 | +The SDK intentionally keeps Qoder-branded `X-Qoder-*` metadata headers, resumable session-event streams, and Python-native synchronous and asynchronous clients. Preserve those extensions unless the change explicitly revises the public contract. Breaking public API changes require a minor-version release while the SDK remains pre-1.0 and must include migration notes. |
| 52 | + |
| 53 | +## Pull requests |
| 54 | + |
| 55 | +Complete the pull request template, include exact verification commands and results, and identify public API, documentation, integration-test, and cross-SDK effects. Do not combine unrelated refactors with behavior changes. |
0 commit comments