Repository navigation
Conversation
…pe-1445-warehouse-status
Generate `warehouse connection` from `GET /v2/projects/{ref}/warehouse/connection`
to print the Arrow Flight SQL endpoint and source-database login guidance without
fetching credentials. Add `connection` to the generated command vocabulary and
label TLS fields as an acronym.
There was a problem hiding this comment.
🤖 AI Review
Verified all three reported findings and merged the duplicate fixture reports into one confirmed minor finding. Also confirmed the documentation omission. No runtime defect was established. The CLI reference procedure and guidance artifacts were absent, so no reference-style assessment was possible.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | apps/cli/src/commands/api/api-commands.integration.test.ts:385 |
test-coverage |
claude+codex | Both new connection handler tests use a fixture that omits the required authentication.membership_guidance field, leaving that login guidance unexercised. |
| ⚪ NIT | apps/cli/src/commands/api/warehouse/connection/SIDE_EFFECTS.md:58 |
documentation |
claude | The connection side-effects document omits generic entitlement-denial behavior: a valid 4xx entitlement_required response adds entitlement to the machine-mode stderr document, prints an upgrade hint in terminal text mode, and triggers cli_upgrade_suggested telemetry. |
Stats
Claude findings: 2 · Codex findings: 1 · 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.
| method: "database_username_password", | ||
| credential_source: "source_project_database", | ||
| default_username: "postgres", | ||
| password_guidance: | ||
| "Use the same password as this role in the source Supabase database. For postgres, use the project's database password.", | ||
| required_membership: "supabase_warehouse_reader", | ||
| }, |
There was a problem hiding this comment.
🟡 MINOR · test-coverage · source: claude+codex
Both new connection handler tests use a fixture that omits the required authentication.membership_guidance field, leaving that login guidance unexercised.
Evidence: apps/cli/src/commands/api/api-commands.integration.test.ts:375-397 defines the incomplete shared fixture, used at lines 400 and 430. packages/api/src/generated/contracts.ts:14343 declares membership_guidance as Schema.String, and apps/cli/src/commands/api/generated.schemas.ts:288-295 lists it as required.
Suggested fix: Include membership_guidance in the shared fixture and assert that its text appears in the available-connection output. Consider checking the fixture against the generated response type.
| | Code | Condition | | ||
| | ---- | ----------------------------------------------------------------------------- | | ||
| | `0` | successful read (including not configured, disabled or unavailable Warehouse) | | ||
| | `2` | `usage_error`: invalid flags | | ||
| | `1` | API error (non-2xx) | |
There was a problem hiding this comment.
⚪ NIT · documentation · source: claude
The connection side-effects document omits generic entitlement-denial behavior: a valid 4xx entitlement_required response adds entitlement to the machine-mode stderr document, prints an upgrade hint in terminal text mode, and triggers cli_upgrade_suggested telemetry.
Evidence: apps/cli/src/commands/api/api-command-execute.ts:118-130 attaches entitlement for valid 4xx plan-gate envelopes. shared/cli/standard-errors.ts:258-264 renders the error document or upgrade hint, and telemetry/command-telemetry.ts:584-598 captures cli_upgrade_suggested. The connection document has no corresponding explanation and lists only cli_command_executed at lines 75-82.
Suggested fix: Document the conditional entitlement error output, terminal upgrade hint, and cli_upgrade_suggested event, as warehouse/status/SIDE_EFFECTS.md already does.
Hidden polling reads a generated link may target are now listed in `pollTargets`, each paired with the read-only generated command a failed or timed-out wait points users at. The setup read gets its own spec identity so it no longer shares `warehouse status` with the consolidated status route, and hidden targets go through the same experimental and poll-or-links checks as generated operations.
# Conflicts: # packages/api/scripts/openapi-overrides.json
|
@bnjjj I updated this branch without force-pushing:
Otherwise this PR already fit the base design: generated data, the generic runtime, |
…s' into bnjjj/pipe-1449-warehouse-connection # Conflicts: # apps/cli/src/commands/api/api-command-policy.ts # apps/cli/src/commands/api/api-commands.integration.test.ts # packages/api/scripts/openapi-overrides.json # packages/api/src/generated/openapi.json # packages/api/src/generated/permissions.ts
Generate
warehouse connectionfromGET /v2/projects/{ref}/warehouse/connection. It prints the Arrow Flight SQL endpoint, the TLS requirement and source-database login guidance: use a database role with its existing password (postgresuses the project's database password) andsupabase_warehouse_readermembership. The command never fetches or prints a password, and a disabled, unconfigured or unavailable Warehouse shows no connection string.Text output on terminals, raw JSON when piped or requested, and YAML through
-o yaml, as for the other generated Warehouse commands. Help includes a usql recipe.Add
connectionto the generated command vocabulary and renderTLSas an acronym in text labels. The contract comes from an OpenAPI override until it ships in the deployed Management API specification.Stacked on #7671. Depends on https://github.com/supabase/platform/pull/42053.
Implements PIPE-1449.