Skip to content

fix(api): keep annotated binary request bodies typed as BinaryInput - #7443

Merged
avallete merged 2 commits into
developfrom
avallete/api-binary-body-codegen
Nov 2, 2026
Merged

avallete merged 2 commits into
developfrom
avallete/api-binary-body-codegen

Conversation

@avallete

@avallete avallete commented Nov 2, 2026

Copy link
Copy Markdown
Member

The Management API spec now describes the ESZIP update-function body through a shared component that carries a description and contentEncoding. The generator only rewrote a bare { format: "binary" } annotation to BinaryInput, so this body regenerated as Schema.String and rejected Uint8Array/ArrayBuffer/Blob uploads (breaking functions deploy).

The sanitizer now reduces binary string schemas to their type and format, so they keep generating as BinaryInput. Generated output on develop is unchanged; this unblocks the API sync in #7418, which still needs its v2 PostgREST config fixture updated for the new db_pool_max_lifetime/db_pool_max_idletime fields.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avallete
avallete requested a review from a team as a code owner November 2, 2026 14:57
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit f3a5904 against develop at 3624bb3 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 203 ms 201 ms no real change
supabase --help help 174 ms 179 ms no real change
supabase init init 236 ms 252 ms no real change (+7%, within normal variation)
supabase migration new bench migration-new 251 ms 256 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 372 ms 407 ms no real change (+9%, within normal variation)
supabase projects list projects-list 398 ms 425 ms no real change (+7%, within normal variation)
supabase functions list --project-ref replayfixtureprojref functions-list 385 ms 383 ms no real change

API calls: unchanged for all 7 commands.

Binary size: 134.0 MB, unchanged.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 170-245 ms 169-244 ms -1 ms (-1%) within noise
supabase --help help 166-309 ms 166-329 ms +5 ms (+3%) within noise
supabase init init 213-293 ms 206-314 ms +16 ms (+7%) within noise
supabase migration new bench migration-new 199-305 ms 216-345 ms +6 ms (+2%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 297-453 ms 324-447 ms +35 ms (+9%) within noise
supabase projects list projects-list 346-504 ms 310-480 ms +27 ms (+7%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 299-420 ms 334-456 ms -2 ms (-1%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Confirmed both Claude findings: binary normalization drops nullability, and the annotation regression lacks a focused test. The nullability issue does not affect the current committed binary schemas. Codex reported no findings.

Findings

Severity Location Category Sources Claim
🟡 MINOR packages/api/scripts/generate.ts:312 correctness claude Binary normalization discards nullable: true, causing nullable binary values to generate as non-nullable schemas.
🟡 MINOR packages/api/scripts/generate.ts:310 test-coverage claude No focused test covers a binary schema with a description, so removing this fix would not fail the existing binary generator test.

Stats

Claude findings: 2 · Codex findings: 0 · Confirmed: 2 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread packages/api/scripts/generate.ts Resolved
Comment thread packages/api/scripts/generate.ts Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avallete
avallete added this pull request to the merge queue Nov 2, 2026
Merged via the queue into develop with commit 02398c6 Nov 2, 2026
57 checks passed
@avallete
avallete deleted the avallete/api-binary-body-codegen branch November 2, 2026 15:13
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