From 5da7a037eaa3092abdcc330c38bc1d43636ecc88 Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Tue, 10 Dec 2024 23:13:29 +0000 Subject: [PATCH 1/4] Move registry update commands under setting This moves `buf registry module update` and `buf registry plugin update` commands to `buf registry module setting update` and `buf registry plugin setting update`, respectively. The command `buf registry module update` is marked deprecated. The command `buf registry plugin update` is removed as it was not yet released. --- private/buf/cmd/buf/buf.go | 21 +++++++++++++++---- .../modulesettingupdate.go} | 15 ++++++++----- .../modulesettingupdate}/usage.gen.go | 2 +- .../pluginsettingupdate.go} | 2 +- .../pluginsettingupdate}/usage.gen.go | 2 +- 5 files changed, 30 insertions(+), 12 deletions(-) rename private/buf/cmd/buf/command/registry/module/{moduleupdate/moduleupdate.go => modulesetting/modulesettingupdate/modulesettingupdate.go} (93%) rename private/buf/cmd/buf/command/registry/module/{moduleupdate => modulesetting/modulesettingupdate}/usage.gen.go (96%) rename private/buf/cmd/buf/command/registry/plugin/{pluginupdate/pluginupdate.go => pluginsetting/pluginsettingupdate/pluginsettingupdate.go} (99%) rename private/buf/cmd/buf/command/registry/plugin/{pluginupdate => pluginsetting/pluginsettingupdate}/usage.gen.go (96%) diff --git a/private/buf/cmd/buf/buf.go b/private/buf/cmd/buf/buf.go index 5febab7e33..aa9f893718 100644 --- a/private/buf/cmd/buf/buf.go +++ b/private/buf/cmd/buf/buf.go @@ -78,8 +78,8 @@ import ( "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelinfo" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabellist" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelunarchive" + "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleundeprecate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleupdate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationcreate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationdelete" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationinfo" @@ -95,7 +95,7 @@ import ( "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabelinfo" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabellist" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabelunarchive" - registrypluginupdate "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginupdate" + "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrycc" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout" @@ -268,12 +268,19 @@ func NewRootCommand(name string) *appcmd.Command { modulelabelunarchive.NewCommand("unarchive", builder, ""), }, }, + { + Use: "setting", + Short: "Manage a module's settings", + SubCommands: []*appcmd.Command{ + modulesettingupdate.NewCommand("update", builder, ""), + }, + }, modulecreate.NewCommand("create", builder), moduleinfo.NewCommand("info", builder), moduledelete.NewCommand("delete", builder), moduledeprecate.NewCommand("deprecate", builder), + modulesettingupdate.NewCommand("update", builder, deprecatedMessage("buf registry module setting update", "buf registry update")), moduleundeprecate.NewCommand("undeprecate", builder), - moduleupdate.NewCommand("update", builder), }, }, { @@ -300,10 +307,16 @@ func NewRootCommand(name string) *appcmd.Command { pluginlabelunarchive.NewCommand("unarchive", builder, ""), }, }, + { + Use: "setting", + Short: "Manage a plugin's settings", + SubCommands: []*appcmd.Command{ + pluginsettingupdate.NewCommand("update", builder), + }, + }, plugincreate.NewCommand("create", builder), plugininfo.NewCommand("info", builder), plugindelete.NewCommand("delete", builder), - registrypluginupdate.NewCommand("update", builder), }, }, }, diff --git a/private/buf/cmd/buf/command/registry/module/moduleupdate/moduleupdate.go b/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/modulesettingupdate.go similarity index 93% rename from private/buf/cmd/buf/command/registry/module/moduleupdate/moduleupdate.go rename to private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/modulesettingupdate.go index a6463a1700..5a27008570 100644 --- a/private/buf/cmd/buf/command/registry/module/moduleupdate/moduleupdate.go +++ b/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/modulesettingupdate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package moduleupdate +package modulesettingupdate import ( "context" @@ -37,12 +37,17 @@ const ( ) // NewCommand returns a new Command -func NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command { +func NewCommand( + name string, + builder appext.SubCommandBuilder, + deprecated string, +) *appcmd.Command { flags := newFlags() return &appcmd.Command{ - Use: name + " ", - Short: "Update BSR module settings", - Args: appcmd.ExactArgs(1), + Use: name + " ", + Short: "Update BSR module settings", + Args: appcmd.ExactArgs(1), + Deprecated: deprecated, Run: builder.NewRunFunc( func(ctx context.Context, container appext.Container) error { return run(ctx, container, flags) diff --git a/private/buf/cmd/buf/command/registry/module/moduleupdate/usage.gen.go b/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/usage.gen.go similarity index 96% rename from private/buf/cmd/buf/command/registry/module/moduleupdate/usage.gen.go rename to private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/usage.gen.go index cc87ee5d95..17819f0749 100644 --- a/private/buf/cmd/buf/command/registry/module/moduleupdate/usage.gen.go +++ b/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/usage.gen.go @@ -14,6 +14,6 @@ // Generated. DO NOT EDIT. -package moduleupdate +package modulesettingupdate import _ "github.com/bufbuild/buf/private/usage" diff --git a/private/buf/cmd/buf/command/registry/plugin/pluginupdate/pluginupdate.go b/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/pluginsettingupdate.go similarity index 99% rename from private/buf/cmd/buf/command/registry/plugin/pluginupdate/pluginupdate.go rename to private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/pluginsettingupdate.go index 5656c1dc7b..a34d68de1b 100644 --- a/private/buf/cmd/buf/command/registry/plugin/pluginupdate/pluginupdate.go +++ b/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/pluginsettingupdate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pluginupdate +package pluginsettingupdate import ( "context" diff --git a/private/buf/cmd/buf/command/registry/plugin/pluginupdate/usage.gen.go b/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/usage.gen.go similarity index 96% rename from private/buf/cmd/buf/command/registry/plugin/pluginupdate/usage.gen.go rename to private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/usage.gen.go index 23136ff2a4..2997645f41 100644 --- a/private/buf/cmd/buf/command/registry/plugin/pluginupdate/usage.gen.go +++ b/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/usage.gen.go @@ -14,6 +14,6 @@ // Generated. DO NOT EDIT. -package pluginupdate +package pluginsettingupdate import _ "github.com/bufbuild/buf/private/usage" From 1d57469c3598fa8c00e42b9fcb31d70207148acb Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Tue, 10 Dec 2024 23:56:42 +0000 Subject: [PATCH 2/4] Add CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 545e830e20..332eac26dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ file. Only WebAssembly check plugins are supported at this time. - Add `buf registry plugin commit {add-label,info,list,resolve}` to manage BSR plugin commits. - Add `buf registry plugin label {archive,info,list,unarchive}` to manage BSR plugin commits. +- Move `buf registry module update` to `buf registry module setting update`. Command + `buf registry module update` is now deprecated. ## [v1.47.2] - 2024-11-14 From 1138fc061f74c700c8e78bdd8f2e77e9508013e9 Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Mon, 16 Dec 2024 21:51:35 +0100 Subject: [PATCH 3/4] Pluralize settings --- CHANGELOG.md | 2 +- private/buf/cmd/buf/buf.go | 14 +++++++------- .../modulesettingsupdate/modulesettingsupdate.go} | 2 +- .../modulesettingsupdate}/usage.gen.go | 2 +- .../pluginsettingsupdate}/pluginsettingupdate.go | 2 +- .../pluginsettingsupdate}/usage.gen.go | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename private/buf/cmd/buf/command/registry/module/{modulesetting/modulesettingupdate/modulesettingupdate.go => modulesettings/modulesettingsupdate/modulesettingsupdate.go} (99%) rename private/buf/cmd/buf/command/registry/module/{modulesetting/modulesettingupdate => modulesettings/modulesettingsupdate}/usage.gen.go (95%) rename private/buf/cmd/buf/command/registry/plugin/{pluginsetting/pluginsettingupdate => pluginsettings/pluginsettingsupdate}/pluginsettingupdate.go (99%) rename private/buf/cmd/buf/command/registry/plugin/{pluginsetting/pluginsettingupdate => pluginsettings/pluginsettingsupdate}/usage.gen.go (95%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 332eac26dc..6cfea225eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ file. Only WebAssembly check plugins are supported at this time. - Add `buf registry plugin commit {add-label,info,list,resolve}` to manage BSR plugin commits. - Add `buf registry plugin label {archive,info,list,unarchive}` to manage BSR plugin commits. -- Move `buf registry module update` to `buf registry module setting update`. Command +- Move `buf registry module update` to `buf registry module settings update`. Command `buf registry module update` is now deprecated. ## [v1.47.2] - 2024-11-14 diff --git a/private/buf/cmd/buf/buf.go b/private/buf/cmd/buf/buf.go index aa9f893718..f7e937e81f 100644 --- a/private/buf/cmd/buf/buf.go +++ b/private/buf/cmd/buf/buf.go @@ -78,7 +78,7 @@ import ( "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelinfo" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabellist" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulelabel/modulelabelunarchive" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate" + "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/module/moduleundeprecate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationcreate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/organization/organizationdelete" @@ -95,7 +95,7 @@ import ( "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabelinfo" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabellist" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginlabel/pluginlabelunarchive" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate" + "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrycc" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin" "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout" @@ -269,17 +269,17 @@ func NewRootCommand(name string) *appcmd.Command { }, }, { - Use: "setting", + Use: "settings", Short: "Manage a module's settings", SubCommands: []*appcmd.Command{ - modulesettingupdate.NewCommand("update", builder, ""), + modulesettingsupdate.NewCommand("update", builder, ""), }, }, modulecreate.NewCommand("create", builder), moduleinfo.NewCommand("info", builder), moduledelete.NewCommand("delete", builder), moduledeprecate.NewCommand("deprecate", builder), - modulesettingupdate.NewCommand("update", builder, deprecatedMessage("buf registry module setting update", "buf registry update")), + modulesettingsupdate.NewCommand("update", builder, deprecatedMessage("buf registry module settings update", "buf registry update")), moduleundeprecate.NewCommand("undeprecate", builder), }, }, @@ -308,10 +308,10 @@ func NewRootCommand(name string) *appcmd.Command { }, }, { - Use: "setting", + Use: "settings", Short: "Manage a plugin's settings", SubCommands: []*appcmd.Command{ - pluginsettingupdate.NewCommand("update", builder), + pluginsettingsupdate.NewCommand("update", builder), }, }, plugincreate.NewCommand("create", builder), diff --git a/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/modulesettingupdate.go b/private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate/modulesettingsupdate.go similarity index 99% rename from private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/modulesettingupdate.go rename to private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate/modulesettingsupdate.go index 5a27008570..8724e456c4 100644 --- a/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/modulesettingupdate.go +++ b/private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate/modulesettingsupdate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package modulesettingupdate +package modulesettingsupdate import ( "context" diff --git a/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/usage.gen.go b/private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate/usage.gen.go similarity index 95% rename from private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/usage.gen.go rename to private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate/usage.gen.go index 17819f0749..00324b6b5a 100644 --- a/private/buf/cmd/buf/command/registry/module/modulesetting/modulesettingupdate/usage.gen.go +++ b/private/buf/cmd/buf/command/registry/module/modulesettings/modulesettingsupdate/usage.gen.go @@ -14,6 +14,6 @@ // Generated. DO NOT EDIT. -package modulesettingupdate +package modulesettingsupdate import _ "github.com/bufbuild/buf/private/usage" diff --git a/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/pluginsettingupdate.go b/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingupdate.go similarity index 99% rename from private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/pluginsettingupdate.go rename to private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingupdate.go index a34d68de1b..7314e28c56 100644 --- a/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/pluginsettingupdate.go +++ b/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingupdate.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package pluginsettingupdate +package pluginsettingsupdate import ( "context" diff --git a/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/usage.gen.go b/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/usage.gen.go similarity index 95% rename from private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/usage.gen.go rename to private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/usage.gen.go index 2997645f41..e0149d3602 100644 --- a/private/buf/cmd/buf/command/registry/plugin/pluginsetting/pluginsettingupdate/usage.gen.go +++ b/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/usage.gen.go @@ -14,6 +14,6 @@ // Generated. DO NOT EDIT. -package pluginsettingupdate +package pluginsettingsupdate import _ "github.com/bufbuild/buf/private/usage" From 0eb298fd6b7a88725d1a5ea1860bb78ad196684a Mon Sep 17 00:00:00 2001 From: Edward McFarlane Date: Mon, 16 Dec 2024 21:58:36 +0100 Subject: [PATCH 4/4] Fix filename --- .../{pluginsettingupdate.go => pluginsettingsupdate.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/{pluginsettingupdate.go => pluginsettingsupdate.go} (100%) diff --git a/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingupdate.go b/private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingsupdate.go similarity index 100% rename from private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingupdate.go rename to private/buf/cmd/buf/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingsupdate.go