Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ jobs:
- run: cargo clippy --locked --workspace --all-targets -- -D warnings
# snapshot-diff goes on crates.io: it builds without its schemars feature too.
- run: cargo clippy --locked -p snapshot-diff --no-default-features --all-targets -- -D warnings
# Unused dependencies, in each of the three Rust workspaces (cargo-shear; ignores in each Cargo.toml's
# [package.metadata.cargo-shear], with the reason beside them).
- uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0
with:
install_args: github:Boshen/cargo-shear
- run: |
cargo shear
(cd clients/gallery/rust && cargo shear)
(cd clients/gallery/rust/examples/loco && cargo shear)

# The app (app/, Laravel Rust, the root workspace's visualci-app). Its tests also render every customer email as HTML
# and text for the visual job. clippy covers it in the lint job (formatting is the pre-commit hook's, lefthook.yml).
Expand Down Expand Up @@ -625,6 +634,13 @@ jobs:
working-directory: frontend
env:
GITHUB_TOKEN: ${{ github.token }} # the docs' CLI release (scripts/cli-version.mjs)
# Unused files and dependencies in the frontend (knip.jsonc; unused exports are reported, not failed). Pinned
# here rather than in package.json, so its dependency tree stays out of the frontend's lockfile. It loads
# vite.config.ts, which reads the CLI release too.
- run: pnpm dlx knip@6.49.0 --no-progress
working-directory: frontend
env:
GITHUB_TOKEN: ${{ github.token }}
# visualci.com's static site: assembled from the build and checked (every docs page has its Markdown copy, and
# llms.txt links each one), then deployed by the site job.
- run: VISUALCI_ANALYTICS=1 node scripts/site.mjs
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ design is in `docs/design.md`; read it before changing the architecture, and upd
`@ts-expect-error`, `# noqa`, a zizmor ignore and the rest) is listed in `scripts/ci/suppressions.txt` with its
reason, added in the change that adds it (`scripts/ci/check_suppressions.py`). Fix what a lint finds before you
reach for a suppression.
- **Unused code fails CI:** cargo-shear fails on unused Rust dependencies in the three workspaces (`lint` job; its
unlinked-file warnings don't fail), and Knip on unused files and dependencies in `frontend/` (`knip.jsonc`,
`clients` job; unused exports are reported only, for now).
Delete what they find; ignore something only in their config, with the reason beside it.
- **Links are checked** by lychee (`lychee.toml`): CI's `clients` job checks every page, file and `#anchor` the built
site links to, offline, so a broken internal link fails the build that makes it. The Audit workflow checks every link
on the live site, outside ones included, each night. Exclude a link in `lychee.toml` only with the reason beside it.
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ envschema = { path = "../crates/envschema" }
# VisualCI's own crates, shared with the CLI.
visualci-core = { path = "../crates/visualci-core", features = ["bundle"] }
tempfile.workspace = true
snapshot-diff = { path = "../crates/snapshot-diff" }

[dev-dependencies]
# Hand-made bundles in tests/bundle_uploads.rs: links, bad paths, a zstd bomb
Expand All @@ -106,3 +105,8 @@ regex = "1"
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "std"] }
# A GitHub App key made at test time, so no private key is committed
rsa = { version = "0.9", features = ["pem"] }

# cargo-shear (CI's lint job): the migrations are compiled in by laravel::db::migrations!, not by `mod`, and the
# seeders module has no seeders yet (its only line is a doc comment, which cargo-shear calls empty).
[package.metadata.cargo-shear]
ignored-paths = ["database/migrations/*.rs", "database/seeders/mod.rs"]
2 changes: 1 addition & 1 deletion clients/gallery/rust/examples/loco/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ publish = false
[dependencies]
loco-rs = { version = "1.4", default-features = false }
async-trait = "0.1"
axum = "0.8"
serde = { version = "1", features = ["derive"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
# region: dependencies
Expand All @@ -24,4 +23,5 @@ askama = "0.16"
visualci-gallery = { path = "../.." }

[dev-dependencies]
axum = "0.8"
serde_json = "1"
13 changes: 13 additions & 0 deletions frontend/knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Knip (unused files, dependencies and exports), run by CI's clients job after the frontend's install. Unused files and
// dependencies fail it; unused exports are reported only, for now. Ignore something here only with the reason beside it.
{
"$schema": "https://unpkg.com/knip@6/schema.json",
// CI runs scripts/site.mjs (ci.yml, which Knip can't see from here). Knip finds package.json's scripts and the app's
// own entries (through Vite) itself, so an unused script is reported.
"entry": ["scripts/site.mjs"],
// Type declarations for the .mjs scripts, which TypeScript reads beside each script.
"ignore": ["scripts/*.d.mts"],
// scripts/og.mjs loads its fonts with require.resolve on a computed path, which Knip can't follow.
"ignoreDependencies": ["@fontsource/geist"],
"rules": { "exports": "warn", "types": "warn" }
}
3 changes: 0 additions & 3 deletions frontend/src/bindings/ApiError.ts

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/src/bindings/Page.ts

This file was deleted.

1 change: 1 addition & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ typos = "1.53.0"
oxlint = "1.96.0"
lychee = "0.24.2"
"github:sbdchd/squawk" = "2.74.0"
"github:Boshen/cargo-shear" = "1.14.1"
Loading