Skip to content

[codex] add npm compilePackages sweep#4350

Draft
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-npm-sweep-ci
Draft

[codex] add npm compilePackages sweep#4350
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-npm-sweep-ci

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

Linked issue: #805

Summary

Adds an advisory npm package sweep for perry.compilePackages:

  • new test-compat/npm-sweep/run.py runner that generates one temporary fixture per package, installs npm dependencies, compiles a tiny namespace import with perry.compilePackages, optionally runs the output, and writes JSON/CSV/Markdown artifacts plus per-package logs;
  • prioritized package manifest with the existing tier-1 baseline (nanoid, ms, zod, uuid, dayjs, chalk) and issue-body targets (express, hono, pino, vitest, prisma) ready for wider manual/nightly runs;
  • checked-in CSV history header at test-compat/npm-sweep-history.csv so scheduled runs append trend rows before uploading artifacts;
  • dedicated nightly/manual NPM Package Sweep workflow that builds Perry, runs the sweep, uploads artifacts, and stays advisory unless manually dispatched with strict=true;
  • focused unit coverage for package-spec parsing, first-failure-line selection, command timeout reporting, and dry-run artifact output.

Why this cut

#805 asks for continuous npm-package validation and trendable first-failure reporting. This is intentionally separate from tests/release/packages, which remains the pinned deterministic release tier. Keeping the runner, package manifest, artifact schema, and scheduled workflow together makes the CI signal usable without mixing in package-compat fixes.

Validation

  • python3 -m unittest tests.test_npm_sweep
  • JSON/YAML parse check for test-compat/npm-sweep/packages.json and .github/workflows/npm-package-sweep.yml
  • ASCII check for the new workflow, runner, docs, package manifest, and unit test
  • python3 test-compat/npm-sweep/run.py --dry-run --packages nanoid,ms --out-dir /tmp/perry-npm-sweep-dry-2 --history /tmp/perry-npm-sweep-history-2.csv
  • python3 test-compat/npm-sweep/run.py --packages ms --limit 1 --perry-bin /bin/false --out-dir /tmp/perry-npm-sweep-install-classify-2 --history /tmp/perry-npm-sweep-install-classify-history-2.csv --install-timeout 120 --compile-timeout 10 --run-timeout 5
    • verified npm install succeeds and the compile branch records compile-fail artifacts.
  • cargo fmt --all -- --check
  • git diff --check
  • git diff --cached --check
  • ./scripts/check_file_size.sh

Known limitations

  • Full Perry release build was not run locally for this tooling-only PR; unrelated cargo/rustc jobs were active in other worktrees. The workflow itself builds perry-runtime, perry-stdlib, and perry before running the sweep.
  • The generated fixture is a generic namespace import, not a semantic package test. It is meant to catch install/compile/link/run regressions and surface the first useful failure line.
  • Package failures are expected while compatibility is incomplete; the scheduled workflow is advisory by default.

Non-goals

  • fixing package-specific failures found by the sweep;
  • promoting the sweep to a required PR gate;
  • replacing curated release package fixtures;
  • maintaining a committed historical result row for every scheduled run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant