* 🔧 Bump Rust version of the devenv image to 1.99 * 🔧 Run the pinned Rust setup from the lint and format scripts ./build and ./test switch to the Rust version in render-wasm/_build_env through setup, but ./lint did not, and formatting called cargo fmt directly. In CI both ran on the devenv image's default toolchain. Make ./lint run setup and add a ./fmt script that does the same, so all render-wasm entry points use the pinned version. CI and scripts/ci now call ./fmt instead of cargo fmt. AI-assisted-by: claude-opus-5-5
5.9 KiB
CI (scripts/ci)
scripts/ci runs CI-style checks — lint, tests, format — and, on request,
the production build of each module, for one or more monorepo modules, and
prints a per-task summary. It is the local equivalent of CI; use it to
verify changes before declaring work done.
It also exports PENPOT_FLAGS with enable-backend-asserts appended (keeping
whatever the caller already set), which is what puts clojure.core/assert
into the compiled test code. Prefer it over calling clojure -M:dev:test by
hand for that reason alone: without the flag the suite passes while every
assertion is compiled out. GitHub Actions sets the same flag.
When to use
- After implementing or fixing code in a module: run its checks before finishing (AGENTS.md: run the applicable lint and format checks).
- When
common/changed: validate its consumers too (frontend, backend, exporter; see the dependency graph inmem:critical-info). - To fix formatting across a module (
--fix) or repair delimiters (--paren-repair) before linting.
How to use (CLI)
Run from the repo root:
./scripts/ci MODULE... # lint + test + fmt per module
./scripts/ci --build MODULE # production build only
./scripts/ci --all --no-test # lint + fmt on all modules
./scripts/ci --lint frontend # lint only
./scripts/ci --fix --no-test frontend # format files, skip tests
./scripts/ci --paren-repair --all # fix delimiters in all Clojure modules
./scripts/ci --dry-run --all # preview what would run
Modules: frontend backend common render-wasm exporter mcp plugins library media-processor.
Flags:
- Default tasks:
lint,test,fmt(format check;--fixformats instead). Build is not in the default set. --lint/--test/--fmt/--buildrun one task only;--no-lint/--no-test/--no-fmt/--no-builddrop one task from the default set.--paren-repairruns only the delimiter repair — it wrapsscripts/paren-repairover each module's Clojure/CLJS sources; seemem:scripts/paren-repair.--allselects every module;--exclude MODdrops one (repeatable).--fail-faststops at the first failure;--quietsuppresses failure output;--dry-runprints commands without running;--cleanremoves the log directory.
Build task
--build compiles each module the way production does, reusing caches
(.shadow-cljs, target/, node_modules) instead of clearing them. It
does not package bundles: manage.sh build-bundle remains the way to
produce deployable artifacts.
| Module | Command | Output |
|---|---|---|
frontend |
NODE_ENV=production pnpm run build:app:main && pnpm run build:app:libs && pnpm run build:app:assets |
frontend/resources/public/, frontend/target/ |
backend |
clojure -T:build jar |
backend/target/penpot.jar |
common |
(none; skipped) | — |
render-wasm |
./build (targets frontend and export) |
render-wasm/target/ |
exporter |
NODE_ENV=production pnpm run build:app |
exporter/target/ |
mcp |
pnpm run build |
mcp/*/dist |
plugins |
pnpm run build:runtime && pnpm run build:plugins && pnpm run build:styles-example && pnpm run build:doc |
plugins/dist/ |
library |
NODE_ENV=production clojure -M:dev:shadow-cljs release library |
library/target/library/ |
media-processor |
pnpm run types:check && pnpm run build |
media-processor/dist/ |
- Every output path above is gitignored, so a build leaves
git statusclean. - The module
buildscripts in eachscripts/buildare not used: they deletenode_modules, wiperesources/publicand runpnpm install, which belongs to the bundle pipeline, not to a local check. frontendandlibraryhave abuildscript that clears the shadow-cljs cache first; the task calls the inner commands to stay incremental.exporterusesbuild:appfor the same reason.commonhas no artifact of its own: its compilation is exercised by itstesttask and by the builds offrontend,backendandexporter.media-processoris the ninth module. It has no lint, so that task shows as skipped; its build runstsc --noEmitbefore esbuild because esbuild does not type-check.- Cold-cache cost measured on the devenv:
library~120 s,frontend~120 s,exporter~80 s,backend~35 s. With warm caches the whole set (8 builds) takes ~4 min. The first run ofclojure -T:build jardownloadstools.buildif it is not in~/.m2. pnpm runmay trigger a dependency check/install whennode_modulesdrifts from the lockfile (verify-deps-before-run), so the first run after a dependency change can need network.render-wasm/buildtakes a lock (_build_lock): never run two builds at once in the same checkout.
Logs and exit codes
- Full output of every task:
.ci-logs/<module>-<task>.log. - On failure the script prints the last 30 lines; the final summary lists
every failed
module:taskwith its log path. - Exit code 0 when all selected tasks passed, 1 otherwise.
- Diagnose failures by reading the log file — never pipe test output through filters (AGENTS.md hard rule).
Notes
mcphas no lint task andmedia-processorhas no lint task; both show as skipped.render-wasmuses./lint,./test, and./fmt.scripts/test_ci.py(unittest,python3 scripts/test_ci.py) covers the flag wiring, one build command per module and the help text through--dry-run; it executes no real build.- Exports
PENPOT_FLAGSwithenable-backend-assertsappended to any existing value, so backend test runs compile in and exercise precondition asserts; seemem:backend/testing. - Test and build tasks are long-running (backend:
clojure -M:dev:test; frontend build: ~2 min warm); use a generous timeout when calling it from an agent shell. - Skill entry point:
.agents/skills/local-ci/SKILL.md. - Testing principles and output discipline:
mem:testing.