|
| 1 | +# Contributor Guidance for `sdk-core` |
| 2 | + |
| 3 | +This repository provides a Rust workspace for the Temporal Core SDK and related crates. Use this document as your quick reference when submitting pull requests. |
| 4 | + |
| 5 | +## Where Things Are |
| 6 | + |
| 7 | +- `core/` – implementation of the core SDK |
| 8 | +- `client/` – clients for communicating with Temporal clusters |
| 9 | +- `core-api/` – API definitions exposed by core |
| 10 | +- `sdk/` – pre-alpha Rust SDK built on top of core (used mainly for tests) |
| 11 | +- `sdk-core-protos/` – protobuf definitions shared across crates |
| 12 | +- `fsm/` – state machine implementation and macros |
| 13 | +- `test-utils/` – helpers and binaries for tests |
| 14 | +- `tests/` – integration, heavy, and manual tests |
| 15 | +- `arch_docs/` – architectural design documents |
| 16 | +- Contributor guide: `README.md` |
| 17 | + |
| 18 | +## Repo Specific Utilities |
| 19 | + |
| 20 | +- `.cargo/config.toml` defines useful cargo aliases: |
| 21 | + - `cargo lint` – run clippy on workspace crates |
| 22 | + - `cargo test-lint` – run clippy on tests |
| 23 | + - `cargo integ-test` – run the integration test runner |
| 24 | +- `cargo-tokio-console.sh` – run any cargo command with the `tokio-console` feature |
| 25 | +- `integ-with-otel.sh` – run integration tests with OpenTelemetry enabled |
| 26 | +- `.cargo/multi-worker-manual-test` – helper script for spawning multiple workers during manual testing |
| 27 | + |
| 28 | +## Building and Testing |
| 29 | + |
| 30 | +The following commands are enforced for each pull request (see `README.md`): |
| 31 | + |
| 32 | +```bash |
| 33 | +cargo build # build all crates |
| 34 | +cargo test # run unit tests |
| 35 | +cargo integ-test # integration tests (starts ephemeral server by default) |
| 36 | +cargo test --test heavy_tests # load tests |
| 37 | +``` |
| 38 | + |
| 39 | +Additional checks: |
| 40 | + |
| 41 | +```bash |
| 42 | +cargo fmt --all # format code |
| 43 | +cargo clippy --all -- -D warnings # lint |
| 44 | +``` |
| 45 | + |
| 46 | +Documentation can be generated with `cargo doc`. |
| 47 | + |
| 48 | +## Expectations for Pull Requests |
| 49 | + |
| 50 | +- Format and lint your code before submitting. |
| 51 | +- Ensure all tests pass locally. Integration tests may require a running Temporal server or the ephemeral server started by `cargo integ-test`. |
| 52 | +- Keep commit messages short and in the imperative mood. |
| 53 | +- Provide a clear PR description outlining what changed and why. |
| 54 | +- Reviewers expect new features or fixes to include corresponding tests when applicable. |
| 55 | + |
| 56 | +## Review Checklist |
| 57 | + |
| 58 | +Reviewers will look for: |
| 59 | + |
| 60 | +- All builds, tests, and lints passing in CI |
| 61 | +- New tests covering behavior changes |
| 62 | +- Clear and concise code following existing style (see `README.md` for error handling guidance) |
| 63 | +- Documentation updates for any public API changes |
| 64 | + |
| 65 | +## Notes |
| 66 | + |
| 67 | +- Fetch workflow histories with `cargo run --bin histfetch <workflow_id> [run_id]` (binary lives in `test-utils`). |
| 68 | +- Protobuf files under `sdk-core-protos/protos/api_upstream` are a git subtree; see `README.md` for update instructions. |
0 commit comments