CI: fail the build when generated TypeScript bindings are stale #8
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.