Skip to content

ci(frontend): enforce oxfmt and oxlint on the workspace packages [TBD] - #10393

Closed
saltas888 wants to merge 1 commit into
developfrom
chore/enforce-packages-lint-ci
Closed

ci(frontend): enforce oxfmt and oxlint on the workspace packages [TBD]#10393
saltas888 wants to merge 1 commit into
developfrom
chore/enforce-packages-lint-ci

Conversation

@saltas888

@saltas888 saltas888 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Closes #10390

⚠️ This touches CI — needs a human decision before merge

AGENTS.md lists CI/CD workflow changes under Ask First. This PR is prepared, verified, and
left in draft deliberately: the frontend owner should confirm the approach before it lands.

What is enforced now

frontend/packages/ui and frontend/packages/graph ship oxfmt.config.ts + oxlint.config.ts and
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 (packages/ui since 2026-03-18, packages/graph since 2026-06-11).

Four steps are added to the existing frontend-lint job, each running the package's own script:

- run: pnpm --filter @infrahub/ui run format:check      # oxfmt --check
- run: pnpm --filter @infrahub/ui run lint              # oxlint
- run: pnpm --filter @infrahub/graph run format:check
- run: pnpm --filter @infrahub/graph run lint

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-lockfile with
working-directory: ./frontend/app installs the whole workspace, not just the app — verified from
a clean worktree: after that exact command, frontend/packages/{ui,graph}/node_modules/.bin/ both
contain oxfmt and oxlint.

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/graph was already
clean on all four checks. Fixed with the packages' own tools — 2 files, +15/−41:

File Check Fix
src/styles/theme.css oxfmt oxfmt --write — reflows 6 CSS custom properties that were wrapped at a narrower width than oxfmt's (+10/−38)
src/theme/theme-provider.tsx oxlint capitalized-comments (×2) Manual (+5/−3)

The one manual fix: oxlint --fix "fixes" a wrapped three-line // comment by capitalising each
continuation 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 the
rule 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):

Command Clean tree With probe
pnpm --filter @infrahub/ui run format:check pass, 60 files exit 1src/theme/theme-provider.tsx
pnpm --filter @infrahub/ui run lint pass exit 1eslint(no-console)
pnpm --filter @infrahub/graph run format:check pass, 25 files exit 1src/index.ts
pnpm --filter @infrahub/graph run lint pass exit 1eslint(no-console)

biome ci . on frontend/app still passes (1457 files, no fixes applied) and yamllint -s is clean
on the modified workflow.

Confirmed in CI on this PR — the frontend-lint job 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: which
    directory 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 as
    the frontend formatter.

Plus a changelog/+frontend-packages-lint-ci.housekeeping.md fragment.

Follow-up not taken here

.agents/commands/pre-ci.md phase 1 still runs only biome check --write . for the frontend. Adding
the two packages there would mirror this gate locally, but #10385 is touching that file right now, so
it is left for a separate change.

`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>
@github-actions github-actions Bot added group/frontend Issue related to the frontend (React) group/ci Issue related to the CI pipeline labels Aug 24, 2026

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 6 files

Confidence score: 5/5

  • The changelog fragment filename changelog/+frontend-packages-lint-ci.housekeeping.md omits issue ID #10390, which could prevent proper changelog tracking; rename it to changelog/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.

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.

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>

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 13 untouched benchmarks


Comparing chore/enforce-packages-lint-ci (f10084b) with develop (3e3cd89)

Open in CodSpeed

@saltas888 saltas888 changed the title ci(frontend): enforce oxfmt and oxlint on the workspace packages ci(frontend): enforce oxfmt and oxlint on the workspace packages [TBD] Aug 24, 2026
@saltas888

Copy link
Copy Markdown
Contributor Author

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 frontend/ pnpm workspace and oxlint/oxfmt come out.

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, useSortedClasses is already enabled via ultracite/biome/core and the app is clean on all 1457 files.

The three violations fixed here are covered by #10399 as part of the wider reformat, so nothing from this branch is lost.

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

Labels

group/ci Issue related to the CI pipeline group/frontend Issue related to the frontend (React)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant