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

supabase / supabase / 41651472973
87%

Build:
DEFAULT BRANCH: master
Ran 03 Nov 2026 02:18PM UTC
Jobs 1
Files 186
Run time 1min
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: 86.783%. Remained the same
41651472973

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)

1986 of 2356 branches covered (84.3%)

Branch coverage included in aggregate %.

2794 of 3152 relevant lines covered (88.64%)

195.87 hits per line

Subprojects
ID Flag name Job ID Ran Files Coverage
1 studio-tests 41651472973.1 03 Nov 2026 02:18PM UTC 744
37.65
GitHub Action Run
Source Files on build 41651472973
  • Tree
  • List 186
  • Changed 153
  • Source Changed 0
  • Coverage Changed 153
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #41651472973
  • 9b7cbd18 on github
  • Prev Build on master (#41649428791)
  • Next Build on master (#41658753659)
  • 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