Repository navigation
ci: gate Hearth pull requests on fmt, clippy and the test suite - #40
Open
PermutationResearch wants to merge 7 commits into
Open
PermutationResearch wants to merge 7 commits into
PermutationResearch wants to merge 7 commits into
Conversation
This was referenced Nov 30, 2026
Formatting runs on every push because it costs seconds. Everything that compiles runs on pull requests only, on one runner and one cargo cache, so a PR head is built once instead of three times. The test job supplies the Postgres that crates/hearth-control/tests/common needs (HEARTH_TEST_DATABASE_URL, CREATEDB) and installs openssh-server for the sshd fixture. Property tests run inside the workspace targets with proptest's default case count, so they add no job. No new dependencies: actions/checkout, actions/cache and a service container only.
A run whose clippy step failed saved check metadata only (172 MB) under the Cargo.lock key. The next run on that pull request hit that key exactly, so cache-hit was true and the save step was skipped: it rebuilt every crate and never replaced the entry, since caches are immutable. Build the test binaries with the arguments the test steps use, then save before the tests run and without always(), so failing tests still leave a warm cache while a lint failure, build failure or cancelled run saves nothing. Bump the key to v2 to retire the partial entries. A pull request still cannot restore another pull request's cache; that comes from the default branch once a push there has saved one.
`cargo clippy --workspace --all-targets -- -D warnings` failed before the test step ran, on code that predates the workflow. - chatgpt_plan_store.rs: import db::GenericClient, so the four advisory-lock `query_one` calls dispatch to the trait method that prepares once and keeps the statement. clippy.toml disallows tokio-postgres' inherent method. - threads/comparison.rs: fold the nested `if` into a let-chain. - chatgpt_plan.rs: move `mod tests` below the items it tests. - hearth-cli/tests/common/mod.rs: one `#![allow(dead_code)]` for fixtures the binaries share but do not all use, and drop the two now-duplicate outer allows. That is how hearth-control/tests/common already does it.
PermutationResearch
force-pushed
the
fix/hearth-ci
branch
from
December 1, 2026 04:47
2027c96 to
c29bc30
Compare
fix(lints): clear the seven clippy errors CI reports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Hearth's first CI. Two jobs:
cargo fmt --all --checkon every push and pull request.clippyandcargo testfor only the packages the diff touches (resolved fromcargo metadata; any file outside a package widens the scope to--workspace). Pushes toslice-2/control-plane: the full workspace suite.Postgres 16 service for
HEARTH_TEST_DATABASE_URL,openssh-serverfor thesshd -ifixture, one cargo cache, and a new push to the same PR cancels the running one.Why the split: the first runs measured the truth —
clippy --workspacetook 2 m, andcargo test --workspacewas still running after 43 minutes. 139 test binaries and 1,554 tests, each DB test creating, migrating and dropping its own database, on a cold build.Two fixes from those runs are in this PR:
HEARTH_TEST_DATABASE_URLis now a libpq keyword string, not a URI.crates/hearth-control/tests/common/mod.rsappendsdbname=<name>to the value; with a URI the name becamepostgres dbname=hearth_t_…, and 1,176 tests panicked withdatabase … does not exist.actions/cache/saveunderif: always(), so a failed run still warms the next one. It previously never saved, because every run failed.Verified here
cargo fmt --all --checkcargo clippy -p hearth-control -p hearth-cli --all-targets -- -D warnings-p hearth-control-p hearth-agent-core--workspacefmt,testStacks with #42, which clears the seven clippy errors this workflow first reported.