ci(frontend): enforce oxfmt and oxlint on the workspace packages [TBD] - #10393
ci(frontend): enforce oxfmt and oxlint on the workspace packages [TBD]#10393saltas888 wants to merge 1 commit into
Conversation
`frontend/packages/ui` and `frontend/packages/graph` ship oxfmt and oxlint configs plus the matching package scripts, but nothing ever ran them: the `frontend-lint` job's only frontend gate is `biome ci .` scoped to `frontend/app`. Both packages have been unchecked since they were created. Run each package's own `format:check` and `lint` scripts as extra steps in `frontend-lint`. `pnpm install --frozen-lockfile` from `frontend/app` already installs the whole workspace, so oxfmt and oxlint are on disk with no extra install step. Fixes the pre-existing violations this surfaced with the packages' own tools (one oxfmt reflow in `theme.css`, one comment rewrapped so oxlint's `capitalized-comments` passes without the auto-fix mangling the sentence), and records the app-uses-Biome / packages-use-oxfmt boundary in the design-system knowledge page and the frontend AGENTS.md. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 6 files
Confidence score: 5/5
- The changelog fragment filename
changelog/+frontend-packages-lint-ci.housekeeping.mdomits issue ID #10390, which could prevent proper changelog tracking; rename it tochangelog/10390-frontend-packages-lint-ci.housekeeping.md.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="changelog/+frontend-packages-lint-ci.housekeeping.md">
<violation number="1" location="changelog/+frontend-packages-lint-ci.housekeeping.md:1">
P3: This PR closes #10390, so the fragment should carry the issue ID in its filename. Rename `changelog/+frontend-packages-lint-ci.housekeeping.md` to `changelog/10390-frontend-packages-lint-ci.housekeeping.md`; the `+` orphan prefix is only for fragments with no linked issue.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
| @@ -0,0 +1 @@ | |||
| The frontend design-system packages (`@infrahub/ui` and `@infrahub/graph`) are now format- and lint-checked in CI with their own toolchain (oxfmt and oxlint), alongside the app's existing Biome check. Both packages shipped that toolchain but nothing ever ran it, so a misformatted or lint-breaking file in either package could ship green. | |||
There was a problem hiding this comment.
P3: This PR closes #10390, so the fragment should carry the issue ID in its filename. Rename changelog/+frontend-packages-lint-ci.housekeeping.md to changelog/10390-frontend-packages-lint-ci.housekeeping.md; the + orphan prefix is only for fragments with no linked issue.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At changelog/+frontend-packages-lint-ci.housekeeping.md, line 1:
<comment>This PR closes #10390, so the fragment should carry the issue ID in its filename. Rename `changelog/+frontend-packages-lint-ci.housekeeping.md` to `changelog/10390-frontend-packages-lint-ci.housekeeping.md`; the `+` orphan prefix is only for fragments with no linked issue.</comment>
<file context>
@@ -0,0 +1 @@
+The frontend design-system packages (`@infrahub/ui` and `@infrahub/graph`) are now format- and lint-checked in CI with their own toolchain (oxfmt and oxlint), alongside the app's existing Biome check. Both packages shipped that toolchain but nothing ever ran it, so a misformatted or lint-breaking file in either package could ship green.
</file context>
|
Superseded by #10399, closing this one. This PR made CI run what each package already declared, which fixes the coverage hole but keeps two toolchains for one frontend. That is the part worth fixing, so #10399 consolidates instead: Biome takes over the whole The deferred decision in #10390 is answered with numbers rather than preference. Consolidating on Biome reformats 28 files, consolidating on oxc reformats 62, Biome 2.5.1 is stable where oxfmt is still 0.63 beta, and the app plus the schema-visualizer submodule were already on Biome so oxc was the only outlier. The Tailwind sorting worry turned out not to bind, The three violations fixed here are covered by #10399 as part of the wider reformat, so nothing from this branch is lost. |
Closes #10390
AGENTS.mdlists CI/CD workflow changes under Ask First. This PR is prepared, verified, andleft in draft deliberately: the frontend owner should confirm the approach before it lands.
What is enforced now
frontend/packages/uiandfrontend/packages/graphshipoxfmt.config.ts+oxlint.config.tsandthe matching package scripts, but nothing ever ran them — the
frontend-lintjob's only frontendgate is
biome ci .scoped tofrontend/app. Both packages have been unchecked since they werecreated (
packages/uisince 2026-03-18,packages/graphsince 2026-06-11).Four steps are added to the existing
frontend-lintjob, each running the package's own script:Calling the package scripts rather than the binaries keeps CI and local in step: if a package
changes its tool or flags, CI follows without a workflow edit.
No extra install step is needed.
pnpm install --frozen-lockfilewithworking-directory: ./frontend/appinstalls the whole workspace, not just the app — verified froma clean worktree: after that exact command,
frontend/packages/{ui,graph}/node_modules/.bin/bothcontain
oxfmtandoxlint.Scope
Deliberately not in this PR: unifying the frontend on one toolchain. Biome owns the app and the
existing CI wiring, oxfmt owns the design system and has Tailwind class sorting configured; that
decision belongs to the frontend owner and is deferred in the issue. This PR only makes CI run what
each package already declares.
Pre-existing violations fixed
Turning the checks on surfaced three violations, all in
packages/ui.packages/graphwas alreadyclean on all four checks. Fixed with the packages' own tools — 2 files, +15/−41:
src/styles/theme.cssoxfmt --write— reflows 6 CSS custom properties that were wrapped at a narrower width than oxfmt's (+10/−38)src/theme/theme-provider.tsxcapitalized-comments(×2)The one manual fix:
oxlint --fix"fixes" a wrapped three-line//comment by capitalising eachcontinuation line, turning it into
A passive effect would let / That first commit paint in the wrong palette— grammatical nonsense. Rewrapped as a single block comment instead, which satisfies therule without mangling the prose. No other file was touched; no wholesale reformatting.
Proof the checks fail on bad input
A green check that checks nothing is worse than no check, so each of the four was run against a
deliberately broken file (
console.log( "probe" )appended, then reverted):pnpm --filter @infrahub/ui run format:checksrc/theme/theme-provider.tsxpnpm --filter @infrahub/ui run linteslint(no-console)pnpm --filter @infrahub/graph run format:checksrc/index.tspnpm --filter @infrahub/graph run linteslint(no-console)biome ci .onfrontend/appstill passes (1457 files, no fixes applied) andyamllint -sis cleanon the modified workflow.
Confirmed in CI on this PR — the
frontend-lintjob ran all four new steps and they passed:Check formatting (oxfmt): packages/ui·Check linting (oxlint): packages/ui·Check formatting (oxfmt): packages/graph·Check linting (oxlint): packages/graph.That the binaries resolved at all is the proof that no extra install step is needed.
Docs
The split was undocumented, which is how running Biome against a package file (and silently
reformatting it to a parent checkout's config) became possible. Recorded in two places:
dev/knowledge/frontend/design-system.md— a short "Formatting and linting" section: whichdirectory uses which tool, the per-package commands, and why Biome must never be run under
frontend/packages/.frontend/app/AGENTS.md— a pointer in "Before pushing", since that section presented Biome asthe frontend formatter.
Plus a
changelog/+frontend-packages-lint-ci.housekeeping.mdfragment.Follow-up not taken here
.agents/commands/pre-ci.mdphase 1 still runs onlybiome check --write .for the frontend. Addingthe two packages there would mirror this gate locally, but #10385 is touching that file right now, so
it is left for a separate change.