Skip to content

ci: lint, typecheck, test and build the ui/ app - #517

Merged
zaebee merged 2 commits into
mainfrom
claude/adoring-knuth-m6hrdb
Oct 1, 2026
Merged

zaebee merged 2 commits into
mainfrom
claude/adoring-knuth-m6hrdb

Conversation

@zaebee

@zaebee zaebee commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Closes #452.

Problem

The graph debugger in ui/ had no CI. ci.yml runs only the Python toolchain, and no workflow references ui/, so a change there could break the build and still merge green. It already had: main carried 6 ESLint errors and 2 TypeScript errors that nothing reported.

What changes

New workflow .github/workflows/ui.yml, path-filtered to ui/** and the workflow file itself. Job "UI Verification", run in ui/:

Step Command Why
Install bun install --frozen-lockfile --ignore-scripts Fails on a stale bun.lock. No dependency needs an install hook, so none gets to run code on the runner (Sonar S6505).
ESLint bun run lint
TypeScript bun run typecheck (tsc --noEmit -p .) Vite transpiles without type-checking, so build alone passes a type error. Runs as a package script so the TypeScript pinned in bun.lock is used, never an unpinned bunx fetch (Sonar S8543).
Tests bun run test:run (vitest) The canonical runner per ui/AGENTS.md; bun test has no vi.mock hoisting.
Build bun run build

Actions are pinned by SHA like the other workflows (setup-bun v2.2.0). Bun is pinned to 1.3.14. permissions: contents: read.

Fixes that bring main green under it. None of them changes behaviour:

  • applyHeatmap.test.ts: makeNode returns a typed Node, which drops six as any.
  • ControlPanel.test.tsx: the default props gain the required colorMode and onToggleColorMode (TS2322).
  • useGraphStore.ts: the namespace filter's type predicate names NodeNamespace instead of string (TS2677).
  • ui/package.json: a typecheck script.

Not included

prettier --check fails on 31 files. Reformatting them would bury this change in whitespace, and the issue scopes lint, typecheck, tests and build. It can be a separate PR that also adds a format-check step.

Test plan

  • Every step run locally from a clean node_modules with --ignore-scripts, each exit code checked: install, lint, typecheck, tests (14 files, 119 tests) and build all exit 0.
  • Before the fixes: lint failed with 6 errors and tsc with 2.
  • actionlint clean.
  • UI Verification is green on this PR (first run ~25s), SonarCloud gate passed with 0 new issues.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3

The graph debugger in ui/ had no CI: ci.yml runs only the Python toolchain,
so a change there could break the build and merge green. It already had —
main carried six eslint errors and two TypeScript errors nothing reported.

New workflow ui.yml, path-filtered to ui/** and itself: bun install
--frozen-lockfile (fails on a stale bun.lock), eslint, tsc --noEmit (vite
transpiles without type-checking, so build alone would pass a type error),
vitest via test:run (the canonical runner per ui/AGENTS.md; `bun test` lacks
vi.mock hoisting), and vite build. Actions pinned by SHA like the other
workflows; bun pinned to 1.3.14.

Fixes to bring main green under it, none changing behaviour:
- applyHeatmap.test.ts: makeNode returns a typed Node, dropping six `as any`.
- ControlPanel.test.tsx: defaults gain the required colorMode and
  onToggleColorMode props.
- useGraphStore.ts: the namespace filter's predicate names NodeNamespace,
  the type it narrows, instead of an unrelated string.

Not included: prettier --check fails on 31 files. Reformatting them would
bury this change in whitespace, and the issue scopes lint, typecheck, tests
and build.

Closes #452

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves TypeScript typing and test setup across several files, including adding color mode properties to the control panel test helper, typing the makeNode helper in heatmap tests to remove as any assertions, and using the NodeNamespace type in the graph store. A review comment suggests optimizing the namespace extraction in useGraphStore.ts by replacing the chained .map() and .filter() calls with a single-pass .reduce() to avoid intermediate array allocations on large graphs.

Comment thread ui/src/store/useGraphStore.ts
…e script

SonarCloud failed the quality gate on #517 with two vulnerabilities in the
new workflow:
- githubactions:S6505: `bun install` without --ignore-scripts lets package
  lifecycle scripts run on the runner. No dependency here needs one: every
  step passes from a clean install with --ignore-scripts.
- githubactions:S8543: `bunx tsc` could fetch an unpinned typescript. The
  check now runs as `bun run typecheck`, a package script using the
  typescript pinned in bun.lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

@zaebee
zaebee merged commit 86dbf38 into main Oct 1, 2026
4 checks passed
@zaebee
zaebee deleted the claude/adoring-knuth-m6hrdb branch October 1, 2026 11:04
zaebee added a commit that referenced this pull request Oct 1, 2026
`prettier --check src/` failed on 31 files: formatting had drifted with no
check to catch it, and eslint-config-prettier switches ESLint's style rules
off, so nothing else would. All files are reformatted with the repository's
own .prettierrc (no config change), and the UI job gains a Prettier step
(`bun run format:check`) after ESLint.

Whitespace and wrapping only: lint, typecheck, the 119 vitest tests and the
build all pass after the reformat. Follow-up to #517.


Claude-Session: https://claude.ai/code/session_01Uv6LUrB5HCQcqBvmcixYn3

Co-authored-by: Claude <noreply@anthropic.com>
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.

ci: lint/typecheck/test the ui/ app

2 participants