Skip to content

fix(frontend): use Biome 2.6.6, the version of the root configuration - #1908

Merged
Artuomka merged 2 commits into
mainfrom
frontend_biome_2_6
Nov 17, 2026
Merged

Artuomka merged 2 commits into
mainfrom
frontend_biome_2_6

Conversation

@Artuomka

@Artuomka Artuomka commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

The root biome.json uses the 2.6.6 schema and the keys preset, markdown and yaml (4e2152c). The frontend still installed Biome 2.4.0, which does not know these keys. So pnpm lint failed in CI before it checked a file.

  • Pin @biomejs/biome 2.6.6 in frontend/package.json and the lockfile.
  • Exclude public/assets from Biome. Version 2.6 lints standalone SVG files and asks for a title. These files are images that loads, and the alt text gives the accessible name.
  • Remove five unsafe optional chains in three spec files. A missing element still fails the test.
  • Apply the 2.6 formatter to three spec files.

Lint exit 0, typecheck clean, vitest 2569/2569.

Summary by CodeRabbit

  • Tests
    • Updated automated checks to require an authorization call before evaluating its policy data.

The root biome.json uses the 2.6.6 schema and the keys preset, markdown and
yaml (4e2152c). The frontend still installed Biome 2.4.0, which does not
know these keys. So `pnpm lint` failed in CI before it checked a file.

- Pin @biomejs/biome 2.6.6 in frontend/package.json and the lockfile.
- Exclude public/assets from Biome. Version 2.6 lints standalone SVG files
  and asks for a title. These files are images that <img> loads, and the alt
  text gives the accessible name.
- Remove five unsafe optional chains in three spec files. A missing element
  still fails the test.
- Apply the 2.6 formatter to three spec files.

Lint exit 0, typecheck clean, vitest 2569/2569.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The staticPolicies test helper now returns a string from the latest authorization mock call. It throws The mock has no call. when the mock has no recorded call.

Changes: Frontend test assertion

Layer / File(s) Summary
Static policy helper
frontend/src/stores/cedar-permissions.spec.ts
The helper now throws when the authorization mock has no recorded call. Otherwise, it returns staticPolicies from the latest call.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: gugu

Merge Risk: Minimal · up to 634a3

This change pins the frontend Biome version and tightens a test helper. It has no production runtime impact, and no actionable merge-blocking risk is evident.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive The title names the main change: pinning the frontend Biome version to 2.6.6 to match the root configuration. The raw summary covers only a test helper change in cedar-permissions.spec.ts and does not… Confirm that the changeset includes the Biome version bump in frontend/package.json and the lockfile, the public/assets lint exclusion, and the formatter changes. The raw summary lists only frontend/src/stores/cedar-permissions.spec.ts, so …
Passed Passed checks: 4 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Check Passed Summary: The reviewed range changes one file: frontend/src/stores/cedar-permissions.spec.ts (+4/-2). The change is test-only. The staticPolicies helper now throws The mock has no call. when …
Full details: Security Check

Explanation

Summary: The reviewed range changes one file: frontend/src/stores/cedar-permissions.spec.ts (+4/-2). The change is test-only. The staticPolicies helper now throws The mock has no call. when the mock has no recorded call. Before, it returned undefined through optional chaining. This makes the test fail on a missing call. It does not touch runtime code, authentication, authorization logic, input handling, or secrets. No OWASP-relevant surface is changed. Scope note: The PR description and objectives describe more changes. These include the Biome bump in frontend/package.json and the lockfile, the public/assets exclusion in frontend/biome.json, and optional-chain and formatter edits in three spec files. The PR-specific commit 5aef721b contains these changes. It is not an ancestor of the review base 624742f7. The review range base..head does not show them, so I could not confirm their state in the reviewed range. I reviewed the commit content anyway. The biome.json change adds a lint exclusion for public/assets. The package.json change pins the Biome dev tool to 2.6.6. Neither change alters runtime behavior or weakens an application security control. Lint configuration does not affect deployed security. No OWASP-relevant regression appears in either the reviewed range or the commit. Author: Provider-reported primary author is Artuomka (GitHub, rocket-admin/rocketadmin PR #1908). The author does not affect this security verdict. Conclusion: The PR introduces no explicit security failure condition under this check.

Full details: Title check

Explanation

The title names the main change: pinning the frontend Biome version to 2.6.6 to match the root configuration. The raw summary covers only a test helper change in cedar-permissions.spec.ts and does not show the Biome version bump, lockfile update, or lint config changes described in the objectives. The title therefore matches the stated PR objectives but is not supported by the file-level summary, which covers a single spec file.

Resolution

Confirm that the changeset includes the Biome version bump in frontend/package.json and the lockfile, the public/assets lint exclusion, and the formatter changes. The raw summary lists only frontend/src/stores/cedar-permissions.spec.ts, so the file-level summary should be regenerated to cover the full changeset. If the full changeset is confirmed, the title can stay as is.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

frontend/src/stores/cedar-permissions.spec.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the mock call log
Then finds the policies, clear and bright
No call? An error marks the gap
One string returns from the latest call
The test helper hops along its way

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ed64144-4071-4bb8-996a-bcd0a548d0bb
Commits

Reviewing files that changed from the base of the PR and between 5aef721 and 634a3e1.

Files selected for processing: 1

  • frontend/src/stores/cedar-permissions.spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai
coderabbitai Bot requested a review from gugu November 17, 2026 10:30
@Artuomka
Artuomka merged commit 717796a into main Nov 17, 2026
17 checks passed
@Artuomka
Artuomka deleted the frontend_biome_2_6 branch November 17, 2026 10:58
Artuomka added a commit that referenced this pull request Nov 30, 2026
The workflow installed Biome 2.4.0, but biome.json uses the 2.6.6 schema
since #1908. The old CLI rejected the config on every backend pull request.
The step now runs `pnpm exec biome`, so the version comes from the lockfile.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
gugu pushed a commit that referenced this pull request Nov 30, 2026
…scale) (#1910)

* feat: upgrade old PGlite data on start, add optional trusted-header login

PGlite upgrade:
- Read PG_VERSION before any engine opens the data directory.
- For a Postgres 17 directory (PGlite 0.4), dump a copy with the old engine
  (npm aliases pglite-pg17 / pglite-tools-pg17) and restore it into the
  current engine. Row counts are compared before the swap.
- The old files stay in <data dir>/.pglite-backup-pg17-<time>/. A state file
  lets a restart finish an interrupted swap.
- Runs in main.ts and datasource.config.ts (migration:run runs first in Docker).
- Unknown majors and PGlite 0.3 data (template1) stop the start, files unchanged.

Trusted-header login (self-hosted only, off by default):
- TRUSTED_AUTH_HEADER names a header set by a trusted proxy, for example
  Tailscale-User-Login with tailscale serve.
- POST /selfhosted/header-login signs in an existing user with that email and
  sets the usual session cookies. Unknown, ambiguous, suspended and 2FA users
  get 403. Every attempt goes to the sign-in audit (new TRUSTED_HEADER method).
- The frontend tries it once at start when no session exists.
- README documents the setup and the trust boundary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: optional proxy secret and user auto-creation for header login

- TRUSTED_AUTH_PROXY_SECRET: when set, /selfhosted/header-login also requires
  the X-RocketAdmin-Proxy-Secret header with that value (constant-time compare).
- TRUSTED_AUTH_AUTO_CREATE_USERS=true: an unknown email gets a new user in the
  instance's single company with the USER role and no groups. The first user of
  an empty instance becomes ADMIN of a new company. More than one company
  refuses auto-creation.
- The header value must be a valid email (rejects comma-joined duplicates).
- Unit tests for the creation paths, e2e tests for the secret check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: serialize header-login user creation

Two parallel first sign-ins could both see an empty instance and both become
ADMIN of separate companies, and two requests for one new email could create
two users. User creation now runs one at a time in the process and re-checks
the email, the user count and the companies inside the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: self-hosted API listens only on loopback behind nginx

In the self-hosted Docker image the API on port 3000 now binds to 127.0.0.1,
so other containers and published ports cannot bypass nginx (and with it the
header-login trust boundary). nginx proxies to 127.0.0.1:3000 instead of
localhost, which can resolve to ::1.

SaaS mode (IS_SAAS set) keeps listening on all interfaces, because other
services call port 3000 directly. BACKEND_LISTEN_HOST overrides the address.
Without it, outside the image, the server listens on all interfaces as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: SaaS mode also listens only on loopback behind nginx

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: remove stale AWS CodeBuild buildspec

It built with Node 16 from backend/ (no Dockerfile there) and mapped port 3000,
which the image no longer exposes outside the container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: hardcode the API listen address to 127.0.0.1

Remove BACKEND_LISTEN_HOST. The API always listens only on loopback;
clients reach it through nginx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(docker-compose): reach the backend through nginx

The API now listens only on 127.0.0.1 inside the container, so:
- the backend service runs the image's runner.sh (nginx + API) instead of
  'pnpm start', and publishes 8080 instead of 3000;
- the ws-server checks connection tokens at backend:8080/api/connection/token;
- the SaaS microservice gets CORE_URL=http://backend:8080/api;
- DATABASE_URL is set for the backend; .development.env has it commented
  out, so migrations failed on start before this change too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ws-server): default token check URL goes through nginx on 8080/api

The backend API listens only on 127.0.0.1:3000 inside its container, so the
default http://autoadmin-internal-auth.local:3000/connection/token no longer
reaches it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* ci: run Biome from the lockfile in the code-quality workflow

The workflow installed Biome 2.4.0, but biome.json uses the 2.6.6 schema
since #1908. The old CLI rejected the config on every backend pull request.
The step now runs `pnpm exec biome`, so the version comes from the lockfile.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* ci: build shared-code before the backend typecheck

The backend imports the compiled files in shared-code/dist. The runner has
no dist directory, so the typecheck step failed with 307 errors.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Artem Niehrieiev <r.tem@tuta.io>
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.

2 participants