From acd6a5e753f1cea0f56b3caa73af838666344eda Mon Sep 17 00:00:00 2001 From: Justin Van Patten Date: Mon, 2 Mar 2020 14:23:40 -0800 Subject: [PATCH] Don't mark policy and watch commands as experimental (#4001) --- CHANGELOG.md | 3 +++ cmd/policy.go | 2 +- cmd/policy_disable.go | 2 +- cmd/policy_enable.go | 2 +- cmd/policy_group_ls.go | 4 ++-- cmd/policy_ls.go | 2 +- cmd/policy_new.go | 2 +- cmd/policy_publish.go | 2 +- cmd/policy_rm.go | 2 +- cmd/preview.go | 8 +++----- cmd/pulumi.go | 12 ++++-------- cmd/up.go | 8 +++----- cmd/watch.go | 10 ++++------ 13 files changed, 26 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63fde1cde..95ca1a08e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ CHANGELOG - Reinstate caching of TypeScript compilation. [#4007](https://github.com/pulumi/pulumi/pull/4007) +- Remove the need to set PULUMI_EXPERIMENTAL to use the policy and watch commands. + [#4001](https://github.com/pulumi/pulumi/pull/4001) + ## 1.11.1 (2020-02-26) - Fix a regression for CustomTimeouts in Python SDK. [#3964](https://github.com/pulumi/pulumi/pull/3964) diff --git a/cmd/policy.go b/cmd/policy.go index 2f2674a0e..579056113 100644 --- a/cmd/policy.go +++ b/cmd/policy.go @@ -22,7 +22,7 @@ import ( func newPolicyCmd() *cobra.Command { cmd := &cobra.Command{ Use: "policy", - Short: "Manage resource policies", + Short: "[PREVIEW] Manage resource policies", Args: cmdutil.NoArgs, } diff --git a/cmd/policy_disable.go b/cmd/policy_disable.go index 6ab8202ae..be206974d 100644 --- a/cmd/policy_disable.go +++ b/cmd/policy_disable.go @@ -31,7 +31,7 @@ func newPolicyDisableCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "disable /", Args: cmdutil.MaximumNArgs(1), - Short: "Disable a Policy Pack for a Pulumi organization", + Short: "[PREVIEW] Disable a Policy Pack for a Pulumi organization", Long: "Disable a Policy Pack for a Pulumi organization", Run: cmdutil.RunFunc(func(cmd *cobra.Command, cliArgs []string) error { // Obtain current PolicyPack, tied to the Pulumi service backend. diff --git a/cmd/policy_enable.go b/cmd/policy_enable.go index b7eb688c4..86f744b7d 100644 --- a/cmd/policy_enable.go +++ b/cmd/policy_enable.go @@ -32,7 +32,7 @@ func newPolicyEnableCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "enable / ", Args: cmdutil.ExactArgs(2), - Short: "Enable a Policy Pack for a Pulumi organization", + Short: "[PREVIEW] Enable a Policy Pack for a Pulumi organization", Long: "Enable a Policy Pack for a Pulumi organization. " + "Can specify latest to enable the latest version of the Policy Pack or a specific version number.", Run: cmdutil.RunFunc(func(cmd *cobra.Command, cliArgs []string) error { diff --git a/cmd/policy_group_ls.go b/cmd/policy_group_ls.go index d47270087..457553dbe 100644 --- a/cmd/policy_group_ls.go +++ b/cmd/policy_group_ls.go @@ -27,7 +27,7 @@ import ( func newPolicyGroupCmd() *cobra.Command { cmd := &cobra.Command{ Use: "group", - Short: "Manage policy groups", + Short: "[PREVIEW] Manage policy groups", Args: cmdutil.NoArgs, } @@ -40,7 +40,7 @@ func newPolicyGroupLsCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "ls [org-name]", Args: cmdutil.MaximumNArgs(1), - Short: "List all Policy Groups for a Pulumi organization", + Short: "[PREVIEW] List all Policy Groups for a Pulumi organization", Long: "List all Policy Groups for a Pulumi organization", Run: cmdutil.RunFunc(func(cmd *cobra.Command, cliArgs []string) error { // Get backend. diff --git a/cmd/policy_ls.go b/cmd/policy_ls.go index b139e17b6..2966b2e2f 100644 --- a/cmd/policy_ls.go +++ b/cmd/policy_ls.go @@ -31,7 +31,7 @@ func newPolicyLsCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "ls [org-name]", Args: cmdutil.MaximumNArgs(1), - Short: "List all Policy Packs for a Pulumi organization", + Short: "[PREVIEW] List all Policy Packs for a Pulumi organization", Long: "List all Policy Packs for a Pulumi organization", Run: cmdutil.RunFunc(func(cmd *cobra.Command, cliArgs []string) error { // Get backend. diff --git a/cmd/policy_new.go b/cmd/policy_new.go index 5705e3f69..bde9965a4 100644 --- a/cmd/policy_new.go +++ b/cmd/policy_new.go @@ -48,7 +48,7 @@ func newPolicyNewCmd() *cobra.Command { cmd := &cobra.Command{ Use: "new [template|url]", SuggestFor: []string{"init", "create"}, - Short: "Create a new Pulumi Policy Pack", + Short: "[PREVIEW] Create a new Pulumi Policy Pack", Long: "Create a new Pulumi Policy Pack from a template.\n" + "\n" + "To create a Policy Pack from a specific template, pass the template name (such as `aws-typescript`\n" + diff --git a/cmd/policy_publish.go b/cmd/policy_publish.go index fa4158d58..d8af396c8 100644 --- a/cmd/policy_publish.go +++ b/cmd/policy_publish.go @@ -35,7 +35,7 @@ func newPolicyPublishCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "publish [org-name]", Args: cmdutil.MaximumNArgs(1), - Short: "Publish a Policy Pack to the Pulumi service", + Short: "[PREVIEW] Publish a Policy Pack to the Pulumi service", Long: "Publish a Policy Pack to the Pulumi service\n" + "\n" + "If an organization name is not specified, the current user account is used.", diff --git a/cmd/policy_rm.go b/cmd/policy_rm.go index ffb41ef36..cd2823ee0 100644 --- a/cmd/policy_rm.go +++ b/cmd/policy_rm.go @@ -27,7 +27,7 @@ func newPolicyRmCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "rm / ", Args: cmdutil.ExactArgs(2), - Short: "Removes a Policy Pack from a Pulumi organization", + Short: "[PREVIEW] Removes a Policy Pack from a Pulumi organization", Long: "Removes a Policy Pack from a Pulumi organization. " + "The Policy Pack must be disabled from all Policy Groups before it can be removed.", Run: cmdutil.RunFunc(func(cmd *cobra.Command, cliArgs []string) error { diff --git a/cmd/preview.go b/cmd/preview.go index 7d3e9d40f..8fae7c43c 100644 --- a/cmd/preview.go +++ b/cmd/preview.go @@ -207,11 +207,9 @@ func newPreviewCmd() *cobra.Command { "Allows updating of dependent targets discovered but not specified in --target list") // Flags for engine.UpdateOptions. - if hasDebugCommands() || hasExperimentalCommands() { - cmd.PersistentFlags().StringSliceVar( - &policyPackPaths, "policy-pack", []string{}, - "Run one or more analyzers as part of this update") - } + cmd.PersistentFlags().StringSliceVar( + &policyPackPaths, "policy-pack", []string{}, + "[PREVIEW] Run one or more policy packs as part of this update") cmd.PersistentFlags().BoolVar( &diffDisplay, "diff", false, "Display operation as a rich diff showing the overall change") diff --git a/cmd/pulumi.go b/cmd/pulumi.go index 1afae5422..7eef9018c 100644 --- a/cmd/pulumi.go +++ b/cmd/pulumi.go @@ -174,6 +174,7 @@ func NewPulumiCmd() *cobra.Command { cmd.AddCommand(newUpCmd()) cmd.AddCommand(newPreviewCmd()) cmd.AddCommand(newDestroyCmd()) + cmd.AddCommand(newWatchCmd()) // - Stack Management Commands: cmd.AddCommand(newStackCmd()) cmd.AddCommand(newConfigCmd()) @@ -181,6 +182,8 @@ func NewPulumiCmd() *cobra.Command { cmd.AddCommand(newLoginCmd()) cmd.AddCommand(newLogoutCmd()) cmd.AddCommand(newWhoAmICmd()) + // - Policy Management Commands: + cmd.AddCommand(newPolicyCmd()) // - Advanced Commands: cmd.AddCommand(newCancelCmd()) cmd.AddCommand(newRefreshCmd()) @@ -198,13 +201,8 @@ func NewPulumiCmd() *cobra.Command { // We have a set of commands that are still experimental and that we add only when PULUMI_EXPERIMENTAL is set // to true. if hasExperimentalCommands() { - // - Deploy Commands: - cmd.AddCommand(newWatchCmd()) // - Query Commands: cmd.AddCommand(newQueryCmd()) - // - Policy Management Commands: - cmd.AddCommand(newPolicyCmd()) - } // We have a set of options that are useful for developers of pulumi that we add when PULUMI_DEBUG_COMMANDS is @@ -215,13 +213,11 @@ func NewPulumiCmd() *cobra.Command { // - Diagnostic Commands: cmd.AddCommand(newViewTraceCmd()) - // For legacy reasons, we make these two commands available also under PULUMI_DEBUG_COMMANDS, though + // For legacy reasons, we make this command available also under PULUMI_DEBUG_COMMANDS, though // PULUMI_EXPERIMENTAL should be preferred. // - Query Commands: cmd.AddCommand(newQueryCmd()) - // - Policy Management Commands: - cmd.AddCommand(newPolicyCmd()) } return cmd diff --git a/cmd/up.go b/cmd/up.go index 840efd3c5..045a83a0f 100644 --- a/cmd/up.go +++ b/cmd/up.go @@ -410,11 +410,9 @@ func newUpCmd() *cobra.Command { "Allows updating of dependent targets discovered but not specified in --target list") // Flags for engine.UpdateOptions. - if hasDebugCommands() || hasExperimentalCommands() { - cmd.PersistentFlags().StringSliceVar( - &policyPackPaths, "policy-pack", []string{}, - "Run one or more policy packs as part of this update") - } + cmd.PersistentFlags().StringSliceVar( + &policyPackPaths, "policy-pack", []string{}, + "[PREVIEW] Run one or more policy packs as part of this update") cmd.PersistentFlags().BoolVar( &diffDisplay, "diff", false, "Display operation as a rich diff showing the overall change") diff --git a/cmd/watch.go b/cmd/watch.go index 5ffe9b307..c7b60070c 100644 --- a/cmd/watch.go +++ b/cmd/watch.go @@ -48,7 +48,7 @@ func newWatchCmd() *cobra.Command { var cmd = &cobra.Command{ Use: "watch", SuggestFor: []string{"developer", "dev"}, - Short: "Continuously update the resources in a stack", + Short: "[PREVIEW] Continuously update the resources in a stack", Long: "Continuously update the resources in a stack.\n" + "\n" + "This command watches the working directory for the current project and updates the active stack whenever\n" + @@ -159,11 +159,9 @@ func newWatchCmd() *cobra.Command { "Optional message to associate with each update operation") // Flags for engine.UpdateOptions. - if hasDebugCommands() || hasExperimentalCommands() { - cmd.PersistentFlags().StringSliceVar( - &policyPackPaths, "policy-pack", []string{}, - "Run one or more policy packs as part of each update") - } + cmd.PersistentFlags().StringSliceVar( + &policyPackPaths, "policy-pack", []string{}, + "[PREVIEW] Run one or more policy packs as part of each update") cmd.PersistentFlags().IntVarP( ¶llel, "parallel", "p", defaultParallel, "Allow P resource operations to run in parallel at once (1 for no parallelism). Defaults to unbounded.")