Commit Graph
476 Commits
Author SHA1 Message Date
Alexis Aguilar c1330ca99f ci(docs): scan every docs guide for accessibility issues daily (#54339)
## Problem

Since #53899, Docs E2E skips the accessibility scan on every CI run,
because the scan is slow and only covers the pages a diff names. Nothing
checks docs accessibility automatically, and a change to a shared
component can break pages that no pull request lists.

## Solution

A new **Docs Accessibility Scan** workflow scans every MDX guide on
production once a day.

- `.github/workflows/docs-a11y-scan.yml` runs `pnpm e2e:docs:all --grep
@a11y` against `https://supabase.com` at 05:17 UTC, off the top of the
hour when GitHub can delay or drop scheduled runs, and on demand through
`workflow_dispatch`. Its concurrency group includes the ref, so a manual
run on a branch can't cancel the scheduled run on `master`. It uploads
the Playwright report when the scan fails.
- `docs-master-alert.yml` now watches the new workflow, so a failed run
posts to the docs alerts Slack channel the same way the Production Smoke
Tests do.
- The shared alert no longer names the latest `master` commit and its
author. That commit often didn't cause the failure: a scheduled or
manual run tests whatever is deployed, and a workflow that was already
failing keeps failing on later commits. The alert now names the
workflow, says whether a push, schedule, or manual run failed, and links
the run. This applies to every workflow the alert watches.
- The scope resolver skips guides that `static-redirects.json` sends
elsewhere, in both the pull request scope and the full run. A redirected
guide has no docs article to scan, so it could never pass. Today that's
only `getting-started/features`. Docs E2E's sparse checkout now includes
`apps/docs/lib/redirects` so the resolver can read the file. One helper
lists every guide with no docs article to test (nav-disabled and
redirected), and both resolvers use it.
- The README says where and when the scans run, which checks fail the
scan, and how to start one by hand. It also lists guides with no MDX
file, such as the CLI and self-hosting config pages, as a known
limitation: the full run only resolves MDX guides, so the scan skips
them.

The full run doesn't need sharding. A list over 20 pages already runs on
3 workers, and the whole site took 15.3 minutes against production,
inside the job's 45-minute timeout.

## Known failures

A full run against production on 2026-11-30 failed on 5 guides with real
accessibility issues: 4 `duplicate-id` and 1 `heading-order`. Until
[DOCS-1817](https://linear.app/supabase/issue/DOCS-1817/fix-the-accessibility-issues-the-daily-docs-scan-finds-on-5-guides)
fixes them, each daily run fails and posts an alert.

## Follow-ups

-
[DOCS-1831](https://linear.app/supabase/issue/DOCS-1831/trace-each-docs-accessibility-scan-failure-to-the-commit-that):
keep a list of open failures in every docs alert, each with the commit
that introduced it, or its possible commits marked unconfirmed.

## Review instructions

1. Run `pnpm -C e2e/docs test` and confirm all 15 tests pass, including
the two redirect tests.
2. Confirm a change to a redirected guide resolves to no pages:
   ```bash
printf 'apps/docs/content/guides/getting-started/features.mdx\n' | pnpm
-C e2e/docs resolve-docs-scope
   ```
   Expect `skip=true`.
3. Run the scan the way the workflow does, on one passing guide and one
guide from DOCS-1817:
   ```bash
cd e2e/docs && PLAYWRIGHT_BASE_URL=https://supabase.com
DOCS_E2E_PAGE_PATHS=/docs/guides/auth,/docs/guides/resources pnpm exec
playwright test --grep @a11y
   ```
Expect `/docs/guides/auth` to pass and `/docs/guides/resources` to fail
on `heading-order`.
4. Check the alert payload. Copy the `run` script from
`docs-master-alert.yml`, replace the `curl` call with `echo "$PAYLOAD"`,
and run it with `TRIGGER` set to `push`, then `schedule`. Expect no
commit or author in either, and the run type in the workflow line.
5. After merge, start the workflow with `gh workflow run
docs-a11y-scan.yml` and confirm it finishes in about 15 to 20 minutes.

Verified locally: unit tests, mutation probes on both redirect tests,
typecheck, actionlint on the changed workflows, the alert payload for
push, scheduled, and manual runs, the resolver on a sparse checkout like
the workflow's, and a full-site scan against production. A scheduled
workflow only runs from `master`, so the workflow itself hasn't run on
GitHub yet.

Resolves
[DOCS-1816](https://linear.app/supabase/issue/DOCS-1816/run-the-docs-e2e-accessibility-scan-on-a-schedule-across-the-whole)
Resolves
[DOCS-1826](https://linear.app/supabase/issue/DOCS-1826/word-docs-slack-alerts-for-scheduled-workflow-failures-without-blaming)

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
2026-12-01 14:24:35 -07:00
Ali Waseem a310db593b [FE-5262] ci: run UI Tests on PRs into release (#54440)
The `release` ruleset requires the `test (1)` check, but `ui-tests.yml`
only triggers on PRs into `master`, so every PR into `release` stays
blocked waiting for a check that never reports (e.g. #54438).

Adds `release` to the `pull_request` branch filter in `ui-tests.yml`.
Follow-up to #54416, which did the same for typecheck, format and Docs
E2E. This was the last required check missing on `release`.

Resolves FE-5262
2026-12-01 15:24:22 -06:00
Matt Rossman ba86e23d63 fix: restore Studio Braintrust evals in CI (#54345)
## Problem

Our workflow sets `package_manager: pnpm`, which tells the Braintrust
action to run `pnpm dlx braintrust eval`. That command fetches the
latest `braintrust` package. Braintrust 4.0 dropped the bundled CLI, and
the [eval job now fails with
`ERR_PNPM_DLX_NO_BIN`](https://github.com/supabase/supabase/actions/runs/46545460526).

## Solution

```diff
- package_manager: pnpm
+ package_manager: npm
```

The new setting launches the CLI from Studio’s frozen pnpm install.
[Action
source](https://github.com/braintrustdata/eval-action/blob/c0dd75b29984a0cc63a827d6e8da2f23f2752be4/eval/src/braintrust.ts#L78-L116)

The action’s latest release, v2.1.0, still hardcodes `pnpm dlx
braintrust` in pnpm mode. The `npm` setting is a workaround to restore
CI now. We’ve asked Braintrust whether pnpm mode can use the project’s
installed CLI. [v2.1.0
source](https://github.com/braintrustdata/eval-action/blob/ed007eb24e933007a4079bd56643bc72d3cb016f/eval/src/braintrust.ts#L147-L154)

## Review instructions

The [PR
workflow](https://github.com/supabase/supabase/actions/runs/46563640999)
passed and posted the [Assistant eval
summary](https://github.com/supabase/supabase/pull/54345#issuecomment-7299032048).
Locally, `npx` also found the Assistant eval using Studio’s installed
CLI with npm offline.
2026-12-01 15:14:36 -05:00
Ali Waseem d57ff4ea06 ci: run typecheck, format and Docs E2E on PRs into release (#54416)
The `release` ruleset requires `typecheck`, `format` and `Docs E2E`, but
those workflows only trigger on PRs into `master`, so every PR into
`release` sits blocked waiting for checks that never report (e.g.
#54413).

Adds `release` to the `pull_request` branch filter in `typecheck.yml`,
`prettier.yml` and `docs-e2e.yml`.
2026-12-01 09:48:56 -06:00
Alexis Aguilar 64433ecf69 chore(github): drop review day counts from PR template (#54337)
## Problem

Follow-up to [#54089](https://github.com/supabase/supabase/pull/54089),
tracked in [DOCS-1590](https://linear.app/supabase/issue/DOCS-1590). The
blocked-PR callout uses `[!WARNING]`, which signals risk rather than a
merge dependency. The review categories also list review deadlines in
business days, which the template doesn't need to commit to.

## Solution

- The blocked-PR callout uses `[!IMPORTANT]`.
- The review categories no longer list a number of days. The section
still asks Supabase team members to select one category, and PRs from
forks are still reviewed as Low.

## Review instructions

1. Read the diff to `.github/pull_request_template.md`.
2. Confirm the four category labels (`- [ ] Critical`, `Urgent`,
`Moderate`, `Low`) still start the same way.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-30 17:40:21 -07:00
Alexis AguilarandClaude Opus 5.5 a5638ed9e2 fix(docs): check every changed page for broken links in Docs E2E (#53899)
## Problem

The Docs E2E suite tests the guide pages a PR changes, but only the
first 20 in sorted order. It drops the rest without a warning, so the
check passes green with pages untested.

That let a broken link through in #53561. The PR changed 62 guides,
`delete-project` ranked 23rd, and the suite never loaded it. The link
was missing its leading slash and resolved to a nested URL that returns
404 (fixed in #53871).

A check that skips pages arbitrarily can't be relied on to catch the
mistake it exists to catch.

## Solution

The link check now runs on every changed page, with no cap. The
accessibility scan no longer runs on pull requests, because it's slow
and only checks the pages a diff names. A scheduled whole-site run fits
it better, and that's tracked in
[DOCS-1816](https://linear.app/supabase/issue/DOCS-1816/run-the-docs-e2e-accessibility-scan-on-a-schedule-across-the-whole).
The `@a11y` tests stay in the suite, and `pnpm e2e:docs:a11y` still runs
them.

- The resolver returns every in-scope page. The 20-page cap is gone.
- The workflow runs the suite with `--grep-invert @a11y`, so CI runs
skip the accessibility scans. That includes manual `workflow_dispatch`
runs, which ran them before. DOCS-1816 covers when CI runs them again.
- Past 20 pages the suite runs on 3 workers instead of 1, the same as
the Studio suite.
- The suite no longer stops after 3 failed tests, so a run reports every
page with a broken link. A broken link in a shared partial can fail many
pages, and stopping at 3 left the rest unchecked.
- The Docs E2E job now runs the harness unit tests (`pnpm -C e2e/docs
test`) when `e2e/docs` or `e2e/shared` changes. No workflow ran them
before, and harness-only changes skip Playwright.

## Run time

Most PRs change few pages, so the added time is small. I looked at 51
recent merged PRs that touched guides: 67% changed 1 page, 20% changed
2-5, 8% changed 7-11, and 6% (3 PRs) changed 62-82. On the Vercel
preview the link test takes about 6.5s per page.

Estimated run time on the preview, excluding setup and retries. Skipping
the accessibility scan (about 6.4s per page) offsets the extra link
checks:

| Pages changed | Before (capped at 20, link check and accessibility
scan, 1 worker) | This PR (every page, link check only, 3 workers past
20) |
| ------------- |
------------------------------------------------------------------ |
-------------------------------------------------------- |
| 1 | ~13s | ~7s |
| 5 | ~1.1 min | ~0.5 min |
| 11 | ~2.4 min | ~1.2 min |
| 82 | ~4.3 min (62 pages unchecked) | ~3 min |

On production, 40 link tests took 50s on one worker and 13s on four, so
workers scale close to linearly. I haven't run a large page list in the
CI workflow, and the Vercel preview might throttle 3 workers at once. If
it does, lower the worker count in `playwright.config.ts`. CI retries a
failing test up to 2 times, so a failing page can cost 3 runs. Since the
suite no longer stops after 3 failures, a change that breaks many pages
pays that cost for each of them. The job times out at 30 minutes, which
the link check alone would reach at roughly 800 pages on 3 workers.

## Review instructions

1. Run `pnpm -C e2e/docs test` and confirm the scope tests pass,
including the 82-page case.
2. Pipe 82 changed guide paths into the scope CLI and confirm `paths`
lists all 82:
   ```bash
printf 'apps/docs/content/guides/ai/%s.mdx\n' {1..82} | pnpm -C e2e/docs
resolve-docs-scope
   ```
3. List the tests the workflow runs for 3 pages and confirm there are 4
(1 guard, 3 link) and none for accessibility:
   ```bash
cd e2e/docs && PLAYWRIGHT_BASE_URL=https://supabase.com
DOCS_E2E_PAGE_PATHS=/docs/guides/auth,/docs/guides/database/overview,/docs/guides/storage
pnpm exec playwright test --grep-invert @a11y --list
   ```
4. Run the link test on 4 pages that don't exist and confirm all 4 fail,
rather than the run stopping after 3:
   ```bash
cd e2e/docs && PLAYWRIGHT_BASE_URL=https://supabase.com
DOCS_E2E_PAGE_PATHS=/docs/guides/zz-nope-1,/docs/guides/zz-nope-2,/docs/guides/zz-nope-3,/docs/guides/zz-nope-4
pnpm exec playwright test --grep "loads and"
   ```
5. Check that this PR's Docs E2E job runs the "Run docs E2E harness unit
tests" step and that it passes.

Verified locally: unit tests, the scope CLI with 82 paths, the test list
above through the same `pnpm run e2e:docs --grep-invert @a11y` command
the workflow uses, and the 4-failure run.

Resolves
[DOCS-1749](https://linear.app/supabase/issue/DOCS-1749/warn-instead-of-silently-skipping-pages-in-docs-e2e-when-a-pr-exceeds)

## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 17:28:12 -07:00
Alexis Aguilar 1f3549570d chore(github): add docs review categories and blocked-PR callout to PR template (#54089)
## Problem

Docs PRs have no review timeline. Some get reviewed the same day, and
others sit for weeks with no expectation of when they'll be looked at.
PRs that depend on another PR also get marked ready for review and
reviewed before they can merge. Tracked in
[DOCS-1590](https://linear.app/supabase/issue/DOCS-1590), part of the
Docs PR Tracker
([DOCS-1689](https://linear.app/supabase/issue/DOCS-1689)).

## Solution

Two additions to the shared PR template:

- **Review category (docs PRs only).** Four checkboxes, each with its
deadline in business days from when the PR is marked ready for review:
Critical (1), Urgent (3), Moderate (5), and Low (10). The section says
it only applies to docs PRs from Supabase team members. PRs from forks
are always reviewed as Low.
- **Blocked-PR callout.** An HTML comment at the top of the template
tells authors to keep a blocked PR as a draft and start the description
with a `[!WARNING]` callout naming the PR it depends on. Because it's a
comment, it doesn't render on PRs that aren't blocked.

The checkbox labels are fixed (`- [x] Critical`, and so on) because a
later check reads them to find the category. Non-docs PRs can ignore the
section.

## Review instructions

1. Read the diff to `.github/pull_request_template.md`.
2. Open a test PR, or preview the template, and confirm the callout
comment doesn't render and the category section reads clearly.
3. Since the template is shared across the repo, confirm the "docs PRs
only" wording is clear enough for non-docs authors to skip it.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-30 15:01:54 -07:00
Jeremias Menichelli 132f6b6d08 test: Add minimal tests for redirects on apps/docs (#54071)
## Problem

We were lacking on redirect rules on apps/docs

## Solution

Added basic unit test for:
- Infinite redirects
- Redirect chains
- Missing redirects
- Invalid sources or destinations 

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

_Unit tests for redirects should run as part of our CI in PRs, including
this one._

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-30 18:07:34 +01:00
Mert YEREKAPAN fe8e912993 refactor(www): split redirects into static and dynamic files and add redirect checks (#54194)
## Problem

`apps/www/lib/redirects.js` was a single file with static and dynamic
rules mixed together, and the redirects had no automated checks. `/docs`
redirects already moved to `apps/docs/lib/redirects/`, so www was the
odd one out.

## Solution

I applied the docs layout to www without changing how redirects are
served:

- `apps/www/lib/redirects/static-redirects.json`: 220 one-to-one
entries, including fixed redirects to external `https://` URLs.
- `apps/www/lib/redirects/dynamic-redirects.js`: 14 entries with params,
splats, regex, escapes, or `has`.
- `apps/www/lib/redirects/index.js`: combines both (static first) for
`next.config.mjs` and `scripts/generateMdContent.mjs`.
- `apps/www/lib/redirects/redirects.test.ts`: checks for loops, chains,
duplicate sources, invalid sources and destinations (anchors, missing
`/` or `https://`), dynamic entries in the static file, and internal
destinations that do not exist.
- README for the folder, plus updates to `apps/www/README.md`,
`DEVELOPERS.md`, `CODEOWNERS`, and the `www-tests` path filter and
sparse checkout.

Bulk redirects are not part of this PR: www has 234 redirects, well
under the route limit, so they stay in `next.config.mjs`.

### Missing-destination check

Internal destinations are checked against the same sources the site
serves from:

- `app/` and `pages/` routes, and `public/` files.
- Blog, customer, event, and alternative slugs, derived the way
`lib/posts.tsx` derives them. Events with `disable_page_build` do not
count.
- Feature and `/go` page slugs.
- `.md` destinations must be a page that `generateMdContent.mjs`
publishes. An existing HTML page is not enough.
- `/docs/guides` destinations, against the docs content and guide
routes.

Other zones and build-generated files are not checked. A destination
with params is probed with one sample value, so value-specific loops or
chains are not caught. The README lists these limits.

### Behavior notes

- The rule set matches `master`, with one exception:
`/blog/2021/07/30/1-the-supabase-hackathon` now points at the canonical
slug `/blog/1-the-supabase-hackathon`. The old destination
`/blog/the-supabase-hackathon` also resolves today, because the blog
route matches posts by filename suffix. The check requires canonical
slugs.
- First-match results on `supabase.com` are identical on 241 probe
paths.
- Static entries now precede dynamic ones. On the `supabase.design`
host, 25 static sources that used to sit after its catch-all rule now
come before it. Those paths now take two hops to reach the design system
instead of one.
- Comments on static entries were dropped, because JSON has no comments.

## To test

1. Open the www preview and visit `/about`. It redirects to `/company`.
2. Visit `/buildersday`. It redirects to `/builderday`.
3. Visit `/sign-in`. It redirects to the dashboard sign-in page.
4. Visit `/blog/2021/07/30/1-the-supabase-hackathon`. It lands on the
hackathon post.

## Linear

- fixes GROWTH-1571
2026-11-30 15:52:59 +00:00
claude[bot]andClaude c4bbd65acb chore: add growth-eng as code owner on core telemetry senders (#54207)
<!-- claude-slack-attribution -->
_Requested by **Pam Chia** · [Slack
thread](https://supabase.slack.com/archives/C076KTY11DF/p1795791803872399)_

## Problem

**Before:** Growth Eng owns only the event catalog
(`packages/common/telemetry-constants.ts`). Changes to the PostHog
client (including the per-experiment `<experiment>_experiment_exposed`
events), the shared telemetry event sender and the telemetry standards
skill don't need a Growth Eng review. They can start new event streams
or sharply increase volume, and Growth Eng only sees the volume and cost
after they ship.

**After:** Growth Eng is a code owner on these core telemetry senders
and the telemetry standards skill, so GitHub requests a Growth Eng
review on these changes before merge.

## Solution

This PR changes only `.github/CODEOWNERS`. It adds three rules directly
under the existing `telemetry-constants.ts` line, which is unchanged. No
later rule matches any of these files, so Growth Eng is their owner.

- `/packages/common/posthog-client*` → `posthog-client.ts` and its test.
Sends `$pageview`, `$pageleave` and the `_experiment_exposed` events
directly to PostHog. Owner: growth-eng (no owner before).
- `/packages/common/telemetry-event*` → `telemetry-event.ts` and its
test. Builds every `/telemetry/event` request. Owner: growth-eng (no
owner before).
- `/.agents/skills/telemetry-standards/` → `SKILL.md`, the rules for
adding events. Owner: growth-eng (no owner before).

`GET
/repos/supabase/supabase/codeowners/errors?ref=growth/codeowners-telemetry-events`
returns no errors.

Not covered: individual `track(...)` and `sendTelemetryEvent(...)` call
sites in components, because CODEOWNERS works by path. New event names
still go through `telemetry-constants.ts`, which Growth Eng already
owns.

## Review instructions

1. Read the three rules under `telemetry-constants.ts` in
`.github/CODEOWNERS`.

## Checklist

Check all before review:

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_011aGhS9n5Vh49BK2WMq9h4Q

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-30 23:04:39 +08:00
Alexis Aguilar 6490f63e9b chore(codeowners): request a self-hosted review on self-hosted docs (DOCS-1805) (#54080)
## Problem

The self-hosted docs have an owner on the self-hosted team, but
`.github/CODEOWNERS` gives all of `/apps/docs/` to `@supabase/docs`
alone. A change to a self-hosted page doesn't request a review from the
people who own that content.
[#53996](https://github.com/supabase/supabase/pull/53996) merged that
way, and [#54013](https://github.com/supabase/supabase/pull/54013)
followed up on it.

Closes
[DOCS-1805](https://linear.app/supabase/issue/DOCS-1805/request-a-self-hosted-review-on-each-self-hosted-docs-pr)

## Solution

The self-hosted docs pages are owned by `@supabase/docs` and
`@supabase/self-hosted`, the team that already owns `/docker/`. Two
patterns cover them:

- `apps/docs/content/guides/self-hosting*`: the `self-hosting/` folder
and `self-hosting.mdx`
- `apps/docs/content/guides/**/*self-hosted*`: any guide whose file name
contains `self-hosted`, such as `grafana-self-hosted.mdx` and
`expose-self-hosted-queues.mdx`, in `.mdx` or `.md`

The last matching line in CODEOWNERS wins, so the new lines sit after
`/apps/docs/` and keep `@supabase/docs` as an owner. A PR that changes
one of these pages requests a review from both teams.

## Review instructions

1. Check that GitHub reports no CODEOWNERS errors: `gh api
"repos/supabase/supabase/codeowners/errors?ref=alexisa/DOCS-1805"`
returns `"errors": []`.
2. Check which files the two patterns match. They follow `.gitignore`
rules, so `git check-ignore` can list the matches:

   ```bash
printf
'/apps/docs/content/guides/self-hosting*\n/apps/docs/content/guides/**/*self-hosted*\n'
> /tmp/co.ign
git ls-files apps/docs | git -c core.excludesFile=/tmp/co.ign
check-ignore --no-index --stdin
   ```

The list has 25 files: the `self-hosting/` pages, `self-hosting.mdx`,
and the guides with `self-hosted` in the name.
3. After merge, open a PR that changes a self-hosted page, and check
that GitHub requests a review from `@supabase/self-hosted`.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide).
Doesn't apply: this PR changes only CODEOWNERS.
2026-11-25 14:32:23 -07:00
Alaister YoungandAlaister Young fcbdda8107 chore: migrate formatter from Prettier to oxfmt (#53835)
Migrate code formatting across the monorepo from Prettier to `oxfmt`
(`0.79.0`, pinned) for much faster formatting checks locally and in CI
while keeping code churn minimal (78 files total, 0.7% of the repo).

Studio's `@ianvs/prettier-plugin-sort-imports` ordering
(`<BUILTIN_MODULES>`, `<THIRD_PARTY_MODULES>`, blank line, then `@/` and
relative imports) is preserved via `oxfmt`'s native `sortImports`
override for `apps/studio/**/*.{js,jsx,ts,tsx}`.

### Performance (before vs after, uncached)

| Benchmark | Prettier (`3.8.x`) | oxfmt (`0.79.0`) | Speedup |
| --- | ---: | ---: | ---: |
| CI formatting step (`blacksmith-4vcpu-ubuntu-2404`, full repo) | `73s`
| **`7s`** | **~10×** |
| Local `apps/studio` JS/TS (`5,157` files) | `17.74s` | **`0.36s`** |
**~49×** |
| Local full monorepo (`11,131` files) | — | **`2.39s`** | — |

**Added:**

- `.oxfmtrc.jsonc` at repo root with Prettier-matching options,
`sortPackageJson: false`, the Studio `sortImports` override, and ignore
patterns migrated from `.prettierignore`
- `oxfmt` (`0.79.0` exact pin) in `pnpm-workspace.yaml` catalog and
workspace `devDependencies` / `dependencies`
- Shared `.agents/scripts/format_and_lint.sh` hook script and
`.agents/hooks.json` (used by both Claude Code and Antigravity)

**Changed:**

- Replaced `test:prettier` with `format:check` and switched `format` in
root `package.json` to `oxfmt`
- Updated `packages/api-types` (`codegen`,
`verify-production-types.mjs`), `apps/design-system` (`build:registry`),
`apps/docs` (`CodeSample.ts`, `generate-sitemap.ts`, `next.config.mjs`,
`spec/Makefile`), `apps/www` (`generate-sitemap.mjs`), and
`packages/build-icons` (`generateIconFiles.mjs`) from Prettier to
`oxfmt`
- Updated `.github/workflows/prettier.yml` (keeping the `format` job ID
intact), `.github/workflows/autofix_linters.yml`,
`.claude/settings.json`, `AGENTS.md`, `CONTRIBUTING.md`, and
`.github/copilot-instructions.md`
- Applied one-time `oxfmt` formatting pass in a separate commit (78
files: 30 `i18n/README.*.md` trailing spaces, 19 Studio files, 17 other
TS/TSX/generated types, 8 MD/MDX, 3 `package.json`, 2 example CSS files)

**Removed:**

- `prettier`, `@ianvs/prettier-plugin-sort-imports`, and
`prettier-plugin-sql-cst` from `devDependencies` (note: `.sql` files
were not part of the CI formatting glob; `eslint-config-prettier` is
kept for ESLint)
- `prettier.config.mjs`, `.prettierignore`, and
`.claude/scripts/format_and_lint.sh`

## To test

- Run `pnpm run format:check` and confirm it passes cleanly across all
matched files
- Run `pnpm --filter api-types test`, `pnpm --filter docs exec vitest
run features/directives/CodeSample.test.ts`, and `pnpm --filter www exec
vitest run generate-sitemap.test.ts`
- Edit an `apps/studio` file with out-of-order imports and run `pnpm run
format` to confirm builtin/third-party vs `@/`/relative grouping matches
prior behavior
- Check that the `Check Code Formatting` CI workflow passes on this PR

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-24 12:51:31 +08:00
Charis a9d1e91bb6 chore: remove slack notification for ratchet baselines reaching 0 (#53855)
## Problem

The weekly ESLint ratchet workflow posts a Slack message to
#team-frontend when a rule's baseline drops to 0. That follow-up is no
longer needed because this behavior is now built into Tedd.

## Solution

Remove the Slack notification step from
`.github/workflows/studio-lint-ratchet-decrease.yml`, along with the
step outputs that only existed to feed it:

- The `id: decrease-baselines` on the baseline update step.
- The `changed` and `pr_url` outputs written to `$GITHUB_OUTPUT`,
including the `changed=false` output in the no-op branch.
- The "Notify #team-frontend about rules that hit a zero baseline" step,
which computed zero-baseline rules from
`apps/studio/.github/eslint-rule-baselines.json` and posted to
`SLACK_DASHBOARD_WEBHOOK_URL`.

The baseline update and PR creation/comment logic is unchanged.

## Review instructions

1. Confirm the workflow still runs the "Decrease ESLint ratchet
baselines and open PR" step and that the no-change path still exits 0.
2. Confirm no remaining references to `steps.decrease-baselines` or
`SLACK_DASHBOARD_WEBHOOK_URL` in this workflow.

## Checklist

Check all before review:

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-23 12:18:53 +00:00
Alexis AguilarandClaude Opus 5.5 0fdee0e487 feat(docs): post docs PRs to team-docs-alerts when ready for review (#53636)
## Problem

Not every docs PR gets posted in #team-docs, so some never get noticed
by the docs team. Tracked in
[DOCS-1683](https://linear.app/supabase/issue/DOCS-1683), the first
stage of the docs PR review workflow project.

## Solution

A new workflow, `.github/workflows/docs-pr-alert.yml`, posts a one-line
message to #team-docs-alerts whenever a PR that changes `apps/docs/**`
becomes ready for review:

| What happens | Posts? |
| --- | --- |
| Opened as a draft | No |
| Draft marked ready for review | Yes |
| Opened as ready (not a draft) | Yes, when it's opened |
| Ready, then draft, then ready again | Yes, each time it's marked ready
|

The message links the PR title and says whether the PR is internal or
external (from a fork):

```
#00000 Add RLS examples to the auth guide · External
```

Key choices:

- **`pull_request_target`** so fork PRs can read the webhook secret. The
workflow only reads the event payload: it never checks out or runs PR
code, and has `permissions: {}`. It's added to the zizmor
`dangerous-triggers` allowlist alongside `external-pr-comment.yml` and
the other `pull_request_target` workflows.
- **Path filter instead of the `documentation` label**, because the
labeler adds the label in a separate run and it may not be there yet
when this runs.
- **Reuses the existing `SLACK_DOCS_WEBHOOK_URL` secret** from
`docs-master-alert.yml` (#53366), which already posts to
#team-docs-alerts. No new Slack app or secret is needed. The workflow
still skips quietly if the secret is missing.

## Review instructions

1. Read `.github/workflows/docs-pr-alert.yml` and confirm it never
checks out or executes PR code.
2. Confirm the `zizmor.yml` change only adds this workflow to the
allowlist.

Checked locally with actionlint, zizmor 1.26.1 (same config as CI), and
Prettier.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 21:04:47 +00:00
Drew McLellan 773b4f767c fix(common): skip the reduced-motion query when matchMedia is missing (#53613)
## Problem

`Marketing site tests / build` fails on PRs that touch www, with
`window.matchMedia is not a function` in `lib/sentry-capture.test.tsx`.

`packages/common/helpers.ts` calls `window.matchMedia` when it is
imported. jsdom does not implement it. #53294 made
`common/consent-state` import `posthog-client`, which reaches
`helpers.ts` through `telemetry-utils`. The www `sentry-browser` test
project runs in jsdom without a `matchMedia` stub, so it now crashes on
import.

The break went unnoticed on `master` because the www workflow only runs
on pull requests, and its path filter listed just two files in
`packages/common`.

This is the same problem several other places already work around:
`consent-state.ts` duplicates `ensurePlatformSuffix` to avoid the
import, and the `packages/common` and `kb` tests stub
`window.matchMedia` before importing.

## Solution

- Guard the call in `helpers.ts` with `typeof window.matchMedia ===
'function'`, so `useReducedMotion` returns `false` where the API is
missing. Browsers are unaffected.
- Add `packages/common/helpers.test.ts`. It imports `helpers` and
`consent-state` in jsdom without `matchMedia`, and checks that the query
is still read where it exists. Both import tests fail on `master` with
this error.
- Run the Marketing site tests on changes to `packages/common/**/*.ts*`
and its `package.json`, since www imports it widely. This part is
independent of the fix and can be split out if you prefer.

The `helpers.ts` change is identical to the one in #53589, so the two
merge cleanly whichever lands first. This earlier attempt, #53596, was
closed.

Not changed: the per-test `matchMedia` stubs. They're harmless, and can
be removed as a follow-up.

## Review instructions

1. From `packages/common`, run `pnpm exec vitest run helpers.test.ts`
and check that all 3 tests pass.
2. Run `git checkout origin/master -- packages/common/helpers.ts` and
run it again. Two tests should fail with `window.matchMedia is not a
function`. Then run `git checkout HEAD -- packages/common/helpers.ts`.
3. Check that `Marketing site tests / build` passes on this PR and ran
because of the `packages/common` path.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill (not applicable)
2026-11-18 14:30:07 +00:00
Jeremias Menichelli 26d0aa5ec3 test: fix smoke tests by adding examples to sparse checkout (#53593)
## Problem
Our docs smoke tests have been failing for months 😒 

## Solution

Include examples directory on smoke tests to prevent them form failing.

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

_Pray for the CI gods_

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-18 11:03:29 +01:00
Andrey A. cf37022b6b fix(self-hosted): sandbox Storage, REST and Functions responses at the API gateway (#53466) 2026-11-17 12:07:23 +01:00
Alaister YoungandAlaister Young d2eb58a0e7 [FE-3106] (part 3) – refactor(studio): move account and top-level page bodies (#53212)
Moves the account and top-level app page bodies (`/account/*`,
`/organizations`, `/new`, `/new/$slug`, `/join`, `/claim-project`,
`/aws-marketplace-onboarding`, `/stripe-atlas-application`,
`/support/new`, `/support/link`, `/integrations/github|vercel/*`) from
`pages/**` into their TanStack route files and deletes the pages. Part
of the final pass of the TanStack migration (FE-3106). Part 3 of the
stack, and the first page-move PR.

**Depends on:** #53202

**Changed:**
- `routes/_app/account/**`,
`routes/_app/{organizations,new/index,support/*}.tsx`,
`routes/{new/$slug,join,claim-project,aws-marketplace-onboarding,stripe-atlas-application}.tsx`,
`routes/integrations/**` – page bodies inlined.
`next/router`/`next/link`/`next/head` → `useNavigate`, `Link`,
`<Navigate>` and inline `<title>`. `getLayout` dropped; every old
`getLayout` was checked against the route tree and matches
- `routes/aws-marketplace-onboarding.tsx` – reads `buyer_id` through
`validateSearch` + `Route.useSearch()`
- `tests/lib/route-render.tsx` – new `renderRoute(Route, { routeId, url
})` helper that mounts a file route in a memory router (with the app's
search serializers) so route components can be tested; used by the moved
tests
- `tests/lib/route-mock.ts` – the `next/router` mock now derives its
dynamic-route patterns from `routes/**` instead of globbing `pages/**`,
so tests keep parsing params as pages disappear
- `tests/routes/**` – page tests moved from `tests/pages/**` and
rendered through the route
- `.github/CODEOWNERS` – `pages/new/index.tsx` owner moved to
`routes/_app/new/index.tsx`

**Removed:**
- 19 files under `pages/account/**`, `pages/new/**`,
`pages/support/{new,link}.tsx`, `pages/integrations/**` and the
top-level pages listed above

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

## To test

- Open `/account/me`, `/account/security`, `/account/tokens`,
`/account/audit` – same Account layout, header title and sidebar as
before
- Open an old email-change link (`/account/me#message=...`) – lands on
`/account/security` with the hash
- `/account/tokens/scoped` – redirects to `/account/tokens`
- `/organizations` and `/new/<org>` – render with the same layout; "New
organization" links work
- Vercel install/marketplace flows – navigation keeps `?…` params

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-17 14:46:37 +09:00
Jeremias MenichelliandAli Waseem bd138001cc chore: Add slack alert workflows for docs team (#53366)
## Problem

We have accumulated several additions to workflows in GitHub Actions,
but we are not notified when they failed.

## Solution

This PR adds two files to notify Docs-related and KB-related failures in
our Slack team alerts channel.

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

/////

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

---------

Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-11-16 15:41:40 +01:00
anthony lio d7308d776c ci(kb): run the shadcn lint ratchet on kb (#51584)
## Problem

kb has no eslint config and no `lint` script, so the shadcn tailwind
rules that already check www, docs, design-system, ui-library and learn
never run on it

## Solution

- moved the `supabase/shadcn` block out of
`eslint-config-supabase/next.js` into its own
`eslint-config-supabase/shadcn.js` + `next.js` imports it, so the rules
and settings stay in one file
- added `apps/kb/eslint.config.cjs` + `lint` and `lint:ratchet` scripts
- `.astro` files get linted too, not just `.ts`/`.tsx`
- added kb to `lint-ratchet.yml` and `lint-ratchet-decrease.yml`

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

1. run `pnpm --filter ./apps/kb run lint` and check for 5 warnings, all
in `.astro` files
2. run `pnpm --filter ./apps/kb run lint:ratchet` and check it prints
`Stable: No regressions for selected rules.`
3. add `className="p-[13px] bg-[#fff] foo-bar"` to any kb `.tsx`
component and rerun step 3. it should fail with 3 new warnings

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-13 19:26:38 +02:00
Alaister YoungandAlaister Young 1854331fb6 [FE-3106] (part 2) – refactor(studio): move api handlers into route files (#53202)
Moves every `pages/api/**` handler into its TanStack server route under
`routes/api/**` and deletes `pages/api/**`, part of the final pass of
the TanStack Start migration (FE-3106). Handlers move verbatim and still
run through `toWebHandler`, so auth (`apiWrapper`), response shapes and
headers are unchanged. Part 2 of the stack.

**Depends on:** #53199

**Changed:**
- `routes/api/**` – each route now holds its handler (formerly the
`pages/api` default export) as a local `nextHandler`/named function.
Next-only `config`/`maxDuration` exports are dropped: `vite.config.ts`
already sets the function `maxDuration`, and `toWebHandler` parses
bodies itself
- `routes/api/ai/docs.ts` – Web-native handler inlined, `NextRequest` →
`Request`
- `lib/api/apiHelpers.ts` – `getPgMetaRedirectUrl` moved here from the
old `tables` handler, which the other pg-meta routes imported it from
- `eslint.config.cjs`, `.github/CODEOWNERS` – `pages/api` paths →
`routes/api`
- `tests/routes/api/**`, `lib/api/{generate-v4,rate}.test.ts`,
`scripts/__tests__/server-source-maps.test.ts` – call the route's
registered handler with a Web `Request` (`tests/lib/server-route.ts`);
the MCP query-validation cases now run against the native route

**Removed:**
- `pages/api/**` (102 files), including the Next twins of the
already-native `routes/api/mcp/index.ts` and `functions/$slug/body.ts`
- unused `ProjectSettings` types and the `node-mocks-http` dev
dependency

Parity: every route registers the same methods its handler serves. The
exceptions are `check-cname`, `get-ip-address`, `get-utc-time`,
`get-s3-keys`, `get-deployment-commit`, `cli-release-version` and
`connect`: in Next they answered any method, and their routes register
`GET` only, as before this PR.

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

## To test

- Load the table editor, SQL editor and Auth users on a self-hosted
build – `/api/platform/**` and `/api/v1/**` respond as before
- Use the Assistant and the docs search – `/api/ai/**` streams as before
- `GET /api/get-deployment-commit` – same JSON and `Cache-Control`

Ran typecheck, ESLint, lint ratchet, knip, Prettier, the TanStack build
and the full Studio vitest suite: all pass except
`lib/server/configcat.test.ts`, which also fails on `master` in an
environment with ConfigCat env vars set. Self-hosted E2E is CI-only.

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-11 22:24:43 +09:00
Alaister YoungandAlaister Young 200cc3f65d [FE-3106] (part 1) – ci(studio): build and test tanstack start only (#53199)
First part of the FE-3106 cleanup (final pass of the TanStack Start
migration): Studio now builds, runs and tests TanStack Start only.
Retiring the Next build first is what lets the follow-up PRs in this
stack delete `pages/**` files without breaking a still-built Next
runtime, the Next E2E shard or Next previews. Part 1 of the stack, based
on `master`.

**Changed:**
- `apps/studio/package.json` – `dev`/`build`/`start` run the Vite/Nitro
build directly (the former `*:tanstack` scripts)
- `apps/studio/vercel.ts` – always emits the TanStack Start config
(`framework: null`, redirects, headers); no `STUDIO_FRAMEWORK` gate, so
every Vercel project building Studio deploys the Nitro output
- `apps/studio/Dockerfile` – single TanStack `build` stage; the image no
longer defaults to Next
- `.github/workflows/studio-e2e-test.yml` – one E2E run (2 shards)
instead of a `next`/`tanstack` matrix; drops the `.next` cache step
- `.github/workflows/studio-docker-build.yml` – one image build
- `apps/studio/turbo.jsonc` – drops `STUDIO_FRAMEWORK` and the `.next`
outputs
- `apps/studio/AGENTS.md`, `apps/studio/TANSTACK_MIGRATION.md` –
describe the TanStack-only runtime

**Removed:**
- `dev:next`/`build:next`/`start:next` scripts, `scripts/dispatch.js`,
`scripts/lib/env.js`, the Turbopack cache `predev` script, and the root
`build:studio:docker:tanstack` script

Addresses
[FE-3106](https://linear.app/supabase/issue/FE-3106/move-page-bodies-into-route-files-and-delete-pages).

Before merging: branch protection lists `E2E tests (next, 1, 2)`/`(next,
2, 2)` and `E2E tests (tanstack, 1, 2)`/`(tanstack, 2, 2)` as required
checks. The jobs are now `E2E tests (1, 2)`/`(2, 2)`, so the required
checks need updating. Any Vercel project or self-hosted image still on
Next switches to TanStack Start with this PR.

## To test

- `pnpm dev:studio` without `STUDIO_FRAMEWORK` set – Vite dev server
starts on :8082
- `pnpm build --filter=studio` – Vite/Nitro build succeeds, no `.next`
output
- Vercel previews (`studio`, `studio-self-hosted`, `studio-staging`) –
build and serve the TanStack app
- `Studio Docker Build` and E2E checks – pass with the single TanStack
run

Ran `vercel.test.ts`, studio typecheck, knip, ESLint on changed files,
Prettier and the TanStack build locally. Docker and E2E are verified by
CI only.

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-11 06:04:46 +00:00
Alaister YoungandAlaister Young 6236fa4ec5 chore: remove the Cloudflare R2 asset upload and asset CDN (#53148)
Removes the dead Cloudflare R2 asset upload and asset CDN code from
Studio, docs and www. Every app now behaves as it did with
`FORCE_ASSET_CDN=-1`: Vercel serves assets from the default path.

Also fixes `.github/workflows/zizmor.yml` to download zizmor with `gh
release download`: `curl -sSLO` saved GitHub error pages as the archive,
which broke the attestation check.

> [!WARNING]
> Remove `FORCE_ASSET_CDN` from Vercel only after this deploys.

**Worth a close look**
- `apps/studio/vite.config.ts`: `SKIP_ASSET_UPLOAD` is kept because it
still gates Sentry source map upload.
- `apps/studio/turbo.jsonc`: `AWS_ACCESS_KEY_ID` /
`AWS_SECRET_ACCESS_KEY` are kept because the Bedrock credential chain
(`lib/ai/bedrock.ts`) can fall back to them.

## To test
- [ ] On the Vercel previews for studio, docs and www, open a page with
DevTools: JS, CSS and fonts load from the app's own origin
(`/dashboard/assets/…` or `/dashboard/_vercel/immutable/…` for Studio,
`/docs/_next/static/…` for docs, `/_next/static/…` for www), with no
404s or CSP errors in the console.

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-10 18:21:33 +09:00
Sean Oliver f0f2b57939 test(telemetry): cover every ad click id in first-touch attribution (#51774)
## Problem

The ad click ids we send to PostHog for first-touch attribution have no
direct tests. A typo in a param name (say `getParam('opref')`) would
silently drop that click id and CI would stay green. Also, nothing in CI
ran `packages/common` tests at all, apart from `sentry.test.ts`.
GROWTH-1326.

## Solution

- First-touch click ids are now one exported list,
`FIRST_TOUCH_CLICK_ID_KEYS`, instead of 11 hand-written `getParam`
lines. Same ids, same output.
- New `telemetry.test.ts` checks that list equals `CLICK_ID_KEYS` plus
`bfcid`, and that every id in it comes back from
`getFirstTouchAttributionProps`.
- `first-referrer-cookie.test.ts` checks `buildFirstReferrerData`
extracts every `CLICK_ID_KEYS` entry, and that `bfcid` stays out of that
pre-consent list.
- Added a `test` script to `packages/common` and a `pnpm --filter common
test` step to `library-tests.yml`, which already triggers on
`packages/common/**`.

## Review instructions

1. Check the Library checks job runs the common tests (13 files).
2. Add a made-up id to `FIRST_TOUCH_CLICK_ID_KEYS` only, then run `pnpm
--filter common test`. It fails.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-09 09:37:28 -08:00
Kody Jackson 8eb64b767f chore(docs) - open humans.txt to any github org member (#53047)
## Problem

Docs team shouldn't be the only one who can approve `humans.txt`

## Solution

Adds a line without a dedicated codeowner, which opens it up to anyone
with write access to the org.
2026-11-05 11:41:28 -06:00
Kody Jackson cc78424932 chore(www,docs,kb) - remove tracked sitemaps (#53036)
## Problem

Moved to another repo
2026-11-05 09:20:15 -06:00
Matt Rossman 1f75a630c2 fix: update Ask AI model (#52736)
OpenAI is retiring the pinned GPT-4o mini snapshot on January 14, 2027,
but "Ask AI" on our site(s) still uses it.

This PR replaces it with GPT-6 Luna at low reasoning, which is a
similarly cost effective model. Its completion budget is increased to
allow room for reasoning, while the total cap preserves the previous
input allowance.

I noticed the `packages/ai-commands` where this was defined also
includes dead code from older versions of SQL and cron helpers, so this
also removes them for housekeeping.

I also upgraded the OpenAI SDK to support types for the new model.

To test, try asking a question in "Ask AI" in the docs
[preview](https://github.com/supabase/supabase/pull/52736#issuecomment-6618563374)
build:

<img width="568" height="583" alt="CleanShot 2026-11-03 at 7 22 29
PM@2x"
src="https://github.com/user-attachments/assets/fe8f824f-3884-44b8-affd-5710343e0101"
/>

Note the "Rename with Supabase AI" feature doesn't work but that's an
existing issue not related to this PR:
https://github.com/supabase/supabase/issues/51438

**References**

- https://developers.openai.com/api/docs/deprecations
- https://developers.openai.com/api/docs/models/gpt-6-luna

Closes AI-1397
2026-11-05 09:32:28 -05:00
Andrey A. 9dfece25cc fix(self-hosted): leave CORS on /functions/v1 to the function (#52709) 2026-11-04 12:35:08 +01:00
Jeremias Menichelli 30833db87e chore: Refactor sync troubleshooting scripts after data reconciliation (#52713)
## Problem

We solved manually some `troubleshooting_entries` table missing data and
mismatches.

- **Rows without slugs.** Some `troubleshooting_entries` rows had no
slug, so no guide could match them and the guides looked "new".
- **Duplicate discussions.** A guide that didn't match its row got a
fresh GitHub discussion, leaving the original behind (sometimes with
extras).
- **Slug mismatch.** The fetch stripped the hash suffix from file names
while the table keeps it, so those guides never matched their rows.
- **Overlapping runs.** The workflow had no concurrency control, so two
runs could both create a discussion for the same guide, and `upsert`
silently overwrote the first run's row.
- **Missing checksums.** Rows without a checksum counted as "changed"
and were re-pushed to GitHub on every run.
- **Weak dry run.** `--dry-run` only printed slugs, so it was hard to
see what a run would actually do.
- **Fragile lookup and duplicated code.** Rows were fetched with every
slug in the URL (`.in('slug', …)`), and both scripts carried their own
copy of the guide reader and checksum.

## Solution

After those steps we applied successfully to the database, we revamp our
existing sync scripts to allow dry runs to make sure the changes we
apply are going to generate the correct impact.

A new improvement to prevent bulk discussion errors on GitHub API.

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions
_Sadly, we need to merge, and pray..._

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-11-04 10:24:19 +01:00
Jordi Enric ca6f972adb chore(codeowners): route legal reviews to frontend FE-4883 (#52688)
## Problem

Legal-only website changes request marketing review because they inherit
the `/apps/www/` code-owner rule.

## Fix

Assign legal content, page entry points, document assets, and dedicated
legal components and helpers to `@supabase/frontend`. Keep marketing
ownership for the rest of the website.

Closes
https://linear.app/supabase/issue/FE-4883/route-legal-document-code-owner-reviews-to-frontend

## How to test

- Confirm the legal overrides follow the broad website rule and name
only `@supabase/frontend`.
- Confirm ordinary website and blog paths still resolve to marketing.
- `git diff --check` passes. Prettier with `--ignore-unknown` passes;
CODEOWNERS has no supported Prettier parser.
- Runtime tests, typechecking, and browser QA do not apply to this
ownership-only configuration change.
2026-11-03 16:01:51 +01:00
Miranda Limonczenko aec7aed134 ci(docs): fail PRs that remove a linked guide section (#52100)
Closes DOCS-1486

## Problem

Agents are slow to update what they remember about the docs, and nothing
protects a section when it moves to another page.

This leaves a trail when sections move: the PR fails unless the heading
stays with a summary and a link to where the content went.

## Solution

A new `Docs removed anchors` workflow runs `pnpm check:removed-anchors`
from `apps/docs`.

- **What it compares:** H2 and H3 anchors between the base branch and
the PR, only on changed guide pages and pages that include a changed
partial. Partials are expanded, nested ones too.
- **When it fails:** a file anywhere in `apps`, `packages`, or
`examples` still links to a removed anchor. That covers docs content,
Studio, www and the blog, and kb, plus same-page `#anchor` links. Test
files and generated output are skipped. The failure names each anchor
and every linking `file:line`, and annotates those lines.
- **How anchors are computed:** with `getAnchor` from `packages/ui`, the
same function that sets rendered heading ids, so `## Title [#custom-id]`
matches on the custom id.
- **Bypass:** the `skip-anchor-check` label turns the errors into
warnings and passes the check. The failure message names the label and
the fixes.
- **No `paths` filter:** a required check whose workflow never starts
leaves unrelated PRs waiting. The job runs on every PR and exits before
installing anything when docs content is unchanged.

Out of scope: deleted or moved pages, and links from outside this repo.

The workflow checks out text files across `apps`, `packages`, and
`examples`, and skips images and video, so the search doesn't download
them.

The check only blocks merges once it's a required status check on
`master`. That needs a repo admin.

## Skip the check

For a deliberate removal:

1. Add the `skip-anchor-check` label to the PR.
2. The check re-runs and passes. The links it would have failed on show
as warnings.

Remove the label to turn the check back on.

## Manual testing

1. From `apps/docs`, delete `[#leaked-key]` from the heading in
`content/guides/getting-started/api-keys.mdx`.
2. Run `pnpm check:removed-anchors`. It exits 1 and names
`troubleshooting/rotating-anon-service-and-jwt-secrets-1Jq6yd.mdx:39`.
3. Run `PR_LABELS='["skip-anchor-check"]' pnpm check:removed-anchors`.
It prints the same report and exits 0.
4. Run `pnpm vitest run scripts/check-removed-anchors.test.ts`. All
tests pass.
2026-10-29 14:23:13 -07:00
Colum Ferry f55ee1dc5a chore(www): serve the CLI config schemas under /schemas (#52509)
## Problem

The Supabase CLI's config, project-config and `supabase.lock` JSON
schemas declare `$id`s under
`https://supabase.com/schemas/<name>/v<N>.json`, and editors such as
Even Better TOML fetch them from the `$schema` URL. Nothing is served at
that path yet, so those URLs 404.

## Solution

- Adds `apps/www/public/schemas` with v1 of the three schemas. They're
generated in supabase/cli, and from now on its stable releases open a PR
here when one changes (supabase/cli#7397)
- `/schemas/:path*` responses send `access-control-allow-origin: *` and
`cache-control: public, max-age=3600`, so browser-based editors and
validators can fetch them and a new release shows up within the hour.
Covered in `next.config.test.ts`
- `/apps/www/public/schemas/ @supabase/cli` in CODEOWNERS, so the CLI
team reviews those release PRs
- The folder is in `.prettierignore`. The CLI publishes these files byte
for byte, so reformatting them here would show up as a change on every
release

## Review instructions

1. Open `/schemas/config/v1.json` on the www preview
2. Check it returns the schema as JSON, with
`access-control-allow-origin: *` and the cache header (`curl -sI
<preview>/schemas/config/v1.json`)

Closes CLI-2865
2026-10-29 16:15:16 +00:00
Jeremias Menichelli 9b1ddcab93 chore: Remove old search code and add contributing documentation plus local dev flow (#52487)
## Problem

We decided to keep the search_v2 experiment.

## Solution

Delete all files related to the variant experimentation, old components
and ingest flow.

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

1. Open the docs preview
2. Search V2 should be the default search

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-29 16:02:35 +01:00
Miranda Limonczenko ee8cc9cff1 test(docs): fail navigation levels with 10 or more items (#52190)
Closes DOCS-1462

## Problem

A navigation level with many items is hard to scan. Today, 18 levels in
the docs navigation have 10 or more items, such as Platform > Platform
Configuration. Nothing stops a PR from adding more.

## Solution

- **Level size check:** `NavigationMenu.levels.nav-check.test.ts` walks
the top nav and every sidebar. A level with 10 or more items fails the
test, which names the level.
- **Allowlist:** starts with today's 18 levels, so CI is green on merge.
A level that drops below 10 items also fails until you remove it from
the list.
- **Option 1:** the check runs on the flagged navigation from #52049
too, with its own allowlist.
- **Navigation checks workflow:** `docs-navigation-checks.yml` runs
every test named `*.nav-check.test.ts`, only when the navigation config
or a check changes. The general docs test job skips these tests. A later
navigation guard only needs that file name.

## Manual testing

1. Run `pnpm --prefix="apps/docs" run test:nav-checks`. Both tests pass.
2. In `NavigationMenu.constants.ts`, add five items to Security >
Product security, and run the command again. Both tests fail and list
`Security > Product security`.
2026-10-28 08:47:54 -07:00
Kody Jackson 051d5f79da chore(docs) - remove troubleshooting guides and rendering logic (#52339)
## Problem

Dupe content and workflows when this content now all lives in the KB.

## Solution

Removes various artifacts from the docs repo (content files, github
workflows, etc.) from the docs app.

These paths have already been redirected to /kb in #52095 and we haven't
seen any meaningful 404 traffic indicating the redirects were done
incorrectly.

## Preview links

TBD
2026-10-27 12:32:33 -05:00
Jeremias Menichelli 94e0e1e7d2 chore: Move ingest to new table while pointing the search_v2 fn to the experiment one (#52370)
## Problem

Currently we experience a lot of empty results responses from our new
search_v2 experiment.

We are improving our search logic on our frontend plus our search
functions in the backend ot fix this.

## Solution

Improve our search setup to follow this path:
1. Same as before, strict full text search.
1. If that returns zero results, we do prefixes via wild cards, ie:
"edge fun" becomes "edge fun|*" so people don't have to type the full
term.
1. If that returns zero results, then we run the terms under OR, which
will give partial results for individual terms.
1. If that returns zero results then we are most probably under a
typo/misspelling scenario, then we use `pg_trgm` extension with a `0.4`
tier to return the closest bit, which is good cause it covers missing
first letters like "dge functions" too.

We will do this migration in three steps to not disrupt current users
under the experiments, I will be posting the PRs here:

1. First, we will create a new search_v2 table on `supabase.com [LIVE]`
project where production parts of our monorepo go + already implement
the improvements I just mentioned.
1. Re-route the ingest script to populate once per day the database
table in this new project. At this point we will have the data and the
search function ready. 👈 **this PR is here**
1. Update the API search_v2 function to query from this new project, so
users will experience no down time.

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

_Make sure ingest runs correctly after merge._

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-27 14:56:35 +01:00
Joshen Lim 60b51d74d5 Audit existing unit tests + Remove redundant ones (#52215)
## Context

_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_

We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.

## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail 
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files 
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
2026-10-23 18:51:27 +08:00
Ali Waseem 99fd573d1a feat(kb): add unit test CI, search API tests, and Playwright smoke tests (#52151)
kb's unit tests weren't run in CI and there were no functional tests.
Adds a CI job for kb unit tests, unit tests for the search API, and a
bare-bones Playwright suite (`e2e/kb`) that runs against the kb Vercel
preview on PRs and against production daily.

Fixes DOCS-1506
2026-10-22 09:14:16 -06:00
Charis 6cde55ae3c feat(api-types): generate fga-requirements.ts from OpenAPI specs (#52093)
## What

Generates `packages/api-types/types/fga-requirements.ts`, a map from
`'METHOD /path'` to the FGA permission groups that endpoint requires,
from the `x-fga-permissions` annotations in the v1, v2, and platform
OpenAPI specs. Groups are OR-of-AND (a caller needs every permission in
at least one group) and are preserved verbatim. Keys are the path
literals passed to openapi-fetch, so later work can type-check
permission grants against fetch calls.

- `codegen:prod` and the production drift check
(`verify-production-types`) now generate and compare the new file.
- Local `codegen` also generates it, from the local API
(`LOCAL_API_URL`, defaults to `http://localhost:8080`).
- Permission IDs are validated against the platform spec's
`CreateScopedAccessTokenBody.permissions` enum. Generation fails on
malformed annotations, empty groups, unknown IDs, or an endpoint
annotated in two specs. An empty annotation (`[]`) is treated as ungated
and omitted.
- The drift-check workflow now also runs when
`packages/api-types/scripts/` changes, so generator changes without
regenerated output are caught.
- Exported from `api-types` as `fgaRequirements`, with `FgaRequirements`
and `FgaGuardedEndpoint` types.

No Studio changes.

## Testing

- `pnpm --filter=api-types test`
- `pnpm --filter=api-types codegen:prod` regenerates the committed file
with no diff.

Resolves FE-4686
2026-10-21 14:17:02 -04:00
Kody Jackson 9b4a47c6dc chore(kb) - update codeowners for KB (#51951)
## Problem

Have a new, more targeted group for KB approvals

## Solution

Updates codeowners to reflect

```
/apps/kb/ @supabase/knowledgebase
```
2026-10-21 11:37:54 -05:00
Kody Jackson 4c4471d264 chore(www,kb,docs) - convert sitemap URLs to JSON to reduce noise (#52082)
## Problem

After running the pattern introduced in #51963 (output in #52079), can
already see that this is far too noisy.

## Solution

Moves generation to JSON as opposed to XML
2026-10-21 08:32:20 -05:00
Kody Jackson 97676a8801 feat(www,docs,kb) - start tracking sitemap URLs in git (#51963)
## Problem

It's actually _surprisingly_ hard to track URL changes over time b/c
sitemaps aren't versioned. It's meant to be a flat source of truth for a
specific point in time.

This causes issues when trying to get the following information:
- What URLs have changed? And which URLs have changed over a specific
period of time?
- Do those URLs require updates to other places? Or redirects?

## Solution

Adds in the first commit of tracked sitemaps, as well as a GitHub action
to automate this process monthly.

So long as we can track what's changed between 2 points in time -- this
way through a git diff -- we can pretty easily then set up automation to
flag needed link updates or redirects across other properties
(`/changelog`, `/blog`, `/docs`, `/kb`).

Added benefit is we already have redirects versioned and tracked, so we
can combine these sources of data together.

## Review instructions

The git diff here is _much_ larger than the functional diff, b/c this PR
contains the initial commit of the sitemaps.

The functional diff is in `.github/workflows/refresh-sitemaps.yml` and
`scripts/refresh-sitemaps.sh`, which is a GitHub action to run a small
`pull and download sitemaps and PR them up` periodically.
2026-10-21 08:08:23 -05:00
Ali WaseemandJeremias Menichelli 20e304a377 feat(kb): add search ingestion and edge function (#51843)
## Problem

We need embeddings for Kb to run a search endpoint in the Content API
and future KB search.

## Solution

This PR adds KB search backed by its own Supabase table, ingested from
the KB markdown export, and aligns the KB and docs search ingest setups.

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Test

1. Run the **KB Search Ingest** workflow, or locally run `pnpm --filter
kb search:ingest` with `SUPABASE_URL` and `SUPABASE_SERVICE_ROLE_KEY`
set in `apps/kb/.env.local`.
2. Query the endpoint and check that the results link to
`https://supabase.com/kb/troubleshooting/...`:
   ```
   curl '<kb-url>/kb/api/search?q=connect%20timeout&limit=5'
   ```

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

---------

Co-authored-by: Jeremias Menichelli <jmenichelli@gmail.com>
2026-10-21 11:24:52 +02:00
Alaister YoungandCursor Agent 5c7638f08b ci(studio-e2e): reserve supabase ports from the ephemeral range (#51944)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
About a quarter of failed self-hosted Studio E2E runs in the last two
weeks die at "Start supabase" (`supabase start --exclude studio,mailpit
--workdir ./e2e/studio`) with `address already in use` binding
`0.0.0.0:54322`, in a single shard, on both next and tanstack. The local
ports in `e2e/studio/supabase/config.toml` sit inside Linux's ephemeral
range, so an outbound connection during the image pull can take 54322;
`ss -tlnp` only lists listeners, which is why diagnostics reported the
port free. This reserves `54320-54329` before installs and image pulls,
keeping any ports already reserved, and snapshots sockets on that range
when `supabase start` fails. Follows up the diagnostics from #45637 and
#46607.

**Changed:**
- `.github/workflows/studio-e2e-test.yml` – append `54320-54329` to
`net.ipv4.ip_local_reserved_ports` before dependency install, Playwright
install, and image pulls, so an outbound connect cannot occupy them and
any ports the runner already reserved stay reserved.
- `.github/workflows/studio-e2e-test.yml` – when `supabase start` fails,
snapshot TCP sockets on `54320-54329` immediately, before the build
finishes and a short-lived socket from the image pull is gone.
- `.github/workflows/studio-e2e-test.yml` – pre-start diagnostics print
the ephemeral port range and sockets on `54320-54329`; failure
diagnostics use the same filter and group the last 300 log lines per
container.

## To test
- [x] "Reserve Supabase local ports" step prints `54320-54329` on every
E2E shard
- [x] All Studio E2E shards pass on next and tanstack
- [ ] (on a future failure) the Start supabase step lists any socket on
54320-54329

<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-e6e0ed7f-4b63-547e-aa51-ae1b4588d445?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-e6e0ed7f-4b63-547e-aa51-ae1b4588d445&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-10-19 17:27:04 +02:00
2b7f5ace51 chore(ci): run independent workflow steps in parallel (#51398)
Uses GitHub Actions' new [parallel / background
steps](https://github.blog/changelog/2026-06-25-actions-steps-can-now-be-run-in-parallel/)
to overlap independent CI steps. It works on Blacksmith runners, and
zizmor accepts the new keys.

**Changed:**
- **Studio E2E:** Chromium install, `supabase start` and the Studio
build now run concurrently. The build only inlines `NEXT_PUBLIC_*` vars,
and the only one that comes from `supabase status` is the API URL, which
`e2e/studio/supabase/config.toml` fixes. So the build runs against that
URL, and the real runtime env is written once supabase is up. A `diff`
fails the job if the inlined values don't match the real ones.
- **Docs and www E2E:** deps and Chromium install while the Vercel
preview poll runs in the background, instead of after it.
- **Typecheck:** typecheck and lint run side by side on a 4 vCPU runner
(up from 2), so a typecheck failure no longer hides lint errors.
- **Docs tests:** the three prep steps run as a parallel group, and the
workflow is added to its own `paths` filter so edits to it get
validated.

**Timings:** the baseline is the 10 most recent successful PR runs.
"After" comes from this PR's runs, so the sample is small.

| Workflow | Measured | Before (median) | After | Change |
|---|---|---|---|---|
| Studio E2E, next | setup (deps installed → tests start) | 162s | 112s,
138s | −23% |
| Studio E2E, tanstack | setup (deps installed → tests start) | 110s |
59s, 66s | −43% |
| Typecheck | job total | 168s | 68s, 110s | −47% |
| Docs / www E2E | deps + Chromium | 20s / 30s | hidden behind the
preview wait | ~6–7% of the job |
| Docs tests | prep steps | ~4s | ~2s | negligible |

On Studio E2E that's about 40–50s off each of the 4 shards. Whole-job
totals are dominated by how long the Playwright run takes (±100s between
runs), so the setup segment is the fair comparison. Typecheck numbers
depend heavily on turbo cache hits, so treat them as directional.

## To test

- [x] All Studio E2E shards pass on both frameworks, including the
`NEXT_PUBLIC_*` env `diff` check
- [x] Docs and www E2E go through the background wait. A temporary
commit touching a docs page and a www page (now dropped) showed installs
finishing during the wait, and `Resolve base URL` picked up the
deployment output after the `wait`. The docs E2E failure on that run
came from a11y violations on the probe page, not from this change
- [x] Typecheck log shows both steps starting together ("Waiting for
background step(s) to complete: Run TypeScript type check, Run Lint")
- [x] Docs tests pass with the parallel prep group
- [ ] After merge, check that the first Studio E2E runs on master stay
green

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: Ali Waseem <waseema393@gmail.com>
2026-10-19 12:36:31 +02:00
Jeremias Menichelli e4bf448352 chore: Rotate GH app env vars name (#51627) 2026-10-13 18:40:34 -03:00
supabase-vercel-tedd[bot] 78eb416b03 chore: remove marketing as KB codeowner (#51622)
## Problem

#51196 added `/apps/kb/` to CODEOWNERS with both `@supabase/docs` and
`@supabase/marketing`. Because of that, every knowledge base change also
asks marketing for review. Marketing should not be a required reviewer
for KB.

## Solution

Remove `@supabase/marketing` from the `/apps/kb/` line only.
`@supabase/docs` still owns KB. All other CODEOWNERS entries, including
marketing's `/apps/www/` ownership, are unchanged.

```diff
-/apps/kb/ @supabase/docs @supabase/marketing
+/apps/kb/ @supabase/docs
```

## Review instructions

1. Check that the diff is a single line in `.github/CODEOWNERS`.
2. Confirm `/apps/kb/` is still owned by `@supabase/docs`.
3. Optional: `gh api
repos/supabase/supabase/codeowners/errors?ref=tedd/remove-marketing-kb-codeowner`
returns no errors.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-10-13 20:49:14 +00:00
Jeremias Menichelli 9f7d28058b chore: Rotate env vars name correctly (#51619) 2026-10-13 17:24:16 -03:00
Jeremias Menichelli 05396e3378 [DOCS-1422] feat: create GitHub workflow or script to fetch troubleshooting (#51365)
## Problem

Currently troubleshooting guides merged in a private repository trigger
an action to open a PR against our Docs project.

From now on, we want the `kb` to host the troubleshooting guides and
take care of all the Github discussion process while improving some of
its parts.

## Solution

With this PR now:
- All files and scripts related to handling the actions and processes
for handling troubleshooting entries and GitHub Discussion creation on
Docs are deleted.
- A new workflow to sync troubleshooting guides with Supabase's
`troubleshooting_entries` table was created with some improvements.
- Now troubleshooting entries are fetched at pre-build in `kb` project
directory.
- When troubleshooting guides are created a new script detects this,
creates the GitHub discussion for it, extracts the URL, and pushes the
row to a db table at `push`.
- When troubleshooting guides are updated, a checksum holding its title
and body is compared, and the GitHub discussion content gets updated.
 
_Note: all troubleshooting content hasn't been migrated for **kb**, so
content not ready is filtered and not placed in the directory. This
allow us to progressively migrate all pages without breaking the build._

<!--
## Preview links

If relevant, include links to changed pages for easy review access.

Copy the preview base URL from the Vercel bot comment on this PR. Use
the following table as an example template.

| Site | Live | Preview | Search for |
| -------------- |
-------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------
| ----------------------------- |
| WWW | [/blog/your-post](https://supabase.com/blog/your-post) |
[/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post)
| unique phrase from the change |
| Docs |
[/docs/guides/your-page](https://supabase.com/docs/guides/your-page) |
[/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page)
| unique phrase from the change |
| Studio | [/dashboard](https://supabase.com/dashboard) |
[/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard)
| unique phrase from the change |
| Design system | [/design-system](https://supabase.com/design-system) |
[/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system)
| unique phrase from the change |
| UI library | [/library](https://supabase.com/library) |
[/library](https://ui-library-git-branch-name-supabase.vercel.app/library)
| unique phrase from the change |
| Knowledge base |
[/kb/guides/your-page](https://supabase.com/kb/guides/your-page) |
[/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page)
| unique phrase from the change |
-->

<!-- ## Additional context

Optionally add any other context or screenshots.

-->

## Review instructions

For the database workflow, sadly, we will have to wait and monitor, but
the fetching mechanism can be tested.

1. Go to the preview link for `kb`
2. Go to Topics > Troubleshooting
3. A new guide should be visible "Partial migrations and schema
inconsistencies from embedded transactions", click on its link
4. A page showing the guide's content should render

<img width="1022" height="810" alt="Screenshot 2026-10-07 at 13 19 17"
src="https://github.com/user-attachments/assets/cbd25a60-8721-4329-907f-f92de894c217"
/>



## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
2026-10-13 14:30:58 -03:00
Kody Jackson 24307c02e5 chore(kb) - add codeowner line (#51196)
## Problem

Add in formal ownership line for apps/kb w/in codeowners
2026-10-13 08:14:00 -05:00