Skip to content

fix(cli): classify functions deploy failures by their cause (CLI-2910) - #7510

Merged
Coly010 merged 2 commits into
developfrom
columferry/cli-2910-functions-deploy-crashes-with-an-unhandled-aggregateerror
Nov 5, 2026
Merged

Coly010 merged 2 commits into
developfrom
columferry/cli-2910-functions-deploy-crashes-with-an-unhandled-aggregateerror

Conversation

@Coly010

@Coly010 Coly010 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Two functions deploy failures were reported to telemetry as internal bugs even though both are typed failures with a known cause. A multi-function API deploy now fails with FunctionsDeployFailedError, classified by the failure it wraps. A malformed deno.json or import map now counts as invalid config.

What changed

  • deployViaApi collects each function's upload failure, plus the bulk update failure, into a FunctionsDeployFailedError instead of a native AggregateError.
    • It extends AggregateError, so errors, the joined message and instanceof AggregateError are unchanged.
    • Its classification comes from its most severe cause, ranked internal bug, then unclassified, then external service, then user-actionable, so a user error never masks a CLI or upstream failure. For example, a deploy whose uploads all fail with 401 becomes error:FunctionsDeployFailedError:auth (user_actionable). With no causes it falls back to unknown, not internal_bug.
  • FunctionImportMapSyntaxError gets the invalidConfig classification and its own fingerprint, error:FunctionImportMapSyntaxError. It still reports name: "SyntaxError".

Behaviour change

Telemetry only. These failures stop counting as internal bugs and are bucketed by their real cause. Messages, exit codes and JSON error.code (UnknownError) are unchanged.

Linked issue

None (Linear CLI-2910)

A multi-function API deploy reported its collected per-function failures
as a native AggregateError, which telemetry counted as an internal bug
regardless of the actual cause. It now fails with FunctionsDeployFailedError,
classified by its first typed cause.

A malformed deno.json or import map raised FunctionImportMapSyntaxError
with no classification, so it was also counted as an internal bug. It now
classifies as invalid config.

Messages, exit codes and the JSON error code are unchanged.
@Coly010
Coly010 requested a review from a team as a code owner November 5, 2026 12:13
@Coly010
Coly010 requested a review from kanadgupta November 5, 2026 12:13
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit dde6420 against develop at 3217fb4 · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 209 ms 236 ms no real change (+13%, within normal variation)
supabase --help help 215 ms 209 ms no real change
supabase init init 212 ms 204 ms no real change
supabase migration new bench migration-new 211 ms 213 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 244 ms 234 ms no real change
supabase projects list projects-list 216 ms 225 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 215 ms 215 ms no real change

API calls: unchanged for all 7 commands.

Binary size: 134.7 MB, unchanged.

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

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 196-245 ms 209-324 ms +27 ms (+13%) within noise
supabase --help help 187-232 ms 194-254 ms -6 ms (-3%) within noise
supabase init init 199-223 ms 188-266 ms -7 ms (-4%) within noise
supabase migration new bench migration-new 197-226 ms 187-305 ms +2 ms (+1%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 220-296 ms 223-277 ms -10 ms (-4%) within noise
supabase projects list projects-list 193-287 ms 205-250 ms +9 ms (+4%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 195-284 ms 196-243 ms +0 ms (+0%) 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

Both independent reviews reported no findings. Reading all changed files and the surrounding deployment, telemetry classification, and error normalization code revealed no concrete defects. The changes preserve deploy messages and JSON error codes while correcting telemetry classification. Tests were inspected but could not be run because dependencies are not installed.

Findings

No issues found.

Stats

Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · 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.

@Coly010 Coly010 self-assigned this Nov 5, 2026
…LI-2910)

A multi-function deploy that failed for different reasons took its
classification from whichever cause came first, so a user error could
hide an unclassified, upstream or CLI failure depending on function
order. The wrapper now reports its most severe cause: internal bug,
then unclassified, then external service, then user-actionable.
@Coly010
Coly010 added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 5, 2026
@Coly010
Coly010 added this pull request to the merge queue Nov 5, 2026
Merged via the queue into develop with commit f530933 Nov 5, 2026
107 of 118 checks passed
@Coly010
Coly010 deleted the columferry/cli-2910-functions-deploy-crashes-with-an-unhandled-aggregateerror branch November 5, 2026 15:23
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