Repository navigation
One gate script for local runs and CI, with --locked on every cargo build, test and clippy #822
Copy link
Copy link
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationtestsTest code and test infrastructureTest code and test infrastructureworkflow-changeNeeds edits under .github/workflows/ (maintainer implements; not dispatched to coders)Needs edits under .github/workflows/ (maintainer implements; not dispatched to coders)
Milestone
Description
Goal
Contributors and CI run the same gate from one script, scripts/gate.sh, and every Cargo build, test and lint step uses --locked, so CI tests exactly the checked-in Cargo.lock and a stale lockfile fails instead of being re-resolved silently.
Context
- The gate is written down three times:
AGENTS.md:25-48(fmt, clippy, test, build; thennpx tsc -b,npm run lint,npx vitest runinapps/smart-ssh-community/frontend), thetestjob of.github/workflows/community.yml:35-181(same steps plus theapp-logicTauri-free boundary check:103-120,npm run generate-notices,npm run build, and on Linuxxvfb-run -a+SMART_SSH_REQUIRE_CLIPBOARD_TESTS=1for the clipboard round-trip testcrates/app-shell/src/file_clipboard.rs:323-327), and the developer's memory. There is no executable "run the whole gate" command. - No
cargo build/test/clippy/treecall in.github/workflows/*.ymluses--locked(community.yml:67,81,87,90,112,421,430,mutants.yml:78); onlycargo install … --lockeddoes. ACargo.lockthat does not match the manifests is re-resolved in CI, so the tested graph differs from the committed one. - Windows constraint (
community.yml:75-78): the Windows test job must not run Cargo under Git Bash (its perl cannot build the vendored OpenSSL), so Windows keeps the default shell for the Cargo steps.
Requirements
- New
scripts/gate.sh(bash,set -euo pipefail, runnable from any directory – itcds to the repo root), with named stages that can be run alone or all in order:rust:cargo fmt --all --check;cargo clippy --workspace --all-targets --locked -- -D warnings;cargo test --workspace --locked --no-fail-fast;cargo build --workspace --locked.boundary: theapp-logicTauri-free check moved fromcommunity.yml:103-120(same regex, same explicit failure path whencargo treeitself fails), with--locked.frontend: inapps/smart-ssh-community/frontend:npm ci(only with--ci, otherwise skipped whennode_modulesexists),npx tsc -b,npm run lint,npx vitest run,npm run build.- Usage:
scripts/gate.sh [--ci] [rust|boundary|frontend …]; no stage = all; unknown stage = exit 2 with usage. --ci: setsSMART_SSH_REQUIRE_CLIPBOARD_TESTS=1; on Linux runscargo testunderxvfb-run -aand fails with a clear message ifxvfb-runis missing. Without--cithe clipboard test may skip as today.- Prints a header per step and, at the end, which stages ran.
community.ymltestjob: on Linux and macOS the Cargo, boundary and frontend steps callscripts/gate.sh --ci <stage>(one CI step per stage, so the step names stay readable). On Windows the Cargo steps stay inline in the default shell with exactly the same commands and flags as the script (--locked,--no-fail-fast), and a comment pointing toscripts/gate.shand the reason.npm run generate-noticesand the cargo-about install stay in the workflow (not part of the local gate).--lockedon every othercargo build,cargo test,cargo clippyandcargo treecall in.github/workflows/*.yml(real-app-tests,mutants.yml,openssh-jump-tests.yml) and in.github/workflow-proposals/mutants.yml.cargo tauri android buildhas no--locked; leave it and add a comment.AGENTS.md: the gate section namesscripts/gate.sh(with the stage list and--ci) as the single way to run the gate and explains--lockedin one sentence; the four-line command block is replaced by the script call. Keep the existing explanations (whycargo buildwithouttest-supportmatters, browser tests) next to it.- Guard test (vitest, next to
tauriCommandsCheck.test.ts, e.g.src/cargoLockedCheck.test.ts, reading the files from the repo): every line in.github/workflows/*.yml,.github/workflow-proposals/*.ymlandscripts/gate.shthat runscargo build,cargo test,cargo clippyorcargo treecontains--locked(comment lines ignored); counter-proof on a fixture string.
Acceptance Criteria
-
scripts/gate.shruns all stages green on a clean checkout of the PR branch (Linux), andscripts/gate.sh rustalone runs only the Rust stage -
scripts/gate.sh --ci ruston Linux runscargo testunderxvfb-runwithSMART_SSH_REQUIRE_CLIPBOARD_TESTS=1(visible in the CI log of the PR) - After adding a dependency to a crate's
Cargo.tomlwithout updatingCargo.lock(locally, not committed),scripts/gate.sh rustfails at the first Cargo step with Cargo's "lock file needs to be updated" error (shown in the PR description) - The
cargoLockedCheckguard passes and its counter-proof fails a line without--locked -
community.ymltest job is green on Linux, Windows and macOS; real-app, browser and Android jobs are green -
AGENTS.mddescribes the gate only throughscripts/gate.sh - Relevant automated tests pass
Technical Notes
.github/change → needs the maintainer's approval before merge (CODEOWNERS).- The clipboard test and the boundary check are guards the CI must not skip silently; keep the explicit error paths.
- Keep the job and check names of
community.ymlunchanged (they are required status checks).
Spec impact: none
Related Work
- Copy a remote file to the system clipboard as a file #358 (clipboard test under xvfb), Check Tauri command definitions, registrations and frontend calls in CI #101 (Tauri command check)
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationtestsTest code and test infrastructureTest code and test infrastructureworkflow-changeNeeds edits under .github/workflows/ (maintainer implements; not dispatched to coders)Needs edits under .github/workflows/ (maintainer implements; not dispatched to coders)
Type
Fields
Priority
P2 - Normal
Activity
6 remaining items
ci: one gate script for local runs and CI, --locked on every cargo ca…
smart-ssh-coder commentedon Oct 26, 2026
Implementation ready for review. PR #949. Added scripts/gate.sh (rust/boundary/frontend, --ci), switched community.yml to it on Linux/macOS (Windows inline with identical flags), added --locked to all cargo calls in workflows, updated AGENTS.md, added cargoLockedCheck guard test. PR #949 CI green on all jobs; .github change needs maintainer approval.
smart-ssh-reviewer commentedon Oct 27, 2026
Review passed – moving on to merge. Gate script, CI wiring, --locked everywhere and guard test verified; CI green. Note: .github change needs maintainer approval per CODEOWNERS.
smart-ssh-coordinator commentedon Oct 27, 2026
Needs maintainer (merge): PR #949 changes CI files under .github/ and needs the maintainer's approval on its current head (b96a6d1). Review and approve it on GitHub, then remove needs-maintainer; the merge continues.
ci: one gate script for local runs and CI, --locked on every cargo ca…
smart-ssh-coordinator commentedon Oct 27, 2026
Merged and branch deleted: PR #949 (squash) in develop