[CMPT-5391] feat(pipelines): add dr pipeline input subcommands - #547
Conversation
Adds the input subcommand group for managing JSON payloads used by runs
(create/list/get/update/delete).
- internal/pipelines/input.go: CreateInput, ListInputs, GetInput,
UpdateInput, DeleteInput — API client for the /inputs endpoints
- cmd/pipelines/input/: input create/list/get/update/delete + inpututil
- docs: input section in pipelines.md, input endpoints in pipelines-reference.md
Inputs exist in draft (mutable) and locked (tied to a version) scopes.
The payload file is wrapped in {"payload": …} before sending to the API.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Apply sunny/pipelines versions of input subcommand files and update all import paths to use internal/pipeline (singular) after rename. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n, limit defaults, version prefix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…putJSON wrapper, package name Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t, delete dead inpututil package
- Add cmd.MarkFlagRequired("pipeline") to input create and input get,
consistent with del/list/update and all run commands
- Delete cmd/pipeline/input/inpututil/ entirely — all four files
(payload.go, render.go, and their tests) were dead code; production
commands import the equivalent functions from internal/pipeline
- Update TestCmd_RejectsMissingPipeline assertions from "--pipeline" to
"pipeline" to match Cobra's required-flag error format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
bugbot run |
There was a problem hiding this comment.
Pull request overview
Adds a new dr pipeline input command group to manage pipeline input payloads (JSON objects) across draft/locked pipeline scopes, backed by new internal/pipeline client helpers and updated command docs.
Changes:
- Introduces
dr pipeline input create/list/get/update/deletesubcommands (including scope/version routing and 404-friendly get/delete behavior). - Adds
internal/pipelineinput API client wrappers plus shared payload resolution and output rendering. - Updates pipelines documentation and command tree to include the new
inputcommand group.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/pipeline/transport_test.go | Removes a shared test helper (re-homed elsewhere). |
| internal/pipeline/input.go | Adds typed client wrappers for pipeline input endpoints (CRUD + list pagination). |
| internal/pipeline/input_test.go | Adds httptest coverage for input client URL shapes, pagination, and error propagation. |
| internal/pipeline/input_payload.go | Adds shared payload file resolution + JSON object parsing helper. |
| internal/pipeline/input_output.go | Adds human/JSON render helpers for input records and lists. |
| docs/commands/README.md | Updates command tree to include dr pipeline input …. |
| docs/commands/pipelines-reference.md | Adds inputs section + endpoint mappings and examples. |
| docs/commands/pipeline.md | Adds pipeline guide section for dr pipeline input … usage. |
| cmd/pipeline/input/cmd.go | Registers the new input command group under pipeline. |
| cmd/pipeline/input/cmd_test.go | Verifies the input command registers expected verbs. |
| cmd/pipeline/input/create/cmd.go | Implements dr pipeline input create (payload file + scope/version flags). |
| cmd/pipeline/input/create/cmd_test.go | Covers basic flag/arg validation for create. |
| cmd/pipeline/input/list/cmd.go | Implements dr pipeline input list (scope/version + pagination + output format). |
| cmd/pipeline/input/list/cmd_test.go | Covers basic flag/arg validation for list. |
| cmd/pipeline/input/get/cmd.go | Implements dr pipeline input get (scope/version + 404 suppression). |
| cmd/pipeline/input/get/cmd_test.go | Covers basic flag/arg validation + 404 suppression helper behavior. |
| cmd/pipeline/input/update/cmd.go | Implements dr pipeline input update (draft-only payload update). |
| cmd/pipeline/input/update/cmd_test.go | Covers basic flag/arg validation for update. |
| cmd/pipeline/input/del/cmd.go | Implements dr pipeline input delete (scope/version + 404 suppression). |
| cmd/pipeline/input/del/cmd_test.go | Covers basic flag/arg validation for delete. |
| cmd/pipeline/input/inpututil/render.go | Adds (currently unreferenced) shared render helpers under cmd/.../inpututil. |
| cmd/pipeline/input/inpututil/render_test.go | Tests the (currently unreferenced) render helpers. |
| cmd/pipeline/input/inpututil/payload.go | Adds (currently unreferenced) payload parsing helpers under cmd/.../inpututil. |
| cmd/pipeline/input/inpututil/payload_test.go | Tests the (currently unreferenced) payload parsing helpers. |
| cmd/pipeline/cmd.go | Wires pipeline input into the pipeline command tree. |
| cmd/pipeline/cmd_test.go | Updates pipeline subcommand expectations to include input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a62fcd2. Configure here.
…ayload DTO, doc fixes - Add internal/pipeline/input_output_test.go: JSON key remapping (input_id, scope/version/pipeline_id), RFC3339 timestamps, empty-list human message, table render — mirrors run_output_test.go pattern - Change inputJSON.Payload from json.RawMessage to map[string]any; remove the json.Marshal + ignored-error step in toInputJSON (Payload is already a map[string]any from the API decode) - Fix comment typo: "dr pipelines create" → "dr pipeline create" in internal/pipeline/input_payload.go - Add locked URL variant to input get and input delete rows in docs/commands/pipelines-reference.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🔐 Fork smoke tests started by maintainer ⏳ Security scans passed. Running smoke tests... Commit: |
|
✅ All smoke tests passed! (Fork PR) ✅ Security Scan: success |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…d tests - Replace Version string (with placeholder) in inputJSON with VersionID *int,omitempty so draft inputs omit the field entirely and locked inputs emit a numeric value - Update input_output_test.go assertions for the new pointer field - Add input_payload_test.go covering ResolvePayload/resolvePayloadFilePath: positional arg, --from-file, both-provided, neither-provided, file-not-found, invalid JSON, and non-object JSON Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
🔐 Fork smoke tests started by maintainer ⏳ Security scans passed. Running smoke tests... Commit: |
|
✅ All smoke tests passed! (Fork PR) ✅ Security Scan: success |

Summary
dr pipeline input create/list/get/update/delete— manage pipeline input payloads for draft and locked versions--pipelineflag is marked required viacmd.MarkFlagRequiredon all subcommandsdeleteandgettreated as no-op (friendly message, exit 0) — consistent withpipeline deleteandrun get--from-file=<path>(mutually exclusive) — consistent withpipeline create/updatescopeflag.Flags(shared--pipeline/--scope/--version) from base infrastructureStacked on:
cmpt-5391/pipelines-runs(merged as PR #541) — diff shows only the delta above main.Test plan
go build ./...go test ./cmd/pipeline/input/... ./internal/pipeline/...task lintdr pipeline input --help— shows create/list/get/update/deletedr pipeline input create --pipeline <id> ./payload.json --help🤖 Generated with Claude Code
Note
Low Risk
Additive, feature-gated CLI over existing pipelines input APIs; follows established run/scope patterns with no auth or core infra changes.
Overview
Adds
dr pipeline inputunder the feature-gatedpipelinecommand: create, list, get, update, and delete for JSON run payloads, wired to draft vs locked pipelines via sharedscopeflag(--pipeline,--scope,--version).New
internal/pipelinehelpers cover the inputs API (CreateInput,ListInputs, etc.),ResolvePayload(positional file or--from-file), and human/JSON rendering. Get and delete treat 404 like other pipeline verbs (friendly message, exit 0). Update is draft-only on the client path. Command-tree and pipeline docs are updated accordingly.Reviewed by Cursor Bugbot for commit a62fcd2. Configure here.