Repository navigation
feat(cli): add project issues CLI-2888 - #7576
Conversation
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 9 commands. Binary size: 135.5 MB, up 28.0 KB from 135.5 MB. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
jgoux
left a comment
There was a problem hiding this comment.
The new command matches the CLI-2888 contract closely and leaves db advisors unchanged. One blocking issue: a failed remote check aborts the whole run instead of being reported as unavailable alongside the results that did complete, which contradicts the command's documented coverage contract. The rest are minor output, completion and test-placement points.
jgoux
left a comment
There was a problem hiding this comment.
Re-reviewed at 80f6a6c26. All points from my previous review are addressed: remote categories now run concurrently and a failing category is reported as unavailable while the others' findings are kept (401/403 stay fatal), health coverage is documented, affected entries carry metadata and real docs URLs, Affected counts distinct resources, completion rejects -o, and the tests are colocated. Three minor follow-ups inline, none blocking.
Problem
Studio is moving from Advisors to Issues Inbox, while the CLI still exposes
supabase db advisors. CLI users also need remote health checks alongside security and performance findings.What this adds
supabase issuescombines security, performance, and remote health checks, grouping affected resources under each issue.logs.--output-format jsonandstream-json, including affected resources, evidence, and remediation links. Detected coding agents retain the CLI's JSON default.--type, minimum--severity, and--fail-on. Defaults areall,info, andnonerespectively.db advisorsretains its flags, defaults, output, and exit behavior, with an informational notice on stderr about planned future deprecation. Both commands reuse existing Advisors endpoints and check modules.Local and direct database targets keep SQL checks and report health as unavailable; explicitly requesting local health is rejected. Use
--output-format, not the older-oflag. Issue IDs identify project-scoped checks, not persistent incidents; lifecycle actions and banned-IP signals are outside this PR.Command and flags reference
Issues flags
These are the check-selection, filtering, and exit-control flags exposed by the new command.
--type <value>all,security,performance,healthall--severity <value>info,warning,criticalinfoinfoincludes everything,warningincludes warning and critical issues, andcriticalincludes only critical issues. A group's severity is its highest affected-resource severity; matching groups retain all affected resources and evidence.--fail-on <value>none,info,warning,criticalnone1when a displayed issue meets or exceeds this threshold.nonedisables failure based on findings; it does not suppress command errors or unavailable remote checks.Severities map from the underlying Advisors levels:
INFO→info,WARN→warning,ERROR→critical.--severityfilters the results before--fail-onis evaluated. Neither flag changes which API checks are requested.Target selection
The command reuses the existing CLI target flags; these are not new global flags.
--stack <name-or-id>SUPABASE_STACK, then the current project stack.--remote--remote=<project-ref>--remote=<branch>--remote=<postgresql-url>Use
=when supplying a remote target, for example--remote=erppftcfodkcyoftaqvb, rather than--remote erppftcfodkcyoftaqvb. Local and direct-URL security/performance checks run in a transaction that is always rolled back. With those targets,--type allreports health as unavailable; explicit--type healthfails with guidance to use a hosted project.The shared, hidden compatibility flags remain accepted but are deprecated for removal in CLI v4:
--local(omit the target flag),--linked(use--remote),--project-ref <ref>(use--remote=<ref>), and--db-url <url>(use--remote=<url>).Shared output and execution flags
These existing global flags apply to
issues:--output-format <value>text,json,stream-json; normallytexttextprints a table or narrow-terminal stacked fields, followed by coverage.jsonincludes fullissuesandchecks.stream-jsonemits newline-delimited JSON events, with the structured result in the result event.--agent <value>auto,yes,no; defaultauto--agent noto exercise normal human defaults; an explicit output format selects the requested format.--profile <name>--workdir <path>supabase/exactly, without ancestor search. This determines the local project context and linked project.--debug--help,-hOther inherited global options remain listed in
supabase issues --help; this PR does not change them. Although inherited help lists--output/-o, this command rejects that legacy output flag and directs callers to--output-format.Exit behavior
--fail-on0. Findings alone do not fail the default--fail-on nonerun.--fail-onthreshold1.1, even with--fail-on none.--type allcannot run health1. The findings threshold still applies.For example,
--severity critical --fail-on warningfails only if a critical issue is displayed. Warning issues have already been filtered out. An empty result means no issues match the filter, not that every check completed successfully.Examples
For scoped access tokens, hosted checks require
advisors_read. Project selection may additionally requireprojects_read; branch resolution may requirebranching_development_readorbranching_production_read.project_admin_readis optional for this command, as reported by--help.Verification after merging develop
The full E2E matrix ran on
afe18cdfawith the compiled macOS CLI. On final headcbfe5be78, Issues registers permissions after all flags so permission discovery includes the stack selector on both backends. The rebuilt binary listed the selector and Advisors Read permission in help and returned six security warnings from Mockamaster. The stack routing regression test failed before the fix and passed afterward.--fail-on warning. Filtering for critical issues returned zero and exit 0. Health, JSON, stream JSON, legacy Advisors and terminal layouts at 40, 80 and 120 columns also passed.--fail-on criticalexited 1. Legacy Advisors still returned its originalresultsarray.issues --stack cli-2888-qaselected the running native stack. The security result identified the seeded table. The empty database exited 0 with a findings threshold. With the seeded finding it exited 1. Local--type allreported health as unavailable, and explicit local health exited 1.GitHub checks for this PR
Follow-up review QA ·
b0e030d96IssuesFailOnError. Incomplete remote coverage emittedIssuesChecksUnavailableError, including when the findings threshold was also met. Each run returned the structured findings and exited 1.CLI team review verification ·
43942d0e0Earlier verification
b2c21a6b7Mockamaster has no critical, mixed-severity, or unavailable checks. Those cases are covered by fixtures, not claimed as live coverage. Conditional/draft CI jobs are skipped; the separate CodeQL comparison is neutral due to the base branch's obsolete Go configuration.
Earlier verification on head 681ec2d
1112; types, changed-file lint/formatting, and binary build passed.How to test
Using a build of this branch and an authenticated project:
Expect readable tables in a normal terminal and stacked fields at 40 columns. JSON modes retain full findings and coverage.
--fail-on warningexits nonzero when matching warning-or-higher findings exist. The legacy command preserves its response and adds its informational future-deprecation notice on stderr.--agent noexplicitly selects human defaults when testing from a coding-agent environment.Screenshots
Actual compiled CLI against Mockamaster. The 80-column screenshot records head
681ec2d; output at 80/120 columns was verified unchanged by the narrow-terminal follow-up.80-column table
Additional live screenshots: 120-column table, security warnings, and empty health results
Captured from head
681ec2dagainst Mockamaster in Jordi - Team, using the actual compiled CLI in a read-only localhost browser terminal. Output was not reconstructed or projected through jq, and no project resources changed. PTY width was set after browser initialization; the browser canvas may be wider than the configured PTY.Default issues, 120 columns
All 11 grouped issues, complete security/performance/health coverage, exit 0.
Security warnings, 80 columns
--type security --severity warning: six warning issues and 11 affected findings, wrapped titles, complete coverage, exit 0.Empty health results, 120 columns
--type health: no matching issues, complete health coverage, exit 0.40-column stacked output
Fresh run of
b2c21a6b7against Mockamaster: six security-warning issues, complete security coverage, exit 0. Two screenshots show the beginning and end of the same run. The PTY is 40 columns; shared CLI update notices retain their existing behavior.Linked issue: CLI-2888.