Skip to content

ci: run ci:local on every PR into main (#18 follow-up) - #23

Merged
pitimon merged 3 commits into
mainfrom
ci/18-pr-ci-gate
Jul 4, 2026
Merged

ci: run ci:local on every PR into main (#18 follow-up)#23
pitimon merged 3 commits into
mainfrom
ci/18-pr-ci-gate

Conversation

@pitimon

@pitimon pitimon commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a PR-triggered CI check so failing tests / validators block the merge button — closing the gap that let the #18 dashboard redesign merge with a red ci:local.

Root cause: the repo's gate (npm run ci:local) only ran post-merge, as the test job of npm-publish.yml (on: push: branches: [main]). Nothing ran it in front of a PR, so two failing layout tests + a ui-hardcode ratchet failure sailed through review.

This PR: .github/workflows/ci.yml

  • Triggers on pull_request into main (post-merge coverage stays in npm-publish.yml — no duplicate runs).
  • Runs the identical gate: Node 24 (dashboard tests import TS directly), npm ci for root + dashboard/, then npm run ci:local.
  • Reuses the same public VITE_INSFORGE_* build env already committed in npm-publish.yml (not secrets — shipped in every bundle).
  • permissions: contents: read; failure propagates (no || true / continue-on-error).

Test plan

  • YAML parses; trigger = pull_request→main, node = 24, gate = npm run ci:local
  • Governance audit: no false-success anti-pattern, least-privilege perms
  • This PR's own check run is the live test — it exercises ci:local on GitHub and should pass (green)
  • Manual: add CI / ci:local as a required status check in branch protection to enforce blocking

Refs #18

itarun.p added 3 commits July 4, 2026 20:16
The repo's quality gate (`npm run ci:local`) previously ran only
post-merge, as the test job of npm-publish.yml (`on: push: [main]`).
That let the #18 dashboard redesign merge with two failing layout tests
and a ui-hardcode ratchet failure — nothing ran the gate in front of the
PR.

Add .github/workflows/ci.yml triggering on pull_request into main and
running the identical gate (Node 24, root + dashboard `npm ci`, the same
public VITE_INSFORGE_* build env as npm-publish.yml). Triggers on
pull_request only — post-merge coverage on main stays in npm-publish.yml.

To actually block merges, add "CI / ci:local" as a required status check
in main's branch-protection rules.
`test/init-local-runtime-reinstall.test.js` asserts that
installLocalTrackerApp copies dashboard/dist/index.html into the target
app dir. That copy is guarded on the repo's dashboard/dist existing
(init.js:1073), but ci:local ran `npm --prefix dashboard run build`
LAST — so on a clean checkout the test ran before dist existed and
failed with ENOENT. It only passed locally on stale build artifacts.

Surfaced by the new PR CI workflow (first clean-env run of the gate).
Move the dashboard build to the front so ci:local is self-contained on
any fresh checkout. Verified: `rm -rf dashboard/dist && npm run ci:local`
now builds first and the install test passes (exit 0).
`ci:local` is green on macOS (the maintainer's dev env) but has chronic
Linux-only failures — inode reuse after unlink+recreate defeats the
file-rotation detection exercised by rollout-parser tests, and
npm-publish.yml's ubuntu `test` job has failed on every push to main for
the same class of reason. Fixing those for a Linux runner is a separate
cross-platform hardening effort. Running the PR gate on macOS gives a
green, enforceable check now that still blocks the platform-independent
regressions this gate exists for (a stale layout test fails on any OS).
@pitimon
pitimon merged commit f694da9 into main Jul 4, 2026
1 check passed
@pitimon
pitimon deleted the ci/18-pr-ci-gate branch July 4, 2026 13:29
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