Commit Graph
5244 Commits
Author SHA1 Message Date
5a1e59eb2e docs: add Claude as ID-JAG issuer for MCP Enterprise-Managed Auth (#52021)
## Problem

Anthropic now lets Claude issue the ID-JAG for enterprise-managed MCP
auth when a customer's identity provider can't. No Supabase code change
is needed: the platform already validates ID-JAGs against whichever
issuer URL the organization configures.

The page called the feature "enterprise-managed authentication." It
implements the MCP spec's Enterprise-Managed Authorization extension and
is built on an RFC 7523 authorization grant. Authentication stays with
the IdP. The Studio field description had the same wrong word.

## Solution

**New section, "Using Claude as the ID-JAG issuer."** Covers the
Claude-side steps (Organization settings > Connectors > Supabase >
Managed authorization > Set up, copy the Issuer URL, leave Tenant ID
empty), the Supabase-side step (same ID-JAG Issuer field), and the
connection test. Two constraints were verified against our platform
code: one issuer per SSO provider so the Claude URL replaces the IdP URL
and members need an SSO identity in Supabase. The third, that a
Claude-issued ID-JAG attests Claude-org membership rather than an IdP
session, comes from Anthropic's partner guide.

**Rename to "enterprise-managed authorization."** Page title, headings,
body, SSO guide section, nav label (title case, matching sibling
entries), and the Studio description. The slug moves to
`enterprise-mcp-authorization` with a permanent redirect from the old
path in `apps/www/lib/redirects.js`. The Studio "Learn more" link and
the two published blog posts that linked the page point at the new slug
directly.

## 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: Ana <30495040+ana1337x@users.noreply.github.com>
Co-authored-by: Ana <ana1337x@users.noreply.github.com>
2026-11-03 12:54:58 -05:00
Drew McLellan 07dbe3ce1d fix(studio): use raw object count as storage pagination offset (#52706)
## Problem

Studio Storage hides `.emptyFolderPlaceholder` objects after listing a
folder, but `fetchMoreFolderContents` calculated the next page offset
from the number of visible items. When a page includes the placeholder,
the API returns 200 objects but Studio keeps 199, so the next request
uses offset 199 instead of 200 and the last file of the previous page
appears twice. The duplicates compound with every further page.

Fixes FE-4843. Closes #52607.

Before:
<img width="521" height="458" alt="Screenshot 2026-11-03 at 14 51 09"
src="https://github.com/user-attachments/assets/1ed20ded-08c6-4c56-92d7-5c97ef82cd00"
/>

After:
<img width="532" height="460" alt="Screenshot 2026-11-03 at 14 53 58"
src="https://github.com/user-attachments/assets/64891f27-7fa0-44cb-8076-39b405df0ee4"
/>



## Solution

Each storage column now records `hiddenItemsCount`, the number of API
objects hidden from the visible list (the placeholder).
`fetchMoreFolderContents` offsets the next page by `items.length +
hiddenItemsCount`.

Because the offset is still derived from `items.length`, local edits to
a column (creating a folder, uploads, deletes, renames) keep it in step
with the server, as they did before.

Added tests to `state/storage-explorer.test.ts`: a folder with a
placeholder plus 300 files lists each file exactly once and requests
offsets 0 and 200, and a folder without a placeholder still pages at 0,
200, 400. Reverting the offset line makes the placeholder test fail.

## Review instructions

1. In a bucket, create a `docs` folder and, using the Storage API,
upload a zero-byte `docs/.emptyFolderPlaceholder` plus files
`file-000.txt` through `file-299.txt`.
2. Open `docs` in Studio and sort by Name ascending.
3. Scroll to load further pages and check the list requests in the
network tab: offsets should be 0 and 200, and no file should appear
twice.
4. Run `pnpm --filter studio exec vitest run
state/storage-explorer.test.ts`.

## 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-03 16:26:23 +00:00
Charis df742bdb3b refactor(studio): rename ResponseError to StudioError (#52707)
## What

Moves the `ResponseError` class (`types/base.ts`) and the classified
error classes (`types/api-errors.ts`) into
`lib/errors/studio-errors.ts`, and renames `ResponseError` to
`StudioError`.

## Why

Studio's error classification is being expanded to cover errors that
don't come from API responses (thrown network failures, aborted
requests, unexpected client errors). The API-specific name and location
no longer fit. Landing the rename on its own keeps the follow-up PR,
which introduces the classified error model, small and reviewable.

## Notes for reviewers

- Mechanical change, no behavior change. Most of the diff is a one-line
import change per file plus import re-sorting by Prettier.
- Files that only use the type now use `import type { StudioError }`.
- `ResponseError` is no longer re-exported from `@/types`; there are no
compatibility shims at the old paths.
- Unrelated identifiers like `QueryResponseError` and
`parseResponseErrors` are unchanged.
2026-11-03 11:09:30 -05:00
53e2c4f1d1 [FE-4809] fix(studio): group HA topology by shardRef (#52545)
Update HA topology grouping for the Multigres JSON field rename from
`shardKey` to `shardRef`, so separate shards retain their own primaries
and replicas.

**Changed:**
- Normalize pooler responses to `shardRef`, falling back to legacy
`shardKey` and preferring `shardRef` when both exist.
- Use `shardRef` in the topology selector and shard grouping.

**Added:**
- Regression coverage from response parsing through diagram node/edge
generation for new, legacy, mixed, and conflicting key formats, plus
omitted shard identity fields.

Addresses
https://linear.app/supabase/issue/FE-4809/update-studio-ha-topology-grouping-to-use-shardref

## To test

- Open Settings → Infrastructure on a multi-shard HA project returning
`shardRef`. Confirm one group per shard, each primary shown as Primary
Database, and replicas connected only to their own shard's primary.
- Check the same topology on Database → Pipelines.
- Confirm legacy `shardKey` responses still render correctly and
single-shard projects remain unchanged.

## Validation

- Passed: 33 targeted utility tests, ESLint on all changed files, Studio
TypeScript check, and diff whitespace checks.
- Local browser: login and non-HA infrastructure passed. HA grouping
remains unverified because local poolers/gateways endpoints returned
404; browser response mocking was blocked by cross-origin/CORS
limitations.
- Upstream multigres/multigres#1608 merged October 29; deployment of the
renamed field remains unconfirmed.

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-11-03 22:56:53 +08:00
Charis 9b7cbd1803 feat(studio): migrate branches to FGA grants with production/development variants (#52331)
## Problem

Branch actions in Studio were guarded by hand-written permission checks
(`useAsyncCheckPermissionsV2(FGA_PERMISSIONS.PROJECT.BRANCHING_*)`, plus
one legacy `useAsyncCheckPermissions` in `Branch.Commands.tsx`) that
weren't tied to the endpoints they protect. Every branches request in
`data/branches` was marked `unguarded.migrating`.

This is the pilot migration for endpoint-bound FGA grants. Resolves
[FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal).

## Solution

### Data layer

* `data/branches` has no `unguarded.migrating` left (was 10).
* The list, detail, and diff queries are now `branchesQueryOptions`,
`branchQueryOptions`, and `branchDiffQueryOptions`. They take a grant,
use `skipToken` without one, and keep the grant out of the query key.
* Mutations take the grant in their variables. The merge mutation also
takes `diffGrant`, because it reads the diff before merging.

### Production and development variants

The backend doesn't treat development and production branching
permissions as interchangeable:

* Actions on a single branch (`/v1/branches/{branch_id_or_ref}` and its
diff, merge, push, reset, and restore) need the production permission
for the default branch and the development permission for preview
branches.
* Creating a default branch or a branch with data needs production
create.

To model this, `lib/fga-refinements.ts` gets its first entries:

* The 8 single-branch endpoints have `production` and `development`
variants. A new `variantRequired` flag makes the fetch wrapper reject a
grant without a variant, at compile time and in `assertGrant`.
* `POST /v1/projects/{ref}/branches` has a `production` variant.
`assertGrant` requires it when the body sets `is_default` or
`with_data`.
* `useBranchGrant(endpoint, { projectRef, isDefault })` picks the
variant from the branch's `is_default`. It stays `loading` until the
branch is known.
* `GrantForVariants<M, P>` types a grant for any of an endpoint's
variants.

### UI

* The old checks are replaced with grants in `CreateBranchButton`,
`CreateBranchModal`, `Overview`, `DeleteBranchPanel`,
`DeleteBranchModal`, the branches and merge-requests pages, and
`Branch.Commands.tsx`.
* Grants are evaluated against the parent project, where branch
permissions live. The scope is passed explicitly, because
`/v1/branches/*` paths don't include the project.
* Pages that are mainly about branches show `NoPermission` when the
grant is denied and `AlertError` when the permission check fails. Action
buttons are disabled with a tooltip. Places that use the branch list
incidentally (nav, project home, usage) treat a denied grant as "no
branches" instead of loading forever.
* "Include data" in `CreateBranchModal` is disabled without production
create. It previously failed after submitting.
* `OutOfDateNotice`'s "Update branch" is disabled without the push
grant. It previously did nothing.
* The GitHub integration form blocks saving without the
production-branch grant. Previously the connection was saved while the
branch request failed, and a repo change deleted the old connection
first.

### Where the old checks differed from the backend

* **Too strict:** the branches and merge-requests pages required
development read, and the create button required development create. The
backend accepts development or production for both.
* **Wrong for the default branch:** single-branch actions always checked
development permissions, or production write for the main branch menu,
regardless of which branch was targeted.
* **Missing:** reset and "Switch to persistent" in `Overview` had no
check.
* **Legacy check:** `Branch.Commands.tsx` used the legacy `CREATE
preview_branches` check.

`BranchingPITRNotice` is unchanged: its check guards a subscription
update, not a branches request.

### Other changes

* The two new query options use an `eslint-disable` for
`@tanstack/query/exhaustive-deps`, because grants stay out of query
keys. A separate PR upgrades the plugin and allowlists `grant`, after
which these can be removed.
* `upsertMigration` in the merge mutation still uses
`unguarded.migrating`. It belongs to the database-migrations domain.

## Testing

* New component tests for `CreateBranchButton`, `DeleteBranchPanel`, the
branches page, and `GitHubIntegrationConnectionForm` cover granted,
denied, and error states.
* New `useBranchGrant` tests: default vs. preview branch, and loading
until the branch is known.
* `guarded-fetch.test.ts` covers required variants (types and runtime)
and the production variant for default and data branches.
* Shared fixtures are in `tests/lib/branch-test-utils.ts`.
* Studio typecheck passes, affected suites pass, the ESLint ratchet is
stable, and knip is clean.
2026-11-03 09:12:48 -05:00
Francesco SansalvadoreandCursor Agent 5912394ffc chore(studio): improve object versioning feature preview (#52689)
Improve copywriting and add image for the Storage Object Versioning
feature preview.

|Before | After |
|--|--|
| <img width="1096" height="717" alt="Screenshot 2026-11-03 at 11 05 30"
src="https://github.com/user-attachments/assets/88a7f13e-4762-48cd-89db-57e2c51f7613"
/> | <img width="1075" height="693" alt="Screenshot 2026-11-03 at 11 06
28"
src="https://github.com/user-attachments/assets/bab3a2ef-f8bf-4188-865a-701e482347f1"
/> |

## How to review

1. Open `Storage object versioning` feature preview
2. See feature preview
3. Acknowledge feature preview
4. Approve

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-11-03 10:40:46 +00:00
Joshen Lim 7c52a9b539 Joshenlim/fe 3931 re phone mfa enrollment repeatedly force disabled despite (#52629)
## Context

In Authentication -> Multi Factor, if you've set SMS MFA to any status
apart from "Disabled" and refresh the page, the UI seemingly doesn't
render the right value in the dropdown as such:
<img width="1114" height="160" alt="image"
src="https://github.com/user-attachments/assets/d3353628-0b9a-4347-b81f-3a968a87b5c2"
/>

Was happening as the form mounted with placeholder values (for SMS MFA,
default status was "Disabled"), and the real value was only applied
afterwards by a `useEffect` which called `reset`. This changed the
`Select`'s value after mount, in Radix then fires an event on that
change through `onValueChange` which set `value` as an empty string
`''`. It happens as well for TOTP, if you set any value other than
"Enabled" which is the default status.

## Changes involved
- Am also opting to breakdown `MfaAuthSettingsForm.tsx` into smaller
components as it's a single file handling 3 different forms at the
moment
- (Main fix) Derive the form values via `defaultValue` instead of via
`useEffect` which prevents the unintended firing of `onValueChange` for
the `Select`
2026-11-03 14:38:39 +08:00
Joshen Lim 7bb6e13aa8 Include existing postgres config params in PUT payload (#52675)
## Context

The PUT `database/postgres` endpoint does a full resource override for
the project's Postgres config.
The only surface in the dashboard that does requests to PUT
`database/postgres` is under Database -> Settings -> Log connections,
but the dashboard only sends `log_connections` and `log_disconnections`
when updating the settings here, resulting in existing config values
being over written.

Fix here is to merge the existing Postgres config values in the PUT
payload
2026-11-03 14:04:17 +08:00
Eduardo Gurgel 90c3e57e05 feat(studio): realtime health advisors (#52535) 2026-11-03 16:29:25 +13:00
Joshen Lim 7439ae34d1 Fix update role panel not scrollable (#52621)
## Context

Under organization -> team member settings, when managing a member's
access (specifically if the access is project-scoped), the list of
projects is not scrollable at the moment if there's a lot of projects,
so this PR addresses that, as well as cleans up a couple of small UI
issues that I found while investigating.

Screenshot here just shows which UI i'm referring to but you'll need to
have a lot of projects to reproduce this
<img width="1099" height="492" alt="image"
src="https://github.com/user-attachments/assets/73c6db27-9ae8-479b-b2cc-2b6b0d322ff6"
/>
2026-11-03 11:12:20 +08:00
Charis 8be85ad4ad feat(studio): guard branch update and push with FGA grants (#52377)
Part 6 of 7 in a stack that splits #52331 into reviewable pieces.
Resolves part of
[FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal).
There are no functional changes beyond #52331, and the top of the stack
is identical to it. See #52331 for the full rationale.

## Stack
1. #52372 Grant infra for branch variants
2. #52373 Branches list query
3. #52374 Page gates on the list grant
4. #52375 Branch creation
5. #52376 Branch read, delete, reset, and restore
6. 👉 #52377 Branch update and push
7. #52378 Branch diff and merge

## Changes
The update and push mutations take grants. `Overview` (including "Switch
to persistent", which previously had no check), `EditBranchModal`,
`SwitchToPreviewModal`, `MergeRequestButton`, the merge-requests page,
and the merge page use `useBranchGrant`. The "Update branch" button in
`OutOfDateNotice` is disabled without push; previously it did nothing.
The GitHub integration form blocks saving without the production-branch
grant. Previously the connection was saved even when the branch request
failed.

## Testing
New `GitHubIntegrationConnectionForm` test.
2026-11-02 15:52:01 -05:00
Miranda Limonczenko 86848fc036 docs: move the production security checklist to its own page (#52466)
Closes DOCS-1494

## Problem

The Security section of the Production checklist is split out as a part
of the Information Architecture plan laid out in Option 1 of the [Docs
navigation architecture
proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61).

## Solution

- **Structure:** move `## Security` to
`guides/security/production-checklist`. The production checklist keeps
the heading, and its `#security` anchor, with a one-sentence pointer.
The page is in the Security sidebar under Guides, after Production
Checklist.
- **Option 1 navigation:** the "Production security checklist" entry in
Run and manage, Security and compliance, points to the new page. The
Option 1 test no longer expects the anchor.
- **Page shape:** a value-statement opener with the situations that call
for the checklist, then the items grouped under Database, Account and
organization, Auth, and Threat review. Each group opens with a lead-in
that says what its checks protect.
- **Inbound links:** two Studio linter entries for OTP settings, the
Studio Auth providers form, and `auth/auth-email-passwordless` now point
to `production-checklist#auth`. The password length lint points to the
password security guide instead, since the checklist has no password
item. They used to land on `going-into-prod#security`, which is a
pointer now.
- **Claim fixes:**
- The replication item told readers to enable replication on sensitive
tables. It now says to enable RLS on replicated tables that hold
sensitive data.
- The Auth items named **Authentication > Providers**. The Dashboard
label is **Sign In / Providers**.
- **Terminal path:** the Auth group links the Management API endpoint
for its settings. The Database items link to guides that carry CLI or
SQL paths.
- **Review fixes:** a note that RLS doesn't filter Postgres Changes
`DELETE` events, a SQL path for publications, and the other email links
the OTP expiry controls.
- **Agent prompt:** after the opener, a copyable `AiPrompt` that has an
agent audit the project read-only and report each item as pass, fail, or
can't check. It reads Security Advisor and the tables through the
Supabase MCP server, and SSL, network restrictions, Auth settings, and
org members through Management API GET endpoints. `includeInMarkdown` is
on, so the `.md` carries the prompt as a fenced text block.
- **Cross-links:** Testing auth flows points to the checklist's Auth
group, and the Security overview and Product configuration pages link
the checklist. The custom SMTP item links the SMTP guide.

### Not verified

- **Deferred samples:** none. The page has no code samples.
- **Agent prompt:** its endpoints and fields match
`api_v1_openapi.json`, and `Owner` matches Studio's role name. No agent
has run it against a hosted project.
- **Studio:** the link changes are strings only. Studio tests and build
run on this PR because it touches `apps/studio`.

## Manual testing

1. Open [Production security
checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/security/production-checklist).
See the agent prompt below the opener and four groups of checks. Click
**Copy** and see the prompt text.
2. Open [Production
checklist](https://docs-git-docs-production-security-checklist-supabase.vercel.app/docs/guides/deployment/going-into-prod#security).
See the Security heading with a one-sentence pointer to the new page.
3. In the Security sidebar under Guides, click **Production security
checklist**. See the new page open.
2026-11-02 09:57:08 -08:00
kemal.earth 38ae9fea1c feat(studio): add admonition for api keys settings view (#52250)
## Problem

API Keys Settings view needs updating.

## Solution

Added admonition with update and link to docs.
2026-11-02 16:26:42 +00:00
Drew McLellan 5ff6930c2a feat(studio): send role passwords as precomputed SCRAM-SHA-256 verifiers (#52544)
## What kind of change does this PR introduce?

Feature.

## What is the current behavior?

Role passwords are sent as plaintext in the SQL (`create role ...
password '...'` and `alter role ... password '...'`), so they can end up
in Postgres logs.

## What is the new behavior?

ASCII role passwords are hashed in the browser with Web Crypto and sent
as a precomputed `SCRAM-SHA-256$...` verifier. Postgres stores a
verifier as given, so the plaintext no longer appears in the SQL or the
server logs. This applies to every flow that sets a role password,
because they all go through the role create and update mutations.

Non-ASCII passwords are still sent as plaintext. Postgres normalizes
passwords with SASLprep before hashing, and the browser code doesn't
apply it, so a verifier built from the raw text could stop the role from
logging in. For ASCII, SASLprep changes nothing, so the verifier always
matches. The `saslprep` package can't be used here because it reads its
table with `fs.readFileSync` at import time. Covering non-ASCII
passwords is a follow-up, most likely a server-side API.

Studio also falls back to plaintext when `crypto.subtle` isn't
available, which browsers only expose in secure contexts. This keeps
setting a password working on self-hosted Studio served over plain HTTP.

## Known limitations

- The verifier is built with 4096 iterations, the Postgres default. If a
project sets `scram_iterations` higher, these roles keep 4096, because
Postgres stores a supplied verifier as given. Reading the setting first
needs an extra query and a grant for it, so it's left for the follow-up
below.
- Non-ASCII passwords, and Studio over plain HTTP, still send plaintext.
- The follow-up is a server-side path that sets the password without it
going through the SQL, which would honor the server's own settings and
cover these cases.

A verifier isn't secret (it can be attacked offline), but it is a clear
improvement over plaintext.

## Testing

- Unit tests compare the helper with an independent `node:crypto`
implementation, and check that ASCII passwords become verifiers and
non-ASCII passwords pass through unchanged.
- I also checked against a real Postgres: roles given these verifiers
log in with the plaintext password and reject a wrong one.
- The `CreateRolePanel` test now expects a verifier and no plaintext in
the SQL.

Resolves FE-4822.
2026-11-02 15:42:59 +00:00
Jordi Enric 298fda50dc feat(logs): filter by any log attribute DEBUG-223 (#52513)
Support filtering log attributes through the picker and log details, preserving filters across URLs and query surfaces.

Fixes DEBUG-223.
2026-11-02 15:14:50 +01:00
Viacheslav Sergeev da454314b1 fix(studio): select the full folder name when renaming in Storage (#52594)
## Problem

Renaming a Storage folder such as `photos.backup` selects only `photos`,
leaving `.backup` behind when the user types a replacement name.

Fixes https://github.com/supabase/supabase/issues/52593 

## Solution

Apply extension-aware text selection only to files. Select the entire
name for folders.

Add regression tests for dotted folder names, ordinary folder names, and
files with extensions.
All three tests pass with the fix; the dotted-folder case fails before
it.

## Review instructions


1. Create a folder named `photos.backup` in a test Storage bucket.
2. Select Rename and confirm the entire name is selected.
3. Type `archive` and confirm no `.backup` suffix remains.
4. Rename a file named `photo.png` and confirm only `photo` is selected.

## Checklist

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
2026-11-02 15:06:32 +01:00
Drew McLellan 1e94d386a4 feat(studio): add a reset password action for custom roles (#52506)
## What kind of change does this PR introduce?

Feature.

## What is the current behavior?

The Dashboard only offers a reset password action for the `postgres`
role (Database Settings). To change the password of a custom role, users
have to run `alter role ... password` in the SQL editor.

## What is the new behavior?

Each role row in Database > Roles has a "Reset password" item in its
actions menu. It opens a dialog with a warning that anything using the
old password will be disconnected, and the shared password field
(generate and copy). The password is required in this dialog.

- The item is disabled for system roles, and for roles that can't log
in, with a tooltip explaining why.
- It uses the existing role update mutation, so no platform endpoint is
involved.
- `RolePasswordField` gains `isOptional` and `layout` props so the
dialog can reuse it.

<img width="271" height="174" alt="Screenshot 2026-11-02 at 11 11 33"
src="https://github.com/user-attachments/assets/36f05fa0-e95c-440c-b6bb-4fadb466c2f6"
/>

<img width="543" height="414" alt="Screenshot 2026-11-02 at 11 11 17"
src="https://github.com/user-attachments/assets/87ba4f50-1315-4e07-b390-9c5b6beba129"
/>


## Testing

New `RoleRow` component tests cover the item being available for a
custom role that can log in, disabled for system roles and roles that
can't log in, the required-password validation, and a successful reset.

Resolves FE-4813.
2026-11-02 13:52:18 +00:00
Charis 4810bbcfdf feat(studio): guard branch read, delete, reset, and restore with FGA grants (#52376)
Part 5 of 7 in a stack that splits #52331 into reviewable pieces.
Resolves part of
[FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal).
There are no functional changes beyond #52331, and the top of the stack
is identical to it. See #52331 for the full rationale.

## Stack
1. #52372 Grant infra for branch variants
2. #52373 Branches list query
3. #52374 Page gates on the list grant
4. #52375 Branch creation
5. 👉 #52376 Branch read, delete, reset, and restore
6. #52377 Branch update and push
7. #52378 Branch diff and merge

## Changes
`useBranchQuery` becomes `branchQueryOptions`. The delete, reset, and
restore mutations take grants. `DeleteBranchModal`, `DeleteBranchPanel`,
and the relevant `Overview` actions use `useBranchGrant`, which picks
production for the default branch and development for preview branches.
Reset previously had no check.

## Testing
New `DeleteBranchPanel` test.
2026-11-02 08:49:19 -05:00
Jordi Enric be28b2517f fix(logs): correlate request and trace IDs DEBUG-260 (#52514)
Correlate related log timelines using request and trace IDs, and improve the Timeline empty state.

Fixes DEBUG-260.
2026-11-02 14:38:02 +01:00
K-Dog (Kevin) 31c9854c2a chore: update api types (#52618)
Fixes API-types as per latest develop - pending prod deployment today to
clear out the failing action that checks against prod types
2026-11-02 18:27:59 +08:00
Riccardo Busetti cd0b65c03e feat(logs): Add Pipelines to unified logs and rename ETL to Pipelines (#52555) 2026-11-02 11:26:29 +01:00
claude[bot]andClaude 419ab63a14 fix(studio): report regionSelectionType 'auto' only for the Auto region option (#52283)
<!-- claude-slack-attribution -->
_Requested by **Pam Chia** · [Slack
thread](https://supabase.slack.com/archives/C076KTY11DF/p1792977863856759?thread_ts=1792977863.856759&cid=C076KTY11DF)_

## Problem

**Before:** `getRegionSelectionType` had an untouched-field branch that
also returned `auto`, but it was unreachable: `ProjectCreationForm`
passed `dirtyFields.dbRegion` (`undefined` when untouched) into an
`isDbRegionDirty = true` default parameter, so the branch never fired.
With the new Auto (best available) region option also reporting `auto`,
the value was ambiguous between "left untouched" and "picked the Auto
option".

**After:** `auto` means the user submitted the Auto (best available)
region. An untouched field reports whatever default it holds (`general`
or `auto`).

Production values for untouched submissions don't change, since the
removed branch never fired.

Fixes
[GROWTH-1358](https://linear.app/supabase/issue/GROWTH-1358/studio-regionselectiontype-never-reports-auto-for-untouched-default)

## Solution

- `ProjectCreation.utils.ts`: `getRegionSelectionType` classifies only
by the submitted region. Removed the `isDbRegionDirty` argument and the
untouched-field branch.
- `ProjectCreationForm.tsx`: stopped passing `isDbRegionDirty`. The
default-region sync effect still uses it, unchanged.
- `ProjectCreation.utils.test.ts`: removed the untouched-field cases.
The Auto option cases (available and unavailable) stay.
- `packages/common/telemetry-constants.ts`: updated the
`regionSelectionType` doc to the new meaning.

## Review instructions

1. `pnpm --filter studio exec vitest run
components/interfaces/ProjectCreation` passes.
2. On the preview, create a project with the Auto region option and
confirm `project_creation_simple_version_submitted` fires with
`regionSelectionType: 'auto'`.
3. Create another project leaving a smart group default (e.g. Americas)
untouched, or picking an exact region, and confirm it reports `general`
or `specific`.

## 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)

---
_Generated by [Claude
Code](https://claude.ai/code/session_01U4bWS81PTj81V8YkZeFP2Q)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 18:11:26 +08:00
Drew McLellan 5bb549efae feat(studio): allow setting a password when enabling login on an existing role (#52505)
## What kind of change does this PR introduce?

Feature.

## What is the current behavior?

Turning on "User can login" for an existing role that couldn't log in
gives no way to set a password. Users have to run `alter role ...
password` in the SQL editor.

## What is the new behavior?

In Database > Roles, turning on "User can login" for a role that
couldn't log in now shows the same optional password field as the create
panel, including the generate and copy actions.

- The field only shows for roles that don't currently have login. Roles
that can already log in don't get one.
- The password is sent only when login is gained in that save and the
field isn't empty. An empty field turns on login without a password, as
in create mode.
- The password is kept out of the "changed fields" diff, so unrelated
edits never send `password ''`.
- The password field is extracted from the create panel into a shared
`RolePasswordField`, which also owns the "Password generated"
announcement state.

Follow-up to #52463. Changing the password of a role that can already
log in is tracked separately and is the next PR in this stack.

<img width="840" height="655" alt="Screenshot 2026-10-29 at 15 47 33"
src="https://github.com/user-attachments/assets/8bb52e86-7b1e-4911-b625-2532fb7dfa25"
/>


## Testing

- New `RoleRow` component tests cover the field's visibility, sending
the password, and omitting it when empty or for roles that already have
login.
- Existing `CreateRolePanel` tests still pass.

Part of FE-4763.
2026-11-02 09:48:04 +00:00
Steven Eubank 48bc6ef4a5 fix: log meter alarm (#52393)
I am updating these meters to make them not so elevated, to reduce
customer alarm. I am improving the query info to reduce alarm, and
adding a GH discussion link to help route customers to a central
location to give feedback for us to consider while improving the product
ahead of launch.

## Problem

The upcoming meters for ingest and logs work well, but are increasing
support ticket volume in a manner that is counter productive to our
ability to address the issues, while trying to tend to customer concern
and sentiment.

## Solution

Addresses customer concern by reducing visibility and adding a GH
discussion link to cusotmers can be routed to a cnetral place where we
can provide updates and we can collect feedback publicly to address any
customer concerns. We still want feedback and to address them, we just
need to control the volume.

Includes:
- removing upcoming pill from both meters
- moving the meters lower
- adjusting the query text to add more confidence around billing
timeline enforcement
- added link to the GH discussion to route feedback

before:

sudio: usage
<img width="1284" height="424" alt="image"
src="https://github.com/user-attachments/assets/0587f2a9-be6d-4a11-8e33-64b6354bc41d"
/>

and after:

<img width="861" height="448" alt="image"
src="https://github.com/user-attachments/assets/708497af-eda9-478f-ad84-f29196f2f01f"
/>
2026-11-02 17:41:08 +08:00
Nayan KumarandClaude Opus 5.5 7837277084 fix(studio): correct grammar in organization not found message (#52276)
## Problem

The Studio error shown when an organization does not exist, or the user
lacks permission to view it, has two grammar mistakes: "permission to
access to it" and "Contact the the owner".

## Solution

Changed the copy to "permission to access it" and "Contact the owner".
This is a text-only change in `OrgNotFound.tsx`, reformatted with the
repo's Prettier config. No logic changed.

## Review instructions

1. Open `/dashboard/org/<a-slug-that-does-not-exist>` on the Studio
preview.
2. Confirm the message reads: "This organization does not exist or you
do not have permission to access it. Contact the owner if you believe
this is a mistake."

## 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, no docs
changed)

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

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:05:50 -06:00
hallidayo 552312507f fix(studio): storage policy footer (#52531)
## Problem

Footer is hidden when reviewing a policy for storage.

## Solution

The footer is now fixed and sticks so that the user can see the buttons
at all times:

<img width="1152" height="712" alt="Screenshot 2026-10-29 at 20 07 32"
src="https://github.com/user-attachments/assets/87e97afd-fb33-4e63-a67d-fb9861449a20"
/>

Closes #52520

## 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-10-30 07:01:17 -06:00
Ganesh kumar TandDrew McLellan 1915615dca fix: clamp Popover/Select/DropdownMenu content to viewport height (#49233)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Bug fix.

## What is the current behavior?

Fixes #49155. The three dropdowns in the issue (Edge Function Logs
Severity filter, and the two dropdowns in the "Add foreign key
relationship" modal) all get clipped by the viewport with no way to
scroll to the rest of the content, in some cases making buttons
unreachable.

All three share the same root cause: `PopoverContent`, `SelectContent`,
and `DropdownMenuContent` in `packages/ui/src/components/shadcn/ui/`
each cap their max height with either a hardcoded pixel value
(`max-h-96`, `max-h-[300px]`) or nothing at all, instead of using the
available-height CSS variable Radix's Popper already computes and
exposes for exactly this purpose. When the real available space is
smaller than the hardcoded cap, the content still renders at the larger
size and overflows past the edge of the screen.

## What is the new behavior?

Swapped the fixed `max-h-*` values for the matching
`--radix-*-content-available-height` variable on all three components,
and changed `overflow-hidden` to `overflow-y-auto` so any content that
still doesn't fully fit gets an internal scrollbar instead of clipping
off-screen.

## Additional context

**On verification:** I wasn't able to get an actual visual click-through
of this fix. Locally, `apps/design-system` (the component demo site)
hits a known contentlayer2 issue on Windows that leaves every `/docs/*`
page 404ing regardless of this change. The CI preview deployment for
`design-system` did build successfully, but it's gated behind Vercel SSO
(team-only), which I don't have access to as an external contributor.

What I did verify directly:
- `pnpm --filter=ui typecheck` passes clean.
- The three CSS variable names I'm referencing
(`--radix-select-content-available-height`,
`--radix-popover-content-available-height`,
`--radix-dropdown-menu-content-available-height`) are real — confirmed
by reading the installed `@radix-ui/react-select`,
`@radix-ui/react-popover`, and `@radix-ui/react-dropdown-menu` source
directly, where each one aliases its own variable to the underlying
`--radix-popper-available-height` that Popper computes.
- Compiled the exact new classes through this repo's pinned Tailwind
version (4.2.4) via `@tailwindcss/postcss` directly, and confirmed each
one generates the expected rule, e.g.
`.max-h-\(--radix-popover-content-available-height\) { max-height:
var(--radix-popover-content-available-height); }` — so there's no syntax
mistake in the arbitrary-value class.

Happy to have someone with repo access check the design-system preview,
or I can revisit this once I have another way to view it.

There's also a fourth spot in the report — the Severity filter's option
list (`packages/ui-patterns/src/FilterBar/DefaultCommandList.tsx`),
which hardcodes its own `max-h-[300px]` on an inner div rather than the
`PopoverContent` primitive directly. That div renders inside the
now-fixed `PopoverContent`, so it may already be covered by this change
since CSS custom properties inherit to descendants — but since I
couldn't confirm that visually either, I've left it untouched for now
rather than guess.

---------

Co-authored-by: Drew McLellan <drew.mclellan@gmail.com>
2026-10-30 09:32:10 +00:00
Jordi Enric 189ade6bc3 fix(reports): use minute buckets for short ranges DEBUG-95 (#52145)
## Problem

The last 60 minutes in Shared API Report collapses requests, errors,
response speed, and network traffic into hourly points. This affects the
Data API, Auth, and Realtime reports using ClickHouse.

## Fix

Choose minute buckets for short ClickHouse report ranges and retain
hourly buckets for longer ranges. Existing preset consumers keep their
hourly defaults, and route summaries retain their current behavior.

## How to test

- Open Observability → Data API and select Last 60 minutes. With
requests across the hour, the charts should show minute-level data.
- Switch to Last 24 hours and confirm the charts retain hourly grouping.
- Apply a report filter and confirm the charts and route summaries
respect it.
- Repeat the short-range check on Auth or Realtime.

Validation: 80 focused report tests passed with retries disabled and
shuffled order. The ClickHouse boundary tests failed when the 60-minute
cutoff was deliberately broken, then passed after restoring the fix.
Studio typecheck and changed-file formatting passed. Independent review
found no issues.

The ClickHouse behavior was verified in the preview: minute buckets for
Last 60 minutes on Data API and Auth, hourly buckets for Last 24 hours,
and route filtering on charts and summaries.

Fixes https://linear.app/supabase/issue/DEBUG-95
2026-10-30 10:00:46 +01:00
SainavaandAlaister Young 65217161af fix(studio): prevent ghost redirects on unmounted SignInPartner (#46594)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Bug fix

## What is the current behavior?

Please link any relevant issues here: Resolves **#46593**

There is a navigation race condition in
`apps/studio/components/interfaces/SignIn/SignInPartner.tsx`. On mount,
an IIFE fetches `auth.getSession()` and potentially
`auth.signInWithIdToken()`. If the user navigates away from the page
(unmounting the component) while these network promises are still
pending, the `finally` or `else` blocks will still execute
`router.replace()`. This forces an unintended "ghost redirect" that
hijacks the user's active session and pulls them away from their current
page.

## What is the new behavior?

This PR introduces a standard `isMounted` flag to guard the asynchronous
operations inside the `useEffect` hook.

* A cleanup function now correctly flips the `isMounted` flag to `false`
when the component unmounts.
* An early exit `if (!isMounted) return` prevents unnecessary execution
if the component is destroyed during the initial session fetch.
* The `router.replace()` calls are now wrapped in `if (isMounted)`
checks, ensuring that redirects only trigger if the component is still
active in the DOM.

## Additional context

This is an isolated frontend lifecycle patch. Local pre-flight checks
(`pnpm typecheck`, `pnpm lint --filter=studio`, and `pnpm test:studio`)
have all passed successfully.

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-10-30 14:16:39 +08:00
Miranda Limonczenko e79adc4a42 docs: move leaked API key rotation to its own page (#52465)
Closes DOCS-1493

## Problem

The Rotate a leaked or compromised key section of API keys is split out
as a part of the Information Architecture plan laid out in Option 1 of
the [Docs navigation architecture
proposal](https://app.notion.com/p/supabase/Q4-2027-Proposal-Docs-navigation-architecture-3f25004b775f81f49dbad710a732ef61).

## Solution

- **Structure:** move `### Rotate a leaked or compromised key` to
`guides/security/rotate-leaked-api-keys`. API keys keeps the heading and
its `#leaked-key` id, with a one-sentence pointer. The page is in the
Security sidebar under Guides, since its URL selects that sidebar.
- **Option 1 navigation:** the "Rotate a leaked API key" entry in Run
and manage, Security and compliance, points to the new page. The Option
1 test no longer expects the anchor.

Run /test-the-docs and /edit-the-docs.

## Manual testing

1. Open [Rotate a leaked or compromised API
key](https://docs-git-docs-rotate-leaked-api-keys-supabase.vercel.app/docs/guides/security/rotate-leaked-api-keys).
See the create, replace, and retire sections, with Dashboard and
Management API tabs.
2. Open [API
keys](https://docs-git-docs-rotate-leaked-api-keys-supabase.vercel.app/docs/guides/getting-started/api-keys#leaked-key).
See the heading with a one-sentence pointer to the new page.
3. In the Security sidebar under Guides, click **Rotate a leaked or
compromised API key**. See the new page open.
2026-10-29 21:35:44 +00:00
Mert YEREKAPAN 3d76559cec chore(studio): remove logs.all deprecation banner (#52491)
## Problem

The `logs.all` Management API endpoint retired on September 23, and the
deprecation banner stopped rendering on September 24 because of its
hardcoded expiry. The banner's code is now dead weight in the bundle.

Resolves GROWTH-1104.

## Solution

Removes the banner and everything it pulled in:

- Deletes `BannerLogsAllDeprecation.tsx`, plus its mount effect, expiry
timer, and exposure tracking in `AppBannerWrapper.tsx`.
- Removes `isLogsOrObservabilityPath` (only this banner used it) and its
tests.
- Removes `BANNER_ID.LOGS_ALL_DEPRECATION`.
`BannerStackProvider.test.tsx` used it as an arbitrary ID, so those
tests now use `BANNER_ID.EXPLORER`. The tests themselves are unchanged.
- Removes the `LOGS_ALL_DEPRECATION_2026_09_23` local storage key and
the two `logs_all_deprecation_banner_*` telemetry events.

The dismissal key stays in users' browsers, which is harmless because
nothing reads it anymore.

## Review instructions

1. Open a project's Logs or Observability page on the preview and
confirm no `logs.all` notice appears and the page renders normally.
2. Open an organization's landing page and confirm the Terms of Service
banner still behaves as before.

## 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-10-29 14:44:04 -06:00
Monica Khoury 0bd4b8db48 fix(studio): remove search and sorting from webhook deliveries table (#52499)
## Problem

The webhook deliveries table has a search input and sortable column
headers, but they only act on the page of rows already loaded (5 rows).
The backend uses cursor pagination and has no server-side filtering or
sorting, so searching for a term that isn't on the visible page shows
"No deliveries found" even when matches exist. This looks broken.

Closes FE-4762. The follow-up to bring these back once the backend
supports it is tracked in DEPR-709.

## Solution

- Removed the search input, its focus shortcut, and the `deliverySearch`
URL state from the deliveries table.
- Removed the sort controls from the column headers. Headers are now
plain text.
- Removed the unused `filterWebhookDeliveries` helper and its test. Rows
now render in the order the API returns them.
- Updated the empty state copy, since it referred to adjusting a search.
- Cursor pagination is unchanged.

## How to test

1. Open a project's webhooks page and select an endpoint with
deliveries.
2. Check that the Deliveries section has no search input, only the Live
toggle and the refresh button.
3. Check that the column headers (Status, Event, Response, Attempted)
are not clickable and show no sort icons.
4. Check that the previous and next page buttons still page through
deliveries.
5. Select an endpoint with no deliveries and check that the empty state
reads "Webhook attempts will show up here once this endpoint receives
events."
2026-10-29 17:33:45 +02:00
7867f22522 feat(studio): link log users and show Auth activity timelines (#50837)
Add a User tab that resolves the signed-in user from the selected log or
a related request step. It shows the shared Auth profile, offers
filtering from the User ID row, and explains anonymous, external, or
deleted users.

When unified logs are enabled, the Auth user's Logs tab shows the user's
10 most recent logs in `EmbeddedLogsTable`, with the Logs page's columns
and row styling. A row opens that log on the Logs page, filtered to the
user, and View more in Logs opens the rest. Other configurations retain
the existing Logs view. Shared user presentation is isolated in #50841;
this PR contains the log/Auth integration and resolves missing-user
queries to null.

The list uses the #50953 helpers instead of its own:
`createUnifiedLogsSearch` builds the query search, `buildUnifiedLogsUrl`
builds the links (it now takes a `logId` to open a log), and the query
asks for only the 10 rows it shows via `pageSize`. At the panel's
default width the table is wider than the panel, so Event message needs
a horizontal scroll; the empty state renders outside the table so it
stays in view.

Issue:
[DEBUG-222](https://linear.app/supabase/issue/DEBUG-222/build-correlated-log-and-user-connections-in-studio)

### How to test

1. With the Unified Logs preview and `otelUnifiedLogs` enabled, open a
signed-in user's log and select User. Check the profile, copy the User
ID, and use Add filter to filter logs to that user.
2. Use Open in Authentication, then open the user's Logs tab. Select a
row and confirm it opens the matching log; check that View more in Logs
preserves the user filter.
3. Open an anonymous request and confirm the explanatory state. For
correlated, external, and deleted-user cases, run the fixtures: `pnpm
--filter studio exec vitest run
components/interfaces/UnifiedLogs/components/LogUser.platform.test.tsx`.
4. In the log's User tab, focus User ID and press Enter, Arrow Down,
Enter. Confirm it copies the ID without changing the selected log. Arrow
Down should navigate logs again after the menu closes.

### Validation

- Latest head: `8e4a9993b0db52ec5e611e55233b5ed77f67e358`, based on
`master`, with conflicts resolved and independent review complete.
- Local baseline and shuffled verification passed 324 tests across 26
files with retries disabled (shuffle seed `5083710`). An independent
affected-suite run passed 29 tests with retries disabled and shuffle
seed `5083730`.
- Live QA found and reproduced a keyboard collision: field-menu Arrow
Down also selected the next log. The shared menu now keeps keyboard
events inside the menu. The regression fails when the guard is removed
and passes after restoration.
- On the verified latest-head preview, keyboard User ID copy, mouse
copy, Add filter, Escape, navigation after closing the menu, and
adjacent Auth email copying passed. No browser console errors were
observed; browser network telemetry was unavailable.
- Full signed-in activity, matching log/profile, Authentication
navigation, View more filtering, anonymous state and deleted-user
handling passed on `311206f9ef`. The subsequent change only affects menu
keyboard propagation, which was revalidated on the latest head.
- The disposable staging user was deleted and absence verified.
Temporary key files were removed and the clipboard cleared.
- Current CI: all E2E suites, unit tests, formatting, lint, Docker and
deployments passed; typecheck is still running. Local full typecheck
exhausted Node's heap, so no local full pass is claimed.

### Stack

All prerequisite log-decoupling and request-correlation PRs, including
#50841, are merged into `master`. This is the final code PR in the
stack.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-29 16:15:21 +01:00
bd62dec2e2 refactor(studio): share Auth user cards and detail fields (#50841)
Extract shared Auth user cards and copyable detail fields, and use the
shared raw-JSON display in the user panel. The existing Logs view
remains available; unified activity timelines and log-user filtering
arrive separately in #50837.

This includes display-name/initials coverage and the Auth panel's
component and browser tests. The browser test now verifies keyboard
copying and Escape panel dismissal separately: the existing Auth Escape
shortcut closes the details panel, so expecting it to restore focus to a
field was incorrect. Its Raw JSON check reads the copied JSON's fields,
since the code view's text includes line numbers.

`UserCard` is Studio's first `Avatar`, so `vite.config.ts` pins
`avatar.tsx` to its own chunk, like `field`, `drawer` and `slider`.
Otherwise Rolldown pools it into the Auth `users` page chunk that the
`ui` barrel then imports back, a chunk cycle that fails the TanStack
build.

### How to test

1. Open an existing user in Authentication → Users. Check the profile
card, overview fields, and name/avatar fallbacks for a user without
profile metadata.
2. Open a copyable field using both mouse and keyboard (Enter), choose
Copy, and check the clipboard value.
3. Open Raw JSON, scroll, and use the floating copy button. Confirm the
existing Logs tab still opens and Escape closes the user panel.

### Validation

- Final head `f4f8cb22e97fefac56c68b4676184d8358d8080e` targets master
without conflicts.
- Focused local tests: 13 passed across three files, retries disabled,
including independent shuffled seed 5084131. Real panel/MSW tests cover
field copying and complete nested JSON; fallback and Unicode regressions
detect the original broken behavior.
- Browser QA passed on `6b49434339`: nameless profile fallback, overview
fields, mouse/keyboard copying, Raw JSON scrolling/copying, existing
Logs tab, and Escape dismissal. Later commits change only the E2E test;
application code is identical.
- All GitHub checks passed on the final head, including four unit-test
shards, four Next/TanStack E2E shards, typecheck, formatting, lint
ratchet, knip, and Studio Docker build.
- Independent review found no remaining issues; all review threads are
resolved.
- Fresh final-head studio-staging preview is blocked during dependency
installation: the registry returns HTTP 451 for
`react-hook-form@7.72.1`. The earlier matching application preview
passed browser QA; this deployment failure remains visible.

### Stack

Based on the logs table building blocks stack, which merges first:
#50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in
order:

1. #50835 — grouped log overviews and raw JSON
2. #50840 — request correlation queries
3. #50836 — request timeline UI and folding
4. #50841 — shared Auth user details
5. #50837 — log user correlation and Auth activity

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-29 15:22:12 +01:00
Riccardo Busetti 6aed258d87 feat(migration): Move pipeline_id to string (#52489) 2026-10-29 15:16:51 +01:00
Monica Khoury 8bdc2bf0c5 feat(studio): refresh webhook deliveries on demand instead of polling (#52444)
## Problem

The deliveries table polled the API every 5 seconds, for as long as the
page was open. Studio tables are not polled by default, and polling is
only needed here because delivery results arrive asynchronously.

Stacked on #52314. Linear:
[FE-3750](https://linear.app/supabase/issue/FE-3750/add-pagination-to-platform-webhooks-deliveries-table)

## Solution

- Deliveries are no longer polled by default.
- A **Live** button turns polling on (every 5 seconds), and a
**Refresh** button reloads once.
- Polling also turns on by itself while a delivery is pending, and after
a test event or retry is sent until its delivery appears (30 seconds at
most). The action never looks like it did nothing.
- Hovering a failed delivery explains that failed deliveries are usually
retried automatically. The API returns no retry state yet, so a
scheduled retry only shows up once its attempt starts.

## Review instructions

1. Enable the Platform Webhooks feature preview, open an endpoint with
deliveries, and filter DevTools > Network by `deliveries`. No request
repeats on its own.
2. Click Refresh. One request is sent.
3. Click Live. A request is sent every 5 seconds and the dot pulses.
Click Live again and the requests stop.
4. Send a test event. Requests repeat for a few seconds until the new
row appears, then stop.
5. Set the endpoint URL to `https://httpbin.org/delay/10` and send a
test event. While the new row shows `pending`, requests repeat. Once it
shows `success`, they stop.
6. Hover a `failure` badge. The retry tooltip shows.
2026-10-29 12:44:44 +02:00
Coenen Benjamin 253d874e38 fix(warehouse): disallow warehouse installation on orioledb (#51913) 2026-10-29 11:31:54 +01:00
Drew McLellan 9b015c7427 feat(studio): allow setting a password when creating a role (#52463)
## Problem

The Create Role panel offers "User can login" but no way to set a
password, so a role created with login enabled can't authenticate with a
password until one is set elsewhere. The role SQL builder in `pg-meta`
already supports a password on create; the form just never sent one.

Resolves FE-4763.

## Solution

- Add an optional **Password** field to the Create Role panel, shown
only while "User can login" is on. It has a copy button and a "Generate
a password" action, matching how project creation handles database
passwords.
- Keep password optional. If the field is empty, or login is turned off
after typing one, the password is left out of the request, so behavior
is unchanged from today.
- Link the privilege switch labels to their switches (the label
previously pointed at a wrapper `div`), which also lets the new tests
find the switch by its label.
- Tests: a `pg-meta` case creating a role with a password containing
quotes, and component tests asserting the SQL sent for each of the four
password and login combinations.

Not in scope: editing or resetting an existing role's password. 

<img width="663" height="661" alt="Screenshot 2026-10-28 at 17 22 59"
src="https://github.com/user-attachments/assets/270fcfb4-4dc9-4dc1-b8e6-4141ee755ac2"
/>


## Review instructions

1. Open Database > Roles and click **Create role**.
2. Confirm no password field shows until you enable **User can login**.
3. Enable login, click **Generate a password**, then copy it with the
copy button, and create the role.
4. Confirm you can connect as the new role using that password.
5. Create another role with login enabled and the password left empty;
confirm it is created as before.
6. Click a switch label (for example "User can login") and confirm it
toggles the switch.

## 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-10-28 21:49:07 +00:00
Charis 19aa27384a feat(studio): guard branch creation with FGA grants (#52375)
Part 4 of 7 in a stack that splits #52331 into reviewable pieces.
Resolves part of
[FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal).
There are no functional changes beyond #52331, and the top of the stack
is identical to it. See #52331 for the full rationale.

## Stack
1. #52372 Grant infra for branch variants
2. #52373 Branches list query
3. #52374 Page gates on the list grant
4. 👉 #52375 Branch creation
5. #52376 Branch read, delete, reset, and restore
6. #52377 Branch update and push
7. #52378 Branch diff and merge

## Changes
The create mutation takes a grant. `CreateBranchButton`,
`CreateBranchModal`, and `Branch.Commands` (legacy `CREATE
preview_branches`) switch to `useGrant('POST
/v1/projects/{ref}/branches')`. "Include data" is disabled without
production create; previously it failed after you submitted. The GitHub
integration form gets a minimal production-create guard, which ##52377
replaces.

## Testing
New `CreateBranchButton` test.
2026-10-28 14:16:03 -04:00
4f75659942 feat(studio): show request timelines with ordered active log folding (#50836)
Add a Timeline tab that displays related request logs and opens a
selected step in the overview. The panel summary, timestamp, and
navigation controls follow the active log.

Long timelines show the first three steps and retain the active log in
its chronological position. Separate controls count hidden rows before
and after it, for example `+3 more`, the active log, then `+2 more`.
Expanding either control restores the full order. Query construction and
fetching are reviewed separately in #50840.

### How to test

1. With `otelUnifiedLogs` enabled, open a non-compute log with related
request activity and select Timeline. Check chronological order, then
select a step and confirm its overview and panel summary update.
2. Expand a long timeline, select a later step, and return to Timeline.
The active step should stay in order, with separate hidden counts above
and below. For nine steps with the seventh active, expect `+3 more`, the
active step, then `+2 more` after the first three steps. Expand using
both mouse and Enter.
3. If a long request is unavailable, run the deterministic
folding/navigation cases: `pnpm --filter studio exec vitest run
components/interfaces/UnifiedLogs/components/RequestTimeline.platform.test.tsx
components/interfaces/UnifiedLogs/components/LogTimeline.utils.test.ts`.

### Validation

- Focused local unit/MSW suite: 260 tests passed across 18 files with
`--retry=0 --sequence.shuffle --sequence.seed=5083605`.
- Browser QA verified a real five-step request timeline and folding.
Nine-step folding and active-log ordering were verified with
deterministic fixtures.
- All checks triggered on head `6b80811bae` passed.
- Master-only typecheck, unit, formatting, and lint workflows do not run
against this stack base. Rerun them when the PR is retargeted to
`master`.

### Stack

Based on the logs table building blocks stack, which merges first:
#50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in
order:

1. #50835 — grouped log overviews and raw JSON
2. #50840 — request correlation queries
3. #50836 — request timeline UI and folding
4. #50841 — shared Auth user details
5. #50837 — log user correlation and Auth activity

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-28 17:14:53 +01:00
supabase-vercel-tedd[bot] 91b780c7d7 feat(studio): layout-shaped loading state for compute instance detail (#52453)
Replaces the three generic shimmer bars on the Compute instance detail
page with a placeholder that follows the loaded layout.

**Why**

While the instance loads, the page showed three full-width bars with no
header, tabs or sections. When the data arrived, the whole page jumped
into a different shape.

**Approach**

A new `ComputeInstanceDetailSkeleton` reuses the same page primitives as
the loaded view (`PageBreadcrumbs`, `PageHeader`, `PageNav`,
`PageContainer`, `PageSection`) and the existing `ShimmeringLoader`, so
widths, padding and breakpoints match the real page:

- Breadcrumbs: the static Compute link, with a placeholder for the
instance name
- Header: a 56px icon placeholder, a title placeholder and three
metadata placeholders (state, runtime, version)
- Tabs: four placeholders sized like the tab labels
- Overview: the static Instances, Container and Resources section
headings, the ready-count line, the 2/4-column instance count grid, and
the container and resource rows

No instance values are shown until the data loads. On a non-overview tab
(`?tab=logs`, etc.), the content area falls back to the same
`GenericSkeletonLoader` the logs tab already uses. Data fetching, error
handling, the "instance does not exist" state and the loaded view are
unchanged.

**Validation**

- New `ComputeInstanceDetail.platform.test.tsx`: holds the instance
request open, checks that the placeholder renders (section headings,
breadcrumb link, no instance name, no tabs, no row labels), then
releases it and checks that the header, tabs, instance counts and
container rows render and the placeholder is gone. The existing Compute
tests still pass.
- `eslint` on the changed files: clean. `pnpm --filter studio lint`: 0
errors.
- `pnpm --filter studio typecheck` (`tsc --noEmit`) ran out of memory in
the sandbox (exit 137) twice, so it was not run to completion.

Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
2026-10-28 15:56:23 +01:00
Charis ce52277546 feat(studio): migrate branches list query to FGA grants (#52373)
Part 2 of 7 in a stack that splits #52331 into reviewable pieces.
Resolves part of
[FE-4693](https://linear.app/supabase/issue/FE-4693/pilot-migrate-branches-to-grants-8-endpoints-createbranchmodal).
There are no functional changes beyond #52331, and the top of the stack
is identical to it. See #52331 for the full rationale.

## Stack
1. #52372 Grant infra for branch variants
2. 👉 #52373 Branches list query
3. #52374 Page gates on the list grant
4. #52375 Branch creation
5. #52376 Branch read, delete, reset, and restore
6. #52377 Branch update and push
7. #52378 Branch diff and merge

## Changes
`useBranchesQuery` becomes `branchesQueryOptions`, which takes a grant,
uses `skipToken` without one, and keeps the grant out of the query key.
Every call site moves to `useGrant('GET /v1/projects/{ref}/branches')`.
Places that use the list incidentally (nav, project home, usage,
settings, GitHub status) treat a denied grant as "no branches" instead
of loading forever. Config drift no longer stays pending when its
prerequisites fail. Page gating is unchanged here and moves in the next
PR.

## Testing
Usage, General, `useGitHubConfigDrift`, and ConfigurationDriftPage
tests.
2026-10-28 09:45:43 -04:00
6612073428 feat(studio): add bounded request correlation queries (#50840)
Add tested query support for correlating logs by request and execution
IDs across API Gateway, Auth, Storage, and Edge Functions. Queries are
source-scoped, time-bounded, and limited to 200 rows, with at most one
additional lookup to follow a newly discovered execution ID.

This data-only layer introduces no UI or automatic requests. The
Timeline tab consumes its query options in #50836. Overview and request
correlation share a cached source-and-attributes lookup, including
concurrent requests. Cancelling a timeline preserves any shared overview
lookup. The new query is exercised through MSW without mocking React
Query hooks.

### How to test

This is a data-only PR. From the repository root, run:

```sh
pnpm --filter studio exec vitest run components/interfaces/UnifiedLogs/UnifiedLogs.queries.test.ts data/logs/unified-log-request-timeline-query.test.ts
```

The tests exercise source-scoped IDs, SQL escaping, time/row limits,
missing IDs, failed requests, the additional execution-ID lookup,
attribute-cache reuse in both navigation orders and concurrently, and
cancellation through MSW.

### Validation

- Synced with master; verified head
`a60bcf0565e0e3477779665660e871eec2edd2c8`.
- Focused unit/MSW baseline and shuffled seed 5084028: 121 tests across
seven files passed with retries disabled. Independent shuffled run, seed
5084029: 117 tests across six files passed.
- Correlation, shared lookup/cache, cancellation, and the 400-second
function boundary are covered. Behavioral mutation checks detect
shared-lookup cancellation and a shortened execution window.
- Matching studio-staging preview smoke check passed for existing
grouped overview attributes and complete copied Raw JSON metadata.
- All four unit-test shards, all four E2E shards, typecheck, formatting,
lint ratchet, knip, and Studio Docker build passed on this head.
- Independent review found no actionable issues; no unresolved review
threads.

### Stack

Based on the logs table building blocks stack, which merges first:
#50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in
order:

1. #50835 — grouped log overviews and raw JSON
2. #50840 — request correlation queries
3. #50836 — request timeline UI and folding
4. #50841 — shared Auth user details
5. #50837 — log user correlation and Auth activity

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-28 14:41:49 +01:00
Charis 6a27ccbe09 fix(studio): restore RLS permission checks for GitHub/Vercel integrations (#52385)
## Problem
Project-scoped admins see "You need additional permissions to view
GitHub connections" (and the same for Vercel) since #50966. That PR
moved these checks to `ORGANIZATION.CONFIG_READ`/`CONFIG_WRITE`, which
the v2 permissions API never grants to project-scoped members.

## Fix
The platform endpoints behind these views don't use OpenFGA:
- GitHub connections: list/update/delete are RLS-only; create uses
`canForProjectRef(READ, 'projects')`
- Vercel connections: create uses `canForProjectRef(CREATE,
'integrations.vercel_connections')`; the rest are RLS-only
- OAuth apps (installed integrations view):
`AuthWithOrganizationSlug(READ, 'oauth_apps')`

So this reverts #50966's changes in `GithubSection`,
`GitHubIntegrationConnectionForm`, `VercelSection`, `Landing.utils` and
`useInstalledIntegrations` back to `useAsyncCheckPermissions` with the
original resources, and updates
`MarketplaceIntegrationSettingsTab.test.tsx` to mock the v1 permissions
endpoint.

## Testing
- `MarketplaceIntegrationSettingsTab.test.tsx` and
`MarketplaceDetail.test.tsx` pass

Fixes FE-4751
2026-10-28 09:08:24 -04:00
671594c69c feat(studio): group log overviews and standardize raw JSON (#50835)
Logs without a service-specific overview now show common fields and
attributes in collapsible groups. Existing service overviews use the
same section layout, with the first section open. Configured fields
share one renderer across service overviews. Raw JSON uses shared
presentation for single-log, multi-log, and downstream Auth views, with
copy controls supplied by each view.

Attribute lookups are scoped to the selected log's source, ID, and
timestamp window and respect metadata visibility. It's based on the
#50953 stack; request correlation, timeline UI, and Auth changes are
separate layers. Sections use the `CollapsibleDetailSection` that master
now shares with the audit log pages, and the new Supavisor overview
follows the same layout: no separate time header, first section open.

### How to test

1. With Unified Logs and `otelUnifiedLogs` enabled, open an API Gateway
log and a Postgres or Auth log. Check the overview sections,
expand/collapse groups, and try copying a field.
2. Open Raw JSON on a log with enough metadata to scroll. Confirm the
copy button stays visible and copies the complete JSON.
3. Select multiple logs and confirm their combined JSON still renders
correctly.

### Validation

- Synced with master; verified head
`663ebfd13117ae3c5aa0de52e4488253a317d59f`.
- Focused local unit/MSW suite: 246 tests passed across 19 files with
retries disabled, both normally and with `--sequence.shuffle
--sequence.seed=50835`. Independent focused run: 24 tests passed with
seed 5083528.
- Browser QA on the matching studio-staging preview passed: API Gateway
and Postgres section expansion/collapse, field copying, scrolling and
copying complete Raw JSON, and copying multiple selected logs.
- All four unit-test shards, all four E2E shards, typecheck, formatting,
lint ratchet, and Studio Docker build passed. The Next.js E2E report
includes one storage-folder test that passed on retry.
- Independent code review found no actionable issues. Working tree
clean.

### Stack

Based on the logs table building blocks stack, which merges first:
#50953 → #50954 → #50955 → #50957 → #50958 → #52281. Then merge in
order:

1. #50835 — grouped log overviews and raw JSON
2. #50840 — request correlation queries
3. #50836 — request timeline UI and folding
4. #50841 — shared Auth user details
5. #50837 — log user correlation and Auth activity

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-28 14:07:04 +01:00
Monica Khoury d973267d27 feat(studio): paginate platform webhooks deliveries table by cursor (#52314)
## Problem

The deliveries table loaded one page from the API and split it into
pages of 5 in the browser, so older deliveries could not be reached.

Linear:
[FE-3750](https://linear.app/supabase/issue/FE-3750/add-pagination-to-platform-webhooks-deliveries-table)

## Solution

- **Cursor pagination:** the table requests deliveries 5 at a time
(`page[after]`), and Next and Previous load the next or previous page.
It asks for 6 and shows 5, so Next is never enabled on an empty page.
Previous uses the history of cursors we visited, because the API's
`prev` link can skip a row or land on an empty page.
- The footer reads "Showing N deliveries" (the API returns no total).
The delivery search still filters only the loaded page.
- **Loading and errors:** skeleton rows show while a page loads, and a
failed load shows an error with a Try again button instead of "No
deliveries found", and polling stops until you retry. If a later refresh
fails, the loaded rows stay with a notice that they may be out of date,
and polling continues.
- Retry and Send test event refresh every cached page of the endpoint's
deliveries. Switching endpoints starts again on page 1.
- Retry from the details sheet now works for a delivery that is not on
the current page.
- A pending delivery has no result yet, so its row no longer opens the
details sheet. Its Retry button is unchanged.
- Removed the "Attempt" field from the details sheet. It was the row's
position on the page, not an attempt number. A real one needs the API to
return it (CTRL-1974).

## Review instructions

1. Enable the Platform Webhooks feature preview, open an endpoint, and
send 7 test events (limited to 10 per minute).
2. Page 1 shows 5 deliveries, Previous is disabled and Next is enabled.
Next shows the other 2 and disables Next. Previous goes back to the
first 5.
3. On an endpoint with exactly 5 deliveries, both buttons are disabled.
4. In DevTools > Network, set throttling to "Slow 4G" and click Next.
Skeleton rows show. Then block the `deliveries` request and click Next.
"Failed to retrieve deliveries" shows with a Try again button. Wait 10
seconds: no new `deliveries` requests are sent. Unblock the request and
click Try again to load the rows. Also block the request while rows are
loaded: they stay, and an "Unable to refresh deliveries" notice appears
within about 5 seconds and clears once you unblock.
5. Open the details sheet from the bottom row of page 1. In a second
tab, send a test event and wait about 5 seconds. Click Retry delivery in
the first tab. A toast and a `POST .../retry` request appear, even
though the row has moved off page 1.
6. Set the endpoint URL to `https://httpbin.org/delay/10` and send a
test event. While the new row shows `pending` (about 10 seconds),
clicking it does nothing. Once it shows `success`, it opens the sheet.
2026-10-28 14:36:11 +02:00
Francesco SansalvadoreandClaude Sonnet 5 84115482be feat(studio): storage lifecycle policies UI (#52318)
## Problem

Lifecycle policies can only be set with an abstracted ui that hides the
actual underlying policies but the user can still modify the policies
via api, which would result in an un-documented drift from the policies
set via said abstracted ui.

## Solution

Show ui with list of effective policies applied and show if the policies
drifted in a way that is incompatible with the abstracted ui in the
"Create/Edit bucket modal".

<img width="1489" height="800" alt="Screenshot 2026-10-26 at 18 35 39"
src="https://github.com/user-attachments/assets/9e64f123-c06e-4cfe-9dba-839fae61c845"
/>

<img width="1439" height="847" alt="Screenshot 2026-10-26 at 18 35 50"
src="https://github.com/user-attachments/assets/a32d3a27-6719-48b3-abd2-fb134158bd96"
/>

<img width="654" height="316" alt="Screenshot 2026-10-26 at 18 36 38"
src="https://github.com/user-attachments/assets/0710c139-9b64-42f7-b410-c1a351b1f616"
/>

This PR also updates copywriting around the effects procured by the
lifecycle policies settings in the bucket settings modal.

<img width="704" height="440" alt="Screenshot 2026-10-26 at 18 35 17"
src="https://github.com/user-attachments/assets/f4fa03d1-e11b-4d08-b4f5-d94b2d9350a3"
/>

<img width="351" height="82" alt="Screenshot 2026-10-26 at 18 35 28"
src="https://github.com/user-attachments/assets/6ff1e149-92e0-4fd8-bfb5-0177afe207aa"
/>

## To review

- create a file storage bucket, enable object versioning and set some
lifecycle policy values
- once created, go to /project/_/storage/files/policies and find the
bucket policies or navigate to it from the "Edit bucket settings" via
the "View rules" button
<img width="1133" height="725" alt="Screenshot 2026-10-27 at 14 50 52"
src="https://github.com/user-attachments/assets/ef014f7a-5db6-413a-af53-a5648309b2c3"
/>
- adding extra policies should result in a "This bucket has a custom
lifecycle policy" message in the edit bucket modal

<img width="557" height="130" alt="Screenshot 2026-10-27 at 14 52 23"
src="https://github.com/user-attachments/assets/cde29748-65d9-45b5-a54b-55737d78d311"
/>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-28 11:43:00 +01:00
d4b9d1240c refactor(studio): remove the legacy edge function overview (#52281)
The `edgeFunctionsOverview` flag is fully rolled out, so the edge
function Overview page now always renders the new Overview. This removes
the legacy Overview and everything only it used.

- **Overview page**: renders `EdgeFunctionOverview` directly, like the
other function tabs. The flag check and the loader shown while flags
load are gone.
- **`EdgeFunctionRecentInvocations`** and its utils: only the legacy
Overview showed this list.
- **`components/ui/Charts/AreaChart`**: the legacy Overview was its last
importer. The other `AreaChart` uses are recharts' own.

**Self-hosted:** flags never load off-platform, so self-hosted Studio
always got the legacy Overview. Its Overview tab is already hidden, and
the new Overview sends a direct visit to the Details tab, so nothing
reachable from the UI changes.

After this ships, the `edgeFunctionsOverview` flag can be deleted in
ConfigCat.

### How to test

1. Open an edge function's Overview on platform. It shows the new
Overview, with no loader flash while flags load.
2. Self-hosted: open `/project/default/functions/<slug>` directly. It
redirects to the Details tab.

### Validation

- Studio typecheck, lint, Prettier and knip pass on this layer.
Functions and Charts unit tests pass.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-28 09:19:25 +01:00
7f7ebf527b feat(studio): use shared logs table for recent function errors (#50958)
The Overview's "Errors in the last 24h" section now uses the Logs tab's
queries (#50954) and the read-only `EmbeddedLogsTable` (#50953) instead
of its own SQL and table. It previews the latest five errors since the
last deploy, capped at 24h, shows "+N more" when there are more and
links to the rest. It's behind the `edgeFunctionsOverview` flag, like
the rest of the new Overview.

- Rows have no multi-select checkbox. Clicking one opens it in the Logs
tab with the same range and error filter, and "View logs" and "+N more"
open the filtered list.
- With the unified logs preview off, those links open the pre-unified
Invocations tab (for invocation rows) or Logs tab (for runtime rows),
using those tabs' own `its`/`ite`/`log` params.
- "Explain with AI" and "Copy summary" send the previewed errors to the
Assistant with the same prompt as selected logs on the Logs page. The
prompt also notes how many errors were left out.
- One count query, scoped to the function and unfiltered, gives both the
error count behind "+N more" and the invocations since the deploy, from
its level and log type facets. It replaces the hand-built invocation
count SQL, so the section runs two queries instead of three.
- The row query fetches only the five errors shown, through a new
`pageSize` option on `useUnifiedLogsInfiniteQuery`.
- The section uses the edge function preset from #50957, so it runs the
Logs tab's scoped queries and shares its saved columns.
- The custom error grouping and its SQL are removed. Net, the PR removes
about 390 lines.

### How to test

1. With `edgeFunctionsOverview` on, open a function that has recent
errors. You should see up to five rows without checkboxes, and "+N more"
when there are more.
2. Click a row with the unified logs preview on. It opens the Logs tab
with that log selected. Turn the preview off and click an invocation row
and a runtime row. They open Invocations and Logs respectively.
3. Use Explain with AI and Copy summary and check the prompt.
4. For a function with no errors since the last deploy, the section
shows the invocation count instead.

### Validation

- MSW component tests: preview rows and "+N more", no checkboxes, the
summary prompt, row links with the preview on and off, and the no-errors
state. They also check the row query asks for five rows and that a
single unfiltered count runs. `pageSize` and the facet count helper have
unit tests.
- Studio typecheck, lint ratchet, Prettier and knip pass on this layer.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-27 16:47:51 +01:00
5d52b00f70 feat(studio): combine function invocations and logs (#50957)
With the unified logs preview on, an edge function's Logs tab renders
the unified logs view scoped to that function (#50954), with its
invocations and runtime output in one list. That replaces the separate
Invocations and Logs tabs.

- `UnifiedLogs` takes a `scope` plus view props: `hasFilterSideBar`,
`offeredFilters` and `columnPreferencesKey`. The function Logs tab turns
the sidebar off, which also drops the filters-toggle shortcut, and saves
its columns and panel layout separately from the Logs page.
- `getEdgeFunctionLogsScope` and `EDGE_FUNCTION_LOGS_VIEW` are the edge
function preset: the scope's fixed filters, the filters the tab offers
and its saved-columns key. It offers date, log type, level and message,
so no user filter, since no function row has a user.
- The Invocations tab and its shortcut are hidden. Old Invocations links
redirect to Logs, converting `its`/`ite`/`log` to `date`/`id`.
- `getEdgeFunctionLogsUrl` builds links into the scoped tab with the
shared params serializer from #50953, and clicking a bar on the
invocations chart uses it.

With the preview off, both tabs work as on master.

### How to test

1. Turn on the unified logs preview and open an edge function's Logs
tab. You should see only that function's invocations and runtime logs,
with the filter bar limited to date, log type, level and message.
2. Filter to Edge Function runtime, then to errors, and check counts and
the chart follow.
3. Open an old `/functions/<slug>/invocations?its=…&ite=…&log=…` link.
It lands on Logs with the same range and log selected.
4. Click a bar on the Overview invocations chart. The Logs tab opens on
that bucket.

### Validation

- URL helper, offered filter and preset tests, plus the scoped query
tests from #50954.
- Studio typecheck, lint ratchet, Prettier and knip pass on this layer.

### Stack

Merge in order:

1. #50953 — reusable logs table building blocks
2. #50954 — function-scoped unified logs queries
3. #50955 — slimmer function detail layout, header on Overview
4. #50957 — Invocations merged into a function-scoped Logs tab
5. #50958 — Overview errors in the shared logs table
6. #52281 — remove the legacy Overview

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2026-10-27 14:54:56 +01:00