Skip to content

Commit

Permalink
Move registry update commands under settings (#3528)
Browse files Browse the repository at this point in the history
  • Loading branch information
emcfarlane authored Dec 17, 2024
1 parent 94679e3 commit 33d2db4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 settings update`. Command
`buf registry module update` is now deprecated.

## [v1.47.2] - 2024-11-14

Expand Down
21 changes: 17 additions & 4 deletions private/buf/cmd/buf/buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/modulesettings/modulesettingsupdate"
"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"
Expand All @@ -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/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"
Expand Down Expand Up @@ -268,12 +268,19 @@ func NewRootCommand(name string) *appcmd.Command {
modulelabelunarchive.NewCommand("unarchive", builder, ""),
},
},
{
Use: "settings",
Short: "Manage a module's settings",
SubCommands: []*appcmd.Command{
modulesettingsupdate.NewCommand("update", builder, ""),
},
},
modulecreate.NewCommand("create", builder),
moduleinfo.NewCommand("info", builder),
moduledelete.NewCommand("delete", builder),
moduledeprecate.NewCommand("deprecate", builder),
modulesettingsupdate.NewCommand("update", builder, deprecatedMessage("buf registry module settings update", "buf registry update")),
moduleundeprecate.NewCommand("undeprecate", builder),
moduleupdate.NewCommand("update", builder),
},
},
{
Expand All @@ -300,10 +307,16 @@ func NewRootCommand(name string) *appcmd.Command {
pluginlabelunarchive.NewCommand("unarchive", builder, ""),
},
},
{
Use: "settings",
Short: "Manage a plugin's settings",
SubCommands: []*appcmd.Command{
pluginsettingsupdate.NewCommand("update", builder),
},
},
plugincreate.NewCommand("create", builder),
plugininfo.NewCommand("info", builder),
plugindelete.NewCommand("delete", builder),
registrypluginupdate.NewCommand("update", builder),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package moduleupdate
package modulesettingsupdate

import (
"context"
Expand All @@ -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 + " <remote/owner/module>",
Short: "Update BSR module settings",
Args: appcmd.ExactArgs(1),
Use: name + " <remote/owner/module>",
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)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package pluginupdate
package pluginsettingsupdate

import (
"context"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33d2db4

Please sign in to comment.