Commit Graph
6 Commits
Author SHA1 Message Date
Ivan VasilovandClaude Sonnet 5.5 2ac3b77594 chore: replace pnpm hooks and chains with turbo task dependencies in the remaining apps (#53169)
## Problem

`ui-library`, `design-system`, `learn`, `kb`, `www` and `studio` still
order their build, dev and typecheck steps with pnpm `pre`/`post` hooks,
`&&` chains and `run-p`. Turbo can't see those steps, so it can't cache
or parallelize them. Follow-up to #52556, which migrated `apps/docs`.
Part of
[FE-4977](https://linear.app/supabase/issue/FE-4977/migrate-remaining-apps-pnpm-scripts-to-turbo-tasks).

## Solution

The ordering now lives in each app's `turbo.jsonc` as `dependsOn`, the
hooks and chains are gone, and scripts with same-package prerequisites
are wrapped with `maybe-turbo`. `node
.agents/skills/turbo-scripts/scripts/audit.mjs apps/<name>` reports no
findings for any of the six apps.

- **`ui-library`, `design-system`, `learn`:** content, registry and
markdown steps are turbo tasks with declared outputs. `dev:content` uses
the `with` key. `build:next` and `dev:next` are folded into `build` and
`dev`. `ui-library`'s markdown task now depends on `build:registry`,
which the old chain hid. `pnpm --filter library build:registry` still
regenerates the committed registry output.
- **`kb`:** `fetch:federated-content` is uncached, and the tasks that
read its output use `jit` inputs.
- **`www`:**
- `build` depends on `docs#build:guides-markdown`, so federated content
is fetched once instead of twice.
  - `build:next` is folded into `build`.
  - `typecheck` runs `next typegen` itself.
- `turbo-build.test.ts` is updated for the new task graph. It reads
`PATH` through a copy of the env, because `turbo/no-undeclared-env-vars`
flags it once the `passThroughEnv: ["*"]` wildcard is gone.
- `passThroughEnv: ["*"]` is gone, and the env vars the content scripts
read are declared.
- **`studio`:** `typecheck` runs `next typegen` inline, and `lint`
depends on a new `lint:type-checks` task. The `predev` turbopack cache
clean moved into `scripts/dispatch.js`. It's a local side effect, and
making it a turbo task would route `dev` through turbo's strict env
filtering, which drops `NODE_ENV`, `MODE` and `STUDIO_FRAMEWORK`.

## Review instructions

- For each app, check that a second `pnpm build` hits the cache. `www`'s
fetch and content tasks re-run by design, since they're uncached.
- Not verified: the `www` and `studio` dev servers started from the repo
root, a Studio production build, the e2e flow, and runs with real
production credentials.
- `kb`'s build reads a remote database that turbo can't hash. It stays
cached, keyed on `SUPABASE_URL`. Say if you'd rather make it uncached.
- Builds rewrite two tracked files,
`apps/docs/public/markdown/manifest.json` and
`apps/www/public/customers-rss.xml`, so a fresh checkout can miss the
cache once.

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 16:40:21 +01:00
Jeremias Menichelli 22e1776d96 chore: Delete mutation fix on kb script (#52958)
## Problem

While sending a fix to our troubleshooting database, uncle Claude
detected a bad mutation schema.

## Solution

Fix mutation schema so it doesn't fail next 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

_For now, only merge, make sure KB troubleshooting workflow runs
accordingly._

## 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 17:20:43 +00: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
Ali Waseem 2aed6c5ea8 fix(kb): render callouts in troubleshooting articles (#52152)
## Problem

GFM alerts (`> [!NOTE]`, `> [!WARNING]`, …) in troubleshooting articles
render as plain blockquotes with the literal marker text, e.g.
[/kb/troubleshooting/supavisor-error-password-authentication-failed-after-password-rotation](https://supabase.com/kb/troubleshooting/supavisor-error-password-authentication-failed-after-password-rotation).

The source files in `supabase/troubleshooting` are `.mdx`, but
`fetch-federated-content.ts` writes them out as `.md`.
`rehype-admonitions` is only registered on the MDX processor in
`astro.config.mjs`. Plain `.md` stays on Astro's default pipeline, so
the alerts are never converted. Guides aren't affected because they're
all `.mdx`.

## Solution

- Write fetched troubleshooting articles with the `.mdx` extension so
they go through the MDX processor.
- Update `sync-troubleshooting-entries.ts` and
`sync-troubleshooting-updates.ts`, which only read `.md` files from that
directory.
- Clear `src/content/troubleshooting/` before fetching, so `.md` files
from earlier local fetches don't linger as duplicate entries.

Verified locally: all 231 articles compile as MDX, and no
troubleshooting page contains a literal `[!NOTE]`/`[!WARNING]` marker.

## Deploying

**After merging, redeploy production once without build cache.**
Otherwise production keeps serving the broken pages.

Astro caches each article's rendered HTML and reuses it when the
article's text is unchanged, without checking the file extension. That
cache lives in `node_modules/.astro`, which Vercel restores between
builds. Renaming `.md` → `.mdx` doesn't change the text, so a normal
build reuses the HTML rendered from the old `.md` files.

In the Vercel dashboard: kb project → the production deployment from the
merge commit → ⋯ → Redeploy → uncheck "Use existing Build Cache". After
that one clean build, the cache holds the `.mdx` output and stays
correct.

Locally, run `astro build --force` (or delete `node_modules/.astro`)
once if you've built KB before.

## Review instructions

1. On the Vercel preview, open
`/kb/troubleshooting/supavisor-error-password-authentication-failed-after-password-rotation`.
The note and warning should render as callouts. (The preview's cache was
already rebuilt cleanly by an earlier commit on this branch, so it won't
show the production cache issue.)
2. Open a couple of troubleshooting articles without callouts and check
they render the same as production.
2026-10-22 14:04: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