Skip to content

test(studio): cover Supabase API key formats in project client tests#47960

Merged
mandarini merged 1 commit into
masterfrom
test/studio-api-key-shapes
Jul 15, 2026
Merged

test(studio): cover Supabase API key formats in project client tests#47960
mandarini merged 1 commit into
masterfrom
test/studio-api-key-shapes

Conversation

@mandarini

@mandarini mandarini commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Adds a contract test that runs createProjectSupabaseClient() against the real @supabase/supabase-js for each Supabase API key format (temporary, publishable, secret, legacy JWT), asserting that client construction succeeds. Also replaces the placeholder key fixtures in the existing unit tests with realistically shaped ones. Previously the tests mocked the SDK entirely and used keys that don't resemble real formats, so an SDK version that rejects a valid key at construction (as @supabase/supabase-js 2.110.4 and 2.110.5 did, reverted in #47945 and fixed in supabase/supabase-js#2526) passed CI unnoticed; with this test, such a regression fails on the dependency bump PR itself.

Summary by CodeRabbit

  • Tests
    • Added coverage confirming project clients work with temporary, publishable, secret, and legacy API key formats.
    • Updated test scenarios to use realistic temporary API key values.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio-self-hosted Ready Ready Preview, Comment Jul 15, 2026 10:52am
studio-staging Ready Ready Preview, Comment Jul 15, 2026 10:52am
5 Skipped Deployments
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jul 15, 2026 10:52am
design-system Skipped Skipped Jul 15, 2026 10:52am
docs Skipped Skipped Open in v0 Jul 15, 2026 10:52am
ui-library Skipped Skipped Jul 15, 2026 10:52am
zone-www-dot-com Skipped Skipped Open in v0 Jul 15, 2026 10:52am

Request Review

@supabase

supabase Bot commented Jul 15, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2eb397b0-8d0d-43c7-a2aa-b530daeae11f

📥 Commits

Reviewing files that changed from the base of the PR and between b02ad91 and 16449e8.

📒 Files selected for processing (2)
  • apps/studio/lib/project-supabase-client.contract.test.ts
  • apps/studio/lib/project-supabase-client.test.ts

📝 Walkthrough

Walkthrough

Changes

Supabase client tests

Layer / File(s) Summary
Key format contract and test fixtures
apps/studio/lib/project-supabase-client.contract.test.ts, apps/studio/lib/project-supabase-client.test.ts
Adds parameterized coverage for temporary, publishable, secret, and legacy JWT keys, and replaces existing temporary key fixtures with nonce/payload-formatted values.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required template sections, including the CONTRIBUTING acknowledgement, change type, current behavior, new behavior, and additional context. Rewrite it to follow the template with YES/NO acknowledgement, change type, current behavior, new behavior, and any additional context or linked issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding coverage for Supabase API key formats in project client tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/studio-api-key-shapes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mandarini
mandarini marked this pull request as ready for review July 15, 2026 10:57
@mandarini
mandarini requested a review from a team as a code owner July 15, 2026 10:57
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results (next)

passed  237 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  243 tests across 28 suites
duration  5 minutes, 8 seconds
commit  16449e8

Flaky tests

Features › column-editor-types.spec.ts › column editor complex types › FK selector allows and creates a relation between two matching array columns

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@mandarini mandarini self-assigned this Jul 15, 2026
@mandarini
mandarini merged commit 069051b into master Jul 15, 2026
38 of 39 checks passed
@mandarini
mandarini deleted the test/studio-api-key-shapes branch July 15, 2026 12:57
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1784120392)

Score Average Improvements Regressions
Knowledge Usage 97.4% - -
SQL Identifier Quoting 100% - -
SQL Validity 100% - -
Tool Usage 72.5% - -
Time_to_first_token 3.07tok (+0.28tok) 11 🟢 18 🔴
Llm_calls 3.22 (+0.52) 20 🟢 5 🔴
Tool_calls 3.18 (+0.22) 13 🟢 7 🔴
Errors 5.28 (+0.83) 1 🟢 17 🔴
Llm_errors 0 (+0) - -
Tool_errors 0 (+0) - -
Prompt_tokens 23216.02tok (+482.44tok) 12 🟢 13 🔴
Prompt_cached_tokens 7803.59tok (+594.39tok) 14 🟢 8 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 615.14tok (+48.64tok) 13 🟢 16 🔴
Completion_reasoning_tokens 103tok (-6.32tok) 13 🟢 13 🔴
Total_tokens 23831.16tok (+531.08tok) 14 🟢 15 🔴
Estimated_cost 0$ (+0$) 12 🟢 15 🔴
Duration 17.28s (+1.3s) 11 🟢 18 🔴
Llm_duration 11.67s (+0.43s) 15 🟢 14 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants