Skip to content

[CMPT-5391] feat(pipelines): add dr pipeline input subcommands - #547

Merged
sunny2get merged 13 commits into
datarobot-oss:mainfrom
sunny2get:cmpt-5391/pipelines-inputs
Jun 3, 2026
Merged

[CMPT-5391] feat(pipelines): add dr pipeline input subcommands#547
sunny2get merged 13 commits into
datarobot-oss:mainfrom
sunny2get:cmpt-5391/pipelines-inputs

Conversation

@sunny2get

@sunny2get sunny2get commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds dr pipeline input create/list/get/update/delete — manage pipeline input payloads for draft and locked versions
  • Each input is a JSON payload object tied to a pipeline scope (draft or locked version)
  • --pipeline flag is marked required via cmd.MarkFlagRequired on all subcommands
  • 404 on delete and get treated as no-op (friendly message, exit 0) — consistent with pipeline delete and run get
  • Payload file accepted as positional argument or --from-file=<path> (mutually exclusive) — consistent with pipeline create/update
  • Uses scopeflag.Flags (shared --pipeline/--scope/--version) from base infrastructure

Stacked 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 lint
  • dr pipeline input --help — shows create/list/get/update/delete
  • dr 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 input under the feature-gated pipeline command: create, list, get, update, and delete for JSON run payloads, wired to draft vs locked pipelines via shared scopeflag (--pipeline, --scope, --version).

New internal/pipeline helpers 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.

sunny2get and others added 8 commits June 2, 2026 16:34
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>
Comment thread cmd/pipeline/input/inpututil/payload.go Outdated
Comment thread cmd/pipeline/input/create/cmd.go
…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>
@sunny2get

Copy link
Copy Markdown
Contributor Author

bugbot run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/delete subcommands (including scope/version routing and 404-friendly get/delete behavior).
  • Adds internal/pipeline input API client wrappers plus shared payload resolution and output rendering.
  • Updates pipelines documentation and command tree to include the new input command 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.

Comment thread docs/commands/pipelines-reference.md Outdated
Comment thread cmd/pipeline/input/create/cmd.go
Comment thread cmd/pipeline/input/create/cmd_test.go
Comment thread cmd/pipeline/input/get/cmd.go
Comment thread cmd/pipeline/input/get/cmd_test.go
Comment thread internal/pipeline/input_output.go Outdated
Comment thread internal/pipeline/input_payload.go
Comment thread internal/pipeline/input_output.go

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a62fcd2. Configure here.

Comment thread internal/pipeline/input_payload.go
…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>
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🔐 Fork smoke tests started by maintainer

⏳ Security scans passed. Running smoke tests...

Commit: 97b0c7b00b8b33ab0796366fe21ab25de44710f2
View run

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Comment thread internal/pipeline/input_output.go
Comment thread docs/commands/pipelines-reference.md
Comment thread internal/pipeline/input_payload.go
Comment thread internal/pipeline/input_test.go
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

All smoke tests passed! (Fork PR)

✅ Security Scan: success
✅ Linux: success
✅ Windows: success

View run details

sunny2get and others added 3 commits June 3, 2026 12:01
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>
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔐 Fork smoke tests started by maintainer

⏳ Security scans passed. Running smoke tests...

Commit: 4edc3a5f8191a25dfff5c59789ff31fe98d08629
View run

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

All smoke tests passed! (Fork PR)

✅ Security Scan: success
✅ Linux: success
✅ Windows: success

View run details

@sunny2get
sunny2get merged commit 0651acf into datarobot-oss:main Jun 3, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants