Skip to content

feat(workers): bring the command family's output onto one shape - #6389

Open
johnstonmatt wants to merge 2 commits into
FUNC-840/select-workers-new-namefrom
FUNC-851/general-output-polish
Open

feat(workers): bring the command family's output onto one shape#6389
johnstonmatt wants to merge 2 commits into
FUNC-840/select-workers-new-namefrom
FUNC-851/general-output-polish

Conversation

@johnstonmatt

Copy link
Copy Markdown
Contributor

Summary

The workers commands each grew their own way of saying "here is what happened" and "here is what to run next". This settles them on the shapes the rest of the legacy shell already uses. No command changes what it does — this is output, plus the coverage that pins it.

  • Success trailers. "What to run next" lines in new, push, delete and status move to emitSuccessTrailer, the way stop, bootstrap, migration repair and gen signing-key already emit theirs: printed once at the end of the run rather than inline, so a multi-worker push does not bury each worker's hint under the next worker's output. The commands within them are aqua'd.
  • list advisories. Both take the yellow WARNING: prefix and the two-line consequence shape start's Docker notice uses. Each was one long sentence that re-flowed at a different width, directly under a table that lines its columns up.
  • list drops the URL column. Every worker's URL is the same host and prefix with the name on the end, and carrying it pushed the table past 130 columns for one derivable field — renderGlamourTable sizes each column to its widest cell and never wraps. status still renders it vertically, and every machine format still carries url per worker.
  • push progress. Per-worker announcements are counted (Deploying Worker 1/2:) and a multi-worker run closes with a summary. Each worker takes minutes; the name alone said nothing about how much of the run was left.
  • push names what it never attempted. The loop stops at the first failure and the error only names the worker that broke, leaving the rest to be reconstructed from argument order. On stderr in every format, machine ones included: that run is a CI run.
  • --project-ref survives into push's retry suggestions, via the legacyWorkersProjectRefSuffix helper status and delete already use. A suggestion is copy-pasted verbatim, so one that dropped it re-resolved against whatever this checkout was linked to.

Also adds unit coverage for legacyRenderWorkerDetails, pins the shared -o env refusal, and adds a guard (own commit) asserting no legacy boolean flag ships required — Flag.boolean alone builds a required param, and nothing in the existing suites notices.

Stack

Stack 6, on top of workers new name prompt (#6349). --wait (#6371) now sits on top of this, so the output work can ship independently of it.

Linked issue

FUNC-851. Supabase maintainer, exempt from the open-for-contribution flow.

Checklist

The workers commands each grew their own way of saying "here is what happened"
and "here is what to run next". This settles them on the shapes the rest of the
legacy shell already uses, with no change to what any command does.
- "What to run next" lines in `new`, `push`, `delete` and `status` move to
`emitSuccessTrailer`, the way `stop`, `bootstrap`, `migration repair` and
`gen signing-key` already emit theirs: printed once at the end of the run
rather than inline, so a multi-worker push does not bury each worker's hint
under the next worker's output. The commands within them are aqua'd, as every
other follow-up hint in this shell writes them.
- `list`'s two advisories take the yellow `WARNING:` prefix and the two-line
consequence shape `start`'s Docker notice uses. Each was one long sentence
that re-flowed at a different width under a table that lines its columns up.
- `list` drops the URL column. Every worker's URL is the same host and prefix
with the name on the end, and carrying it pushed the table past 130 columns
for one derivable field, since `renderGlamourTable` sizes to the widest cell
and never wraps. `status` still renders it vertically, and every machine
format still carries `url` per worker.
- `push` counts its per-worker announcements (`Deploying Worker 1/2:`) and
closes a multi-worker run with a summary line. Each worker takes minutes; the
name alone said nothing about how much of the run was left.
- `push` names the workers a failed run never attempted. The loop stops at the
first failure and the error only names the worker that broke, leaving the
rest to be reconstructed from argument order. On stderr in every format,
machine ones included: that run is a CI run.
- Both of `push`'s retry suggestions carry an explicit `--project-ref` when the
flag supplied the ref, via the `legacyWorkersProjectRefSuffix` helper `status`
and `delete` already use. A suggestion is copy-pasted verbatim, so one that
dropped it re-resolved against whatever this checkout was linked to.
Adds unit coverage for `legacyRenderWorkerDetails`'s padding and empty-row
dropping, and pins the shared `-o env` refusal so a new command that forgets
its own up-front check cannot silently emit TOML instead.
`Flag.boolean(name)` builds a bare `Single` param, and a bare `Single` is
*required* — omitting it fails the whole command with a missing-flag error
before the handler ever runs. Every boolean flag has to be closed off with
`Flag.withDefault(false)` or `Flag.optional`, and nothing in the existing suites
notices when one is not.
Handler integration tests build their flags record directly, so they never
touch the parser, and the required-ness is invisible to the type checker
because a required boolean flag still infers as `boolean`. The flag only
misbehaves when a real invocation omits it, which is exactly the invocation no
handler test makes.
So this walks the whole legacy command tree, including global flags, and
asserts every boolean param carries a default or is optional. It reads the
primitive kind through `Primitive.getTypeName` rather than `_tag`, since this
repo forbids inspecting effect's runtime representation in tests as well as in
source.
@chatgpt-codex-connector

chatgpt-codex-connectorBot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code ReviewCompleted2026-08-29T03:19:24.005060Zcd157e1PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:cd157e17bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const machineOutput = yield* legacyWorkersMachineOutputRequested();
// Computed once for the whole run, the way `status` and `delete` do: an
// explicit `--project-ref` has to survive into every hint this push emits.
const refSuffix = legacyWorkersProjectRefSuffix(flags.projectRef);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid appending an empty project ref to retry commands

When the user supplies --project-ref "" or --project-ref=, the resolver deliberately treats the empty value as absent and falls back to the environment or linked-project file (legacy-project-ref.layer.ts:84-93), but this derives the suffix from the original Option.some(""). A failed or timed-out build therefore recommends a command ending in --project-ref , which cannot be copied and rerun because the flag has no value. Append the suffix only for a nonempty flag value, or preserve which source actually resolved the ref.

AGENTS.md reference: apps/cli/AGENTS.md:L267-L279

Useful? React with 👍 / 👎.

Comment on lines +64 to +67
| Mode | stdout | stderr |
| ----------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------- |
| text (default) | the details block| an unreadable instance tally, and the build-retry hint on a failure |
| `--output-format json` | one structured result carrying every reported field | as above |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark success trailers as text-only in the format matrices

The updated text row now includes the build-retry trailer, while every structured row says its stderr is “as above,” but legacyWorkersStatus returns immediately after machine emission or output.success and can only call emitSuccessTrailer in the text branch (status.handler.ts:105-121,156-161). Thus JSON, stream-JSON, YAML, and TOML never emit this hint. The delete matrix makes the same new claim about its redeploy trailer even though that handler has identical early returns. Mark these trailers as text-only so the compatibility checklists do not drive incorrect tests or expectations.

AGENTS.md reference: apps/cli/AGENTS.md:L359-L366

Useful? React with 👍 / 👎.

@johnstonmattjohnstonmatt added the run-ci Run full develop CI (tests + preview pkgs) on drafts and non-develop PRs. label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@cd157e17bf999489b4f9fe8a65109bbc1496b5b6

Preview package for commit cd157e1.

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

Labels

run-ciRun full develop CI (tests + preview pkgs) on drafts and non-develop PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@johnstonmatt