Repository navigation
refactor(status): share CLI status reporter constructor - #1507
Conversation
Add status.NewCLIReporter/CLIOptions in pkg/status so the four CLI newStatusReporter constructors (ci, config apply, provider status, workspace up status) share one wrapper around NewReporter and ForPipeline. Output, labels, envelopes and error returns are unchanged.
✅ Deploy Preview for devsydev canceled.
|
✅ Deploy Preview for images-devsy-sh canceled.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Why
Four CLI commands (
ci,config apply,provider status,workspace upstatus) each built astatus.NewReporterwith the same boilerplate and the sameForPipelinewrap. Only format, prefix, labels, envelope, and pipeline differed, so a single constructor removes the duplication without changing output.Changes
pkg/status/render.go: addCLIOptionsandNewCLIReporter(o CLIOptions) (Reporter, error). It wrapsNewReporterwithSuppressFailureDetails: trueand callsForPipeline.cmd/ci/status.go,cmd/config/apply.go,cmd/provider/status.go,cmd/workspace/up/status.go:newStatusReporternow callsstatus.NewCLIReporter. Signatures, label maps, envelopes, and the variadicverbosehandling in provider and workspace/up are unchanged.NewReporter,ForPipeline, all call sites, existing tests.Verification
newStatusReporterwere driven with the same events and their output compared byte-for-byte.cmd/ci: plain, identical (122 bytes)cmd/config: plain identical (158 bytes); json identical (894 bytes)cmd/provider: plain identical (162 bytes); json identical (842 bytes)cmd/workspace/up: plain identical (123 bytes); json identical (877 bytes)task cli:format: exit 0task cli:lint:ci: exit 0go test ./pkg/status/... ./cmd/ci/... ./cmd/config/... ./cmd/provider/... ./cmd/workspace/up/...: all okgo build -o /tmp/devsy-smoke .succeeded;devsy ci --help,devsy config apply --help, anddevsy provider --helpprint their usage text.devsy updoes not exist as a top-level command (it isworkspace up), so that probe was not meaningful.coderabbit review --agent --committed): completed, 0 findings, 5 files reviewed.Summary by CodeRabbit