ci(link): gate pull requests into main on fmt, clippy, and test #23
Reference in New Issue
Block a user
No description provided.
Delete Branch "ci/pr-checks"
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?
Follow-up to #22, which fixed the symptom. This fixes the cause.
Why
link/has nopull_requestworkflow — onlyrelease.yml(push tomain),sonarqube.yml(push tomain), andsync-project-tree.yml. Nothing looks at code before it merges. Sorelease.yml's first Rust gate,cargo fmt --check, doubled as this repo's de-facto lint — and when it tripped on the 3.0 cutover merge (2301c57), it took the whole release with it: no test, no build, no tag, no published binary. The failure surfaced at the worst possible moment, onmain, after review had already passed.What
.gitea/workflows/pr-checks.yml— one job, three gates, onpull_requestintomain:cargo fmt --checkcargo clippy --locked --all-targets -- -D warningscargo test --lockedDesign decisions worth reviewing:
release.yml, in the same order. Same commands, same--locked, cheapest-first. The point is that a green PR implies the release will clear its own gates — if the two drift, the guarantee is gone.release.yml); splitting fmt/clippy/test across jobs pays it three times for no wall-clock gain.-D warningsis new —release.ymldoesn't run it. Verified the crate is already clean at that bar, so it starts green and only fires on regressions. Say the word if you'd rather it be advisory and I'll drop the-D.cargo testcompiles everything for the host, so a PR still catches real compile breaks.~/.cargo+sidecar/target, keyed onCargo.lock. A miss is slower, never wrong.mainonly, per the ask. Work that lands onedgefirst is still caught on theedge→mainPR — which is exactly the hop (#21) that would have caught this one. Addingedgeto thebranches:list is a one-line change if you want it earlier.Also updates
link/README.md: the layout table lists the new workflow, and the build section gives the three commands to run locally before pushing.Verification
All three gates run locally against this branch:
The workflow YAML parses, and the job/step graph is what's intended.
This branch was cut on top of #22 so its own run would be green; now that #22 has merged, the PR is a single commit — just the workflow and the README note.
One-time manual step after merge
CI reporting a status doesn't block anything until Gitea is told to require it: Settings → Branches → Branch Protection on
main→ enable Status Check → patternPR Checks / *. Gitea only offers a context in its dropdown once it has reported, so let this run on one PR first; the glob matches without the dropdown.AI-assisted: written with Claude Code (Claude Opus 5).