Skip to content

Commit

Permalink
cf revisions no longer reports EXPERIMENTAL notice [main] (#3062)
Browse files Browse the repository at this point in the history
* `cf revisions` no longer reports EXPERIMENTAL notice

* Move `revision` and `revisions` commands into APPS section of help

* Remove negative assertions for revision commands' experimental status

* Restore "revision" command to experimental status

* `cf rollback` no longer reports EXPERIMENTAL status

* Remove superfluous newline
  • Loading branch information
chinigo committed Aug 13, 2024
1 parent 69f68e5 commit a5ed00b
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 18 deletions.
3 changes: 2 additions & 1 deletion command/common/internal/help_all_display.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var HelpCategoryList = []HelpCategory{
{"start", "stop", "restart", "stage-package", "restage", "restart-app-instance"},
{"run-task", "tasks", "terminate-task"},
{"packages", "create-package"},
{"revisions", "rollback"},
{"droplets", "set-droplet", "download-droplet"},
{"events", "logs"},
{"env", "set-env", "unset-env"},
Expand Down Expand Up @@ -172,7 +173,7 @@ var ExperimentalHelpCategoryList = []HelpCategory{
{
CategoryName: "EXPERIMENTAL COMMANDS:",
CommandList: [][]string{
{"revisions", "revision", "rollback"},
{"revision"},
},
},
}
4 changes: 0 additions & 4 deletions command/v7/revisions_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"strconv"

"code.cloudfoundry.org/cli/actor/v7action"
"code.cloudfoundry.org/cli/command"
"code.cloudfoundry.org/cli/command/flag"
"code.cloudfoundry.org/cli/resources"
"code.cloudfoundry.org/cli/util/ui"
Expand All @@ -26,9 +25,6 @@ type RevisionsCommand struct {
}

func (cmd RevisionsCommand) Execute(_ []string) error {
cmd.UI.DisplayWarning(command.ExperimentalWarning)
cmd.UI.DisplayNewline()

err := cmd.SharedActor.CheckTarget(true, true)
if err != nil {
return err
Expand Down
4 changes: 0 additions & 4 deletions command/v7/revisions_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ var _ = Describe("revisions Command", func() {
executeErr = cmd.Execute(nil)
})

It("displays the experimental warning", func() {
Expect(testUI.Err).To(Say("This command is in EXPERIMENTAL stage and may change without notice"))
})

When("checking target fails", func() {
BeforeEach(func() {
fakeSharedActor.CheckTargetReturns(actionerror.NotLoggedInError{BinaryName: binaryName})
Expand Down
3 changes: 0 additions & 3 deletions command/v7/rollback_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ func (cmd *RollbackCommand) Setup(config command.Config, ui command.UI) error {
}

func (cmd RollbackCommand) Execute(args []string) error {
cmd.UI.DisplayWarning(command.ExperimentalWarning)
cmd.UI.DisplayNewline()

targetRevision := int(cmd.Version.Value)
err := cmd.SharedActor.CheckTarget(true, true)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions command/v7/rollback_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ var _ = Describe("rollback Command", func() {
executeErr = cmd.Execute(nil)
})

It("displays the experimental warning", func() {
Expect(testUI.Err).To(Say("This command is in EXPERIMENTAL stage and may change without notice"))
})

When("checking target fails", func() {
BeforeEach(func() {
fakeSharedActor.CheckTargetReturns(actionerror.NoOrganizationTargetedError{BinaryName: binaryName})
Expand Down
2 changes: 1 addition & 1 deletion integration/v7/isolated/revisions_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var _ = Describe("revisions command", func() {
It("appears in cf help -a", func() {
session := helpers.CF("help", "-a")
Eventually(session).Should(Exit(0))
Expect(session).To(HaveCommandInCategoryWithDescription("revisions", "EXPERIMENTAL COMMANDS", "List revisions of an app"))
Expect(session).To(HaveCommandInCategoryWithDescription("revisions", "APPS", "List revisions of an app"))
})

It("Displays command usage to output", func() {
Expand Down
2 changes: 1 addition & 1 deletion integration/v7/isolated/rollback_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var _ = Describe("rollback command", func() {
It("appears in cf help -a", func() {
session := helpers.CF("help", "-a")
Eventually(session).Should(Exit(0))
Expect(session).To(HaveCommandInCategoryWithDescription("rollback", "EXPERIMENTAL COMMANDS", "Rollback to the specified revision of an app"))
Expect(session).To(HaveCommandInCategoryWithDescription("rollback", "APPS", "Rollback to the specified revision of an app"))
})

It("Displays rollback command usage to output", func() {
Expand Down

0 comments on commit a5ed00b

Please sign in to comment.