Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions apptrust/commands/version/rollback_app_version_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ Related: jf apptrust version-promote, jf apptrust version-delete`,
Description: "The version to roll back.",
Optional: false,
},
{
Name: "from-stage",
Description: "The name of the stage from which to roll back the application version.",
Optional: false,
},
},
Flags: commands.GetCommandFlags(commands.VersionRollback),
SupportedFormats: []coreformat.OutputFormat{coreformat.Table, coreformat.Json},
Expand Down
21 changes: 21 additions & 0 deletions apptrust/commands/version/rollback_app_version_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,32 @@ import (
mockversions "github.com/jfrog/jfrog-cli-application/apptrust/service/versions/mocks"
"go.uber.org/mock/gomock"

"github.com/jfrog/jfrog-cli-application/apptrust/app"
"github.com/jfrog/jfrog-cli-application/apptrust/model"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestGetRollbackAppVersionCommandArguments(t *testing.T) {
cmd := GetRollbackAppVersionCommand(app.NewAppContext())

require.Len(t, cmd.Arguments, 3, "version-rollback must declare three positional arguments")

assert.Equal(t, "application-key", cmd.Arguments[0].Name)
assert.False(t, cmd.Arguments[0].Optional)

assert.Equal(t, "version", cmd.Arguments[1].Name)
assert.False(t, cmd.Arguments[1].Optional)

assert.Equal(t, "from-stage", cmd.Arguments[2].Name)
assert.False(t, cmd.Arguments[2].Optional)
assert.Equal(t,
"The name of the stage from which to roll back the application version.",
cmd.Arguments[2].Description,
)
}

func TestRollbackAppVersionCommand_Run(t *testing.T) {
tests := []struct {
name string
Expand Down
Loading