dashboard/src/api/generated/ is written by ts-rs during cargo test -p tireless-entities and committed. Nothing verifies the committed
files match the Rust types, so a change to a domain type can land with stale
bindings and the dashboard compiles against a type that no longer exists.
This already nearly happened: adding JobKind::Discover and two label fields
changed three generated files, and only a manual cargo test regenerated them.
Make the drift a build failure.
Files
.gitea/workflows/deploy.yaml — add the check after the test step
Steps
After cargo test --workspace, run git diff --exit-code dashboard/src/api/generated.
Make the failure message say what to do — run cargo test -p tireless-entities
and commit the result — rather than leaving a bare diff.
Confirm the check passes on a clean tree and fails when a domain type is
changed without regenerating.
Acceptance
git diff --exit-code dashboard/src/api/generated exits zero on a clean
checkout after cargo test --workspace.
Deliberately editing a generated file and re-running the check exits non-zero.
cargo test --workspace still passes.
Out of scope
Moving generation to a build script or removing the committed files. They are
committed on purpose so the dashboard builds without a Rust toolchain.
Changing TS_RS_EXPORT_DIR or anything in .cargo/config.toml.
Any change to the domain types themselves.
## Goal
`dashboard/src/api/generated/` is written by ts-rs during
`cargo test -p tireless-entities` and committed. Nothing verifies the committed
files match the Rust types, so a change to a domain type can land with stale
bindings and the dashboard compiles against a type that no longer exists.
This already nearly happened: adding `JobKind::Discover` and two label fields
changed three generated files, and only a manual `cargo test` regenerated them.
Make the drift a build failure.
## Files
- `.gitea/workflows/deploy.yaml` — add the check after the test step
## Steps
1. After `cargo test --workspace`, run `git diff --exit-code dashboard/src/api/generated`.
2. Make the failure message say what to do — run `cargo test -p tireless-entities`
and commit the result — rather than leaving a bare diff.
3. Confirm the check passes on a clean tree and fails when a domain type is
changed without regenerating.
## Acceptance
- `git diff --exit-code dashboard/src/api/generated` exits zero on a clean
checkout after `cargo test --workspace`.
- Deliberately editing a generated file and re-running the check exits non-zero.
- `cargo test --workspace` still passes.
## Out of scope
- Moving generation to a build script or removing the committed files. They are
committed on purpose so the dashboard builds without a Rust toolchain.
- Changing `TS_RS_EXPORT_DIR` or anything in `.cargo/config.toml`.
- Any change to the domain types themselves.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Goal
dashboard/src/api/generated/is written by ts-rs duringcargo test -p tireless-entitiesand committed. Nothing verifies the committedfiles match the Rust types, so a change to a domain type can land with stale
bindings and the dashboard compiles against a type that no longer exists.
This already nearly happened: adding
JobKind::Discoverand two label fieldschanged three generated files, and only a manual
cargo testregenerated them.Make the drift a build failure.
Files
.gitea/workflows/deploy.yaml— add the check after the test stepSteps
cargo test --workspace, rungit diff --exit-code dashboard/src/api/generated.cargo test -p tireless-entitiesand commit the result — rather than leaving a bare diff.
changed without regenerating.
Acceptance
git diff --exit-code dashboard/src/api/generatedexits zero on a cleancheckout after
cargo test --workspace.cargo test --workspacestill passes.Out of scope
committed on purpose so the dashboard builds without a Rust toolchain.
TS_RS_EXPORT_DIRor anything in.cargo/config.toml.