• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase / 41651472973 / 1 – studio-tests
87%
master: 87%

Build:
DEFAULT BRANCH: master
Ran 03 Nov 2026 02:18PM UTC
Files 744
Run time 19s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Nov 2026 02:12PM UTC coverage: 37.645%. Remained the same
studio-tests – 41651472973.1

push

github

web-flow
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 branc... (continued)

3109 of 9424 branches covered (32.99%)

Branch coverage included in aggregate %.

5185 of 12608 relevant lines covered (41.12%)

48.97 hits per line

Source Files on job studio-tests - 41651472973.1
  • Tree
  • List 744
  • Changed 153
  • Source Changed 0
  • Coverage Changed 153
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 41651472973
  • 9b7cbd18 on github
  • Prev Job for on master (#41649428791.1)
  • Next Job for on master (#41658753659.1)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc