Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
87512b2
[CFX-6052] Add template name and ID fields to telemetry properties (#…
cdevent Jun 2, 2026
27cdb99
[CFX-4622] Add warnings for invalid arg/subcommand (#519)
taras-pokornyy Jun 2, 2026
5248589
[CFX-5795] Add CI/CD integration & `dr deps install` smoke tests (#536)
taras-pokornyy Jun 2, 2026
0b7a8a7
[CFX-6356] Silence Amplitude SDK error logs (#542)
cdevent Jun 2, 2026
d3b518a
Add xp plugin v1.2.0 (#545)
datarobot-devinfragit7 Jun 2, 2026
8e3012c
Add assist plugin v0.1.24 (#546)
victorborshak Jun 2, 2026
031c538
[CMPT-5391] feat(pipelines): add dr pipeline run subcommands (#541)
sunny2get Jun 2, 2026
1be9602
[CMPT-5391] add dr pipelines input subcommand group
sunny2get May 20, 2026
b92eb40
sync input structs, output, and commands with sunny/pipelines
sunny2get May 25, 2026
3ed9316
fix internal/pipeline import paths in cmd/pipeline/input subcommands
sunny2get May 25, 2026
b827614
[CMPT-5391] add telemetry to input commands
sunny2get May 25, 2026
9a5f3c6
[CMPT-5391] address PR feedback: MarkFlagRequired, 404 del suppressio…
sunny2get May 25, 2026
50c48f5
[CMPT-5391] fix test assertions for MarkFlagRequired error format
sunny2get May 25, 2026
8812020
[CMPT-5391] update input docs: --output -> --output-format
sunny2get Jun 1, 2026
cba8234
[CMPT-5391] fix inpututil: restore render files, time.Time fields, in…
sunny2get Jun 1, 2026
a62fcd2
[CMPT-5391] address PR feedback: MarkFlagRequired for input create/ge…
sunny2get Jun 2, 2026
97b0c7b
[CMPT-5391] address PR feedback: input_output tests, map[string]any p…
sunny2get Jun 2, 2026
942756e
Apply suggestions from code review
sunny2get Jun 3, 2026
1428a68
[CMPT-5391] use version_id *int in inputJSON DTO and add input_payloa…
sunny2get Jun 3, 2026
4edc3a5
[CMPT-5391] fix gofumpt indentation in input_test.go
sunny2get Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/.deps-install-smoke-tests-matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Dependency Install Smoke Tests Matrix

on:
workflow_call:

jobs:
deps-install-smoke-tests:
strategy:
matrix:
sys:
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: "zsh {0}" }
defaults:
run:
shell: ${{ matrix.sys.shell }}
runs-on: ${{ matrix.sys.os }}
name: Dependency Install Smoke Tests (${{ matrix.sys.os }})
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build binary
run: task build

- name: Run dependency install smoke tests
run: |
DR_BIN=./dist/dr bash smoke_test_scripts/run_deps_install_smoke_test.sh
37 changes: 37 additions & 0 deletions .github/workflows/.install-integration-tests-matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Install Integration Tests Matrix

on:
workflow_call:

jobs:
install-integration-tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: Install Integration Tests (${{ matrix.os }})
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build binary
run: task build

- name: Run install integration tests
run: |
LOCAL_BINARY=./dist/dr bash smoke_test_scripts/run_install_integration_test.sh
3 changes: 3 additions & 0 deletions .github/workflows/.installation-tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
os: ${{ fromJSON(inputs.os-matrix) }}
runs-on: ${{ matrix.os }}
name: Installation Test (${{ matrix.os }})
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Install for Linux and macOS (latest)
if: matrix.os != 'windows-latest' && inputs.version == ''
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/.self-update-tests-matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
shell: ${{ matrix.sys.shell }}
runs-on: ${{ matrix.sys.os }}
name: Self-Update Smoke Tests (${{ matrix.sys.os }})
timeout-minutes: 30
permissions:
contents: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
templates: ${{ steps.changes.outputs.templates }}
auth: ${{ steps.changes.outputs.auth }}
go_code: ${{ steps.changes.outputs.go_code }}
deps: ${{ steps.changes.outputs.deps }}
install_sh: ${{ steps.changes.outputs.install_sh }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -44,6 +46,14 @@ jobs:
- '**/*.go'
- 'go.mod'
- 'go.sum'
deps:
- 'cmd/dependencies/**'
- 'internal/dependencies/**'
- 'internal/tools/**'
- 'smoke_test_scripts/run_deps_install_smoke_test.sh'
install_sh:
- 'install.sh'
- 'smoke_test_scripts/run_install_integration_test.sh'

lint:
needs: detect-changes
Expand Down Expand Up @@ -221,6 +231,18 @@ jobs:
body: '👋 **Maintainer reminder:** Smoke tests cannot run automatically on dependabot PRs due to GitHub secret restrictions.\n\nBefore merging, add the `run-smoke-tests` label and wait for the smoke tests to pass.'
});

deps-install-smoke-tests:
needs: detect-changes
if: needs.detect-changes.outputs.deps == 'true'
uses: ./.github/workflows/.deps-install-smoke-tests-matrix.yaml
secrets: inherit

install-integration-tests:
needs: detect-changes
if: needs.detect-changes.outputs.install_sh == 'true'
uses: ./.github/workflows/.install-integration-tests-matrix.yaml
secrets: inherit

completion-tests:
needs: [build, detect-changes]
if: needs.detect-changes.outputs.completion == 'true'
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/deps-install-smoke-tests-on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: On-Demand Dependency Install Smoke Tests

on:
workflow_dispatch:

jobs:
deps-install-smoke-tests:
uses: ./.github/workflows/.deps-install-smoke-tests-matrix.yaml
secrets: inherit
9 changes: 9 additions & 0 deletions .github/workflows/install-integration-tests-on-demand.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: On-Demand Install Integration Tests

on:
workflow_dispatch:

jobs:
install-integration-tests:
uses: ./.github/workflows/.install-integration-tests-matrix.yaml
secrets: inherit
4 changes: 4 additions & 0 deletions cmd/pipeline/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ import (
"github.com/datarobot/cli/cmd/pipeline/del"
"github.com/datarobot/cli/cmd/pipeline/get"
"github.com/datarobot/cli/cmd/pipeline/graph"
"github.com/datarobot/cli/cmd/pipeline/input"
"github.com/datarobot/cli/cmd/pipeline/list"
"github.com/datarobot/cli/cmd/pipeline/lock"
"github.com/datarobot/cli/cmd/pipeline/run"
"github.com/datarobot/cli/cmd/pipeline/update"
"github.com/datarobot/cli/cmd/pipeline/version"
"github.com/datarobot/cli/internal/features"
Expand Down Expand Up @@ -51,6 +53,8 @@ input payloads, runs, and recurring schedules.`,
lock.Cmd(),
version.Cmd(),
graph.Cmd(),
run.Cmd(),
input.Cmd(),
)

return cmd
Expand Down
2 changes: 2 additions & 0 deletions cmd/pipeline/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func TestCmd_HasExpectedSubcommands(t *testing.T) {
"lock": false,
"version": false,
"graph": false,
"run": false,
"input": false,
}

for _, sub := range cmd.Commands() {
Expand Down
51 changes: 51 additions & 0 deletions cmd/pipeline/input/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright 2026 DataRobot, Inc. and its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package input

import (
"github.com/datarobot/cli/cmd/pipeline/input/create"
"github.com/datarobot/cli/cmd/pipeline/input/del"
"github.com/datarobot/cli/cmd/pipeline/input/get"
"github.com/datarobot/cli/cmd/pipeline/input/list"
"github.com/datarobot/cli/cmd/pipeline/input/update"
"github.com/spf13/cobra"
)

// Cmd returns the parent command for `dr pipeline input`. It groups the
// CRUD verbs that operate on pipeline input sets.
func Cmd() *cobra.Command {
cmd := &cobra.Command{
Use: "input",
Short: "Manage pipeline input sets",
Long: `Manage input payloads bound to a pipeline.

Inputs come in two scopes:
- draft : mutable; bound to the current draft of a pipeline
- locked : immutable; bound to a specific frozen version

When --version is supplied, the locked scope is selected automatically.
Pass --scope=draft to be explicit.`,
}

cmd.AddCommand(
create.Cmd(),
list.Cmd(),
get.Cmd(),
update.Cmd(),
del.Cmd(),
)

return cmd
}
41 changes: 41 additions & 0 deletions cmd/pipeline/input/cmd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2026 DataRobot, Inc. and its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package input

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestCmd_RegistersAllVerbs(t *testing.T) {
cmd := Cmd()

want := map[string]bool{
"create": false,
"list": false,
"get": false,
"update": false,
"delete": false,
}

for _, sub := range cmd.Commands() {
want[sub.Name()] = true
}

for verb, present := range want {
assert.Truef(t, present, "missing subcommand: %s", verb)
}
}
95 changes: 95 additions & 0 deletions cmd/pipeline/input/create/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Copyright 2026 DataRobot, Inc. and its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package create

import (
"errors"

"github.com/datarobot/cli/cmd/pipeline/scopeflag"
"github.com/datarobot/cli/internal/auth"
"github.com/datarobot/cli/internal/pipeline"
"github.com/datarobot/cli/internal/telemetry"
"github.com/spf13/cobra"
)

func Cmd() *cobra.Command {
var (
flags scopeflag.Flags
fromFile string
outputFormat pipeline.OutputFormat
)

cmd := &cobra.Command{
Use: "create [<payload-file>]",
Short: "Create a pipeline input set",
Long: `Create an input payload for a pipeline.

The payload must be a JSON object. The path to the JSON file can be
supplied either as a positional argument or via --from-file=<path>.
Exactly one of the two must be provided.

Scope is selected from the --scope/--version flags:
- no flags -> draft
- --version=N -> locked, version N (scope auto-set)
- --scope=draft -> draft
- --scope=locked --version=N -> locked, version N

Example:
dr pipeline input create --pipeline <id> ./payload.json
dr pipeline input create --pipeline <id> --from-file=./payload.json
dr pipeline input create --pipeline <id> --version=2 ./payload.json --output-format json`,
Args: cobra.MaximumNArgs(1),
PreRunE: auth.EnsureAuthenticatedE,
SilenceUsage: true,
RunE: func(cmd *cobra.Command, args []string) error {
if flags.PipelineID == "" {
return errors.New("--pipeline is required")
}

scope, version, err := flags.Resolve(cmd)
if err != nil {
return err
}

payload, err := pipeline.ResolvePayload(args, fromFile)
if err != nil {
return err
}

result, err := pipeline.CreateInput(flags.PipelineID, scope, version, payload)
if err != nil {
return err
}

return pipeline.RenderInput(outputFormat, *result)
},
}

flags.Bind(cmd)
_ = cmd.MarkFlagRequired("pipeline")
cmd.Flags().StringVar(&fromFile, "from-file", "", "Path to the JSON payload file, e.g. --from-file=./payload.json (alternative to the positional argument)")
pipeline.AddOutputFlag(cmd, &outputFormat)

telemetry.TrackWith(cmd, func(_ *cobra.Command, _ []string) map[string]any {
return map[string]any{
"pipeline_id": flags.PipelineID,
"scope": flags.Scope,
"version": flags.Version,
"output_format": string(outputFormat),
}
})

return cmd
}
Loading