Repository navigation
[pull] master from supabase:master - #1275
Merged
Merged
Conversation
Somewhat urgent update to documentation based on new AWS behavior. Will include additional details when we properly support custom DNS for privatelink <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated the PrivateLink endpoint creation guide’s Option A steps and numbering. The DNS record note now stands on its own, without referencing a removed step. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
#50756) <!-- ccr-slack-attribution --> _Requested by **Saxon Fletcher** · [Slack thread](https://supabase.slack.com/archives/C051L8U2EJF/p1789995309253479?thread_ts=1789995309.253479&cid=C051L8U2EJF)_ Resolves AI-1246 ## Problem **Before:** The Assistant's `list_policies` tool fails in about 70% of traces. It only "succeeds" when the org has AI opt-in disabled, because then it returns the privacy stub and never makes a request. When opt-in is enabled, it runs the pg-meta query server-side with no `Authorization` header, so the request is unauthenticated and fails. The Assistant then falls back to `execute_sql`. **After:** `list_policies` sends the caller's `Authorization` header, the same way `execute_sql` in `studio-tools.ts` already does, so it returns the project's RLS policies. ## Solution `getTools` already receives `authorization` but didn't pass it to `getSchemaTools`. This PR passes it through. `list_policies` builds `{ Authorization }` from it, and `getDatabasePolicies` gets an optional `headersInit` argument that it forwards to `executeSql`, the same pattern `getDatabaseFunctions` uses. Existing client-side callers of `getDatabasePolicies` don't change. Files: `lib/ai/tools/index.ts`, `lib/ai/tools/schema-tools.ts`, `data/database-policies/database-policies-query.ts`, plus tests in `lib/ai/tools/schema-tools.test.ts` (new) and `lib/ai/tools/index.test.ts`. ## Review instructions 1. Read `schema-tools.ts` and compare it with the `authHeaders` handling in `studio-tools.ts` (`execute_sql`). 2. On the preview, use an org with AI opt-in set to at least "schema" and ask the Assistant to list the RLS policies on `public`. `list_policies` should return the policies without falling back to `execute_sql`. Local gates (all passed): - `pnpm typecheck` in `apps/studio` (next typegen + `tsc --noEmit`) - `npx eslint` on touched files: 0 errors. The 2 warnings are on lines this PR doesn't change. - `npx vitest run lib/ai/tools/schema-tools.test.ts lib/ai/tools/index.test.ts lib/ai/tool-filter.test.ts`: 24/24 passed. I also ran the new header test against the old `schema-tools.ts` and it failed, as expected. - `SORT_IMPORTS=false npx prettier --config prettier.config.mjs --check` on touched files Follow-up, not in this PR: `getRlsKnowledge` in `fallback-tools.ts` (self-hosted path) also calls `getDatabasePolicies` without headers, even though a `headers` object is already in scope there. ## AI disclosure Claude Code (agent) wrote this PR from the Slack request. @SaxonF (Saxon Fletcher) is the accountable human owner. A human needs to review it before merge. ## 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 (N/A, no docs changes) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0171Mk7SiKYLDDoAQvbDYfeK --- _Generated by [Claude Code](https://claude.ai/code/session_0171Mk7SiKYLDDoAQvbDYfeK)_ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
## 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? Update humans text - new joiner Bug fix, feature, docs update, ... ## What is the current behavior? Please link any relevant issues here. ## What is the new behavior? Feel free to include screenshots if it includes visual changes. ## Additional context Add any other context or screenshots. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Added Carson Adam to the team member listing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Problem
The Management API now has `/v2/projects/{ref}/notebooks`, gated by the
new `project_notebooks_read` / `project_notebooks_write` FGA
permissions. Studio pins `@supabase/shared-types` 0.1.95, which predates
them, so the scoped access token form can't grant them. Tokens created
with every permission selected still get `403 forbidden` on the notebook
endpoints.
## Solution
- Bump `@supabase/shared-types` to 0.1.96 (Studio and shared-data),
which publishes the notebook permissions.
- Add a **Notebooks** entry to the permission catalog (Project category,
next to SQL Snippets).
- Add minimum roles to `FGA_SCOPE_MINIMUM_ROLE`: read is `readonly`,
write is `developer`, matching the OpenFGA model.
The docs permission tables don't change yet. They're built from the
docs' checked-in v2 spec, which doesn't include the notebook endpoints,
so the row appears on the next spec sync.
## Review instructions
1. In the preview, go to **Account → Access Tokens** and create a scoped
token for a project. Check that **Notebooks** is listed under Project,
and set it to Read-write.
2. List notebooks with the new token:
```bash
curl -s -H "Authorization: Bearer $TOKEN"
"https://api.supabase.com/v2/projects/$REF/notebooks"
```
It should return `200` with `{ "links": ..., "data": [...] }`, not
`403`.
3. Optional: create a token with Notebooks set to None, repeat step 2,
and check it returns `403`.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Added project-level notebook permissions to access tokens.
- Access tokens can now grant read-only or developer-level access for
managing shared project notebooks.
- Project notebook permissions are displayed in the token creation
interface and supporting documentation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Problem Mike Podobnik is missing from the team list in `apps/docs/public/humans.txt`. ## Solution Add Mike Podobnik between Michelle Jubrey and Miranda Limonczenko, preserving alphabetical placement and the existing plain-text format. ## Review instructions 1. Confirm the diff adds only `Mike Podobnik`. 2. Verify the name appears between Michelle Jubrey and Miranda Limonczenko. ## Validation - `git diff --check` passes. - Verified a single insertion, no deletions, and correct alphabetical placement between the adjacent entries. - Build and application tests skipped for this static text-only addition. The repository's Prettier check does not include `.txt` files. ## Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md). - Docs topic authoring checklist is not applicable: this change only adds a name to a plain-text team list. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added Mike Podobnik to the team listing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
## Problem API type changes still use the api-deploy-required label and an informational comment even though production verification has proven reliable enough to block merges. ## Fix Remove the obsolete API label path, scope the remaining labeler workflow to docs changes, and update the API-types guidance. Master branch protection now requires the app-bound verify-production-api-types check. ## How to test - Confirm the labeler workflow only runs for changes under apps/docs. - Confirm API type changes no longer receive the api-deploy-required label or comment. - Confirm master branch protection lists verify-production-api-types as a required GitHub Actions check. - Expected result: production API type verification blocks mismatched generated types while unrelated pull requests receive a successful skipped verification job. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * API type verification is now a required merge check; guidance to run it before review and treat failures as production drift remains. * Removed the API deployment label rule and the automated comment triggered when that label was applied. * The pull request labeling workflow now runs only for changes affecting the documentation app. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Problem PR #50638 migrates API Gateway and Data API reports to OTEL, but the shared Auth and Realtime metrics still select legacy BigQuery SQL and the `logs.all` endpoint. ## Fix Route all active hosted shared API reports through the existing OTEL builders after feature flags load. Remove unused report variants and their source-selection abstraction while preserving the legacy BigQuery path for self-hosted Studio. This PR is stacked on #50638. ## How to test - Open the Auth observability report and confirm its seven shared metric requests use `logs.all.otel` with a `/auth` request-path filter. - Open the Realtime observability report and confirm its seven shared metric requests use `logs.all.otel` with a `/realtime` request-path filter. - Open the Data API report and confirm its existing OTEL behavior remains unchanged with a `/rest` request-path filter. - Expected result: hosted reports wait for ConfigCat before querying, while self-hosted Studio continues using the legacy BigQuery path. - Run `./apps/studio/node_modules/.bin/vitest --run apps/studio/components/interfaces/Reports/Reports.constants.otel.test.ts --config apps/studio/vitest.config.ts`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Changes** - Shared API reports now support filtering by Auth, Realtime, and PostgREST traffic. - Filters for Storage, GraphQL, Functions, and other previously supported traffic types are no longer available. - Report queries now consistently use edge log data, improving consistency across request totals, routes, errors, response times, and network traffic metrics. - OpenTelemetry-backed reporting is now enabled consistently across supported report types where available. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
) ## Summary Fixes [FE-3987](https://linear.app/supabase/issue/FE-3987/contact-support-pre-fills-the-wrong-supabase-project-id): the "Contact support" button shown in the Table Editor's inline error banner (e.g. "Failed to retrieve rows from table") didn't pass the current project or organization to the support form. This caused the support form to fall back to the user's first organization/project instead of the one actually affected — especially noticeable when the Management API request used to resolve the org also fails. ## Test plan - [ ] Open a project in Studio, go to **Table Editor**, open a table. - [ ] Trigger a failing table query — either block the `rest/v1/<table>` request in DevTools, or apply a filter with a mismatched type (e.g. `id = 'abc'` on an int column). - [ ] On the inline red "Failed to retrieve rows from table" banner, click **Contact support**. - [ ] Confirm the support form pre-fills the **correct organization and project** — the one the failing table actually belongs to. - [ ] Repeat with a project belonging to an organization that is *not* first in your org list, to confirm it's not coincidentally correct. - [ ] Repeat while simulating a Management API failure (e.g. block `api.supabase.com`/`*.supabase.co/platform/*`) to confirm the org still resolves correctly via the `orgSlug` fallback instead of silently defaulting to your first org. - [ ] Sanity check other "Contact support" entry points (header Feedback dropdown, Help sidebar) are unaffected — they use a separate, already-correct code path. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved error handling when project details cannot be loaded, preserving relevant project and organization context. * Improved fallback behavior for identifying the correct organization when project information is unavailable or unresolved. * Support requests opened from error messages now include applicable project and organization information. * Error messages now consistently display available additional actions alongside contact support options. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )