[cli] Removing the deprecated pulumi history command (#6724)
This commit is contained in:
parent
e955a6b06a
commit
f6fea7fafb
|
@ -207,7 +207,6 @@ func NewPulumiCmd() *cobra.Command {
|
|||
cmd.AddCommand(newLogsCmd())
|
||||
cmd.AddCommand(newPluginCmd())
|
||||
cmd.AddCommand(newVersionCmd())
|
||||
cmd.AddCommand(newHistoryCmd())
|
||||
cmd.AddCommand(newConsoleCmd())
|
||||
|
||||
// Less common, and thus hidden, commands:
|
||||
|
|
|
@ -568,6 +568,7 @@ namespace Pulumi.Automation
|
|||
{
|
||||
var args = new List<string>()
|
||||
{
|
||||
"stack",
|
||||
"history",
|
||||
"--json",
|
||||
"--show-secrets",
|
||||
|
|
|
@ -587,7 +587,7 @@ func (s *Stack) History(ctx context.Context, pageSize int, page int) ([]UpdateSu
|
|||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get stack history")
|
||||
}
|
||||
args := []string{"history", "--json", "--show-secrets"}
|
||||
args := []string{"stack", "history", "--json", "--show-secrets"}
|
||||
if pageSize > 0 {
|
||||
// default page=1 if unset when pageSize is set
|
||||
if page < 1 {
|
||||
|
|
|
@ -529,7 +529,7 @@ export class Stack {
|
|||
* (up/preview/refresh/destroy).
|
||||
*/
|
||||
async history(pageSize?: number, page?: number): Promise<UpdateSummary[]> {
|
||||
const args = ["history", "--json", "--show-secrets"];
|
||||
const args = ["stack", "history", "--json", "--show-secrets"];
|
||||
if (pageSize) {
|
||||
if (!page || page < 1) {
|
||||
page = 1;
|
||||
|
|
|
@ -545,7 +545,7 @@ class Stack:
|
|||
|
||||
:returns: List[UpdateSummary]
|
||||
"""
|
||||
args = ["history", "--json", "--show-secrets"]
|
||||
args = ["stack", "history", "--json", "--show-secrets"]
|
||||
if page_size is not None:
|
||||
# default page=1 when page_size is set
|
||||
if page is None:
|
||||
|
|
|
@ -33,7 +33,7 @@ func deleteIfNotFailed(e *ptesting.Environment) {
|
|||
// ever been updated.
|
||||
func assertHasNoHistory(e *ptesting.Environment) {
|
||||
// NOTE: pulumi returns with exit code 0 in this scenario.
|
||||
out, err := e.RunCommand("pulumi", "history")
|
||||
out, err := e.RunCommand("pulumi", "stack", "history")
|
||||
assert.Equal(e.T, "", err)
|
||||
assert.Equal(e.T, "Stack has never been updated\n", out)
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ func assertHasNoHistory(e *ptesting.Environment) {
|
|||
// updates in the given pagination window
|
||||
func assertNoResultsOnPage(e *ptesting.Environment) {
|
||||
// NOTE: pulumi returns with exit code 0 in this scenario.
|
||||
out, err := e.RunCommand("pulumi", "history", "--page-size", "1", "--page", "10000000")
|
||||
out, err := e.RunCommand("pulumi", "stack", "history", "--page-size", "1", "--page", "10000000")
|
||||
assert.Equal(e.T, "", err)
|
||||
assert.Equal(e.T, "No stack updates found on page '10000000'\n", out)
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ func TestHistoryCommand(t *testing.T) {
|
|||
defer deleteIfNotFailed(e)
|
||||
integration.CreateBasicPulumiRepo(e)
|
||||
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
|
||||
out, err := e.RunCommandExpectError("pulumi", "history")
|
||||
out, err := e.RunCommandExpectError("pulumi", "stack", "history")
|
||||
assert.Equal(t, "", out)
|
||||
assert.Contains(t, err, "error: no stack selected")
|
||||
})
|
||||
|
@ -83,11 +83,11 @@ func TestHistoryCommand(t *testing.T) {
|
|||
// Update the history-test stack.
|
||||
e.RunCommand("pulumi", "up", "--non-interactive", "--yes", "--skip-preview", "-m", "this is an updated stack")
|
||||
// Confirm we see the update message in thie history output.
|
||||
out, err := e.RunCommand("pulumi", "history")
|
||||
out, err := e.RunCommand("pulumi", "stack", "history")
|
||||
assert.Equal(t, "", err)
|
||||
assert.Contains(t, out, "this is an updated stack")
|
||||
// Confirm we see the update message in thie history output, with pagination.
|
||||
out, err = e.RunCommand("pulumi", "history", "--page-size", "1")
|
||||
out, err = e.RunCommand("pulumi", "stack", "history", "--page-size", "1")
|
||||
assert.Equal(t, "", err)
|
||||
assert.Contains(t, out, "this is an updated stack")
|
||||
// Get an error message when we page too far
|
||||
|
@ -97,7 +97,7 @@ func TestHistoryCommand(t *testing.T) {
|
|||
assertHasNoHistory(e)
|
||||
// Change stack back, and confirm still has history.
|
||||
e.RunCommand("pulumi", "stack", "select", "history-test")
|
||||
out, err = e.RunCommand("pulumi", "history")
|
||||
out, err = e.RunCommand("pulumi", "stack", "history")
|
||||
assert.Equal(t, "", err)
|
||||
assert.Contains(t, out, "this is an updated stack")
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue