Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into plugin-config-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
doriable committed Dec 18, 2024
2 parents 226382b + b4d7836 commit 42c9619
Show file tree
Hide file tree
Showing 51 changed files with 3,218 additions and 2,863 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
5 changes: 5 additions & 0 deletions make/go/buf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ bufbreaking: $(BUF)
postlint:: bufbreaking
endif
endif

.PHONY: updatebufversion
updatebufversion:
$(SED_I) -E "s/BUF_VERSION \?=.*/BUF_VERSION ?= v${RELEASE_BUF_VERSION}/" "make/go/dep_buf.mk"
$(SED_I) -E "s/\# https\:\/\/github.com\/bufbuild\/buf\/releases.*/\# https\:\/\/github.com\/bufbuild\/buf\/releases $(shell date "+%Y%m%d") checked $(shell date "+%Y%m%d")/" "make/go/dep_buf.mk"
4 changes: 2 additions & 2 deletions make/go/dep_buf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ $(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/bufbuild/buf/releases 20240911 checked 20240916
BUF_VERSION ?= v1.41.0
# https://github.com/bufbuild/buf/releases 20241114 checked 20241114
BUF_VERSION ?= v1.47.2
# Settable
#
# If set, this path will be installed every time someone depends on $(BUF)
Expand Down
7 changes: 3 additions & 4 deletions make/go/dep_golangci_lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
# Must be set
$(call _assert_var,MAKEGO)
$(call _conditional_include,$(MAKEGO)/base.mk)
$(call _conditional_include,$(MAKEGO)/dep_jq.mk)
$(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# We want to ensure we rebuild golangci-lint every time we require a new Go minor version.
# Otherwise, the cached version may not support the latest language features.
GOLANGCI_LINT_GO_VERSION := $(shell go mod edit -json | jq -r .Go | cut -d'.' -f1-2)
GOLANGCI_LINT_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)

# Settable
# https://github.com/golangci/golangci-lint/releases 20240909 checked 20240916
# https://github.com/golangci/golangci-lint/releases 20241110 checked 20241113
# Contrast golangci-lint configuration with the one in https://github.com/connectrpc/connect-go/blob/main/.golangci.yml when upgrading
GOLANGCI_LINT_VERSION ?= v1.61.0
GOLANGCI_LINT_VERSION ?= v1.62.0

GOLANGCI_LINT := $(CACHE_VERSIONS)/golangci-lint/$(GOLANGCI_LINT_VERSION)-go$(GOLANGCI_LINT_GO_VERSION)
$(GOLANGCI_LINT):
Expand Down
11 changes: 4 additions & 7 deletions make/go/dep_jq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ JQ_VERSION ?= 1.7.1

ifeq ($(UNAME_OS),Darwin)
JQ_OS := macos
else ifeq ($(UNAME_OS),Linux)
JQ_OS := linux
endif

ifeq ($(UNAME_ARCH),x86_64)
JQ_ARCH := amd64
else
JQ_ARCH := $(UNAME_ARCH)
endif
endif

ifeq ($(UNAME_ARCH),x86_64)
ifeq ($(UNAME_OS),Linux)
JQ_OS := linux
JQ_ARCH := amd64
endif
endif
JQ := $(CACHE_VERSIONS)/jq/$(JQ_VERSION)
$(JQ):
@rm -f $(CACHE_BIN)/jq
Expand Down
4 changes: 2 additions & 2 deletions make/go/dep_protoc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $(call _assert_var,CACHE_INCLUDE)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/protocolbuffers/protobuf/releases 20240523 checked 20240527
# https://github.com/protocolbuffers/protobuf/releases 20241204 checked 20241217
# NOTE: Set to version compatible with genproto source code (only used in tests).
PROTOC_VERSION ?= 27.0
PROTOC_VERSION ?= 29.1

# Google adds a dash to release candidate versions in the name of the
# release artifact, i.e. v27.0-rc1 -> v27.0-rc-1
Expand Down
2 changes: 1 addition & 1 deletion make/go/dep_protoc_gen_go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/protocolbuffers/protobuf-go/releases 20241216 checked 20241216
# https://github.com/protocolbuffers/protobuf-go/releases 20241216 checked 20241217
PROTOC_GEN_GO_VERSION ?= v1.36.0

GO_GET_PKGS := $(GO_GET_PKGS) \
Expand Down
18 changes: 9 additions & 9 deletions make/go/dep_yq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ YQ_VERSION ?= v4.44.1

ifeq ($(UNAME_OS),Darwin)
YQ_OS := darwin
ifeq ($(UNAME_ARCH),x86_64)
YQ_ARCH := amd64
endif
ifeq ($(UNAME_ARCH),arm64)
YQ_ARCH := arm64
endif
else ifeq ($(UNAME_OS),Linux)
YQ_OS := linux
endif

ifeq ($(UNAME_ARCH),x86_64)
ifeq ($(UNAME_OS),Linux)
YQ_OS := linux
YQ_ARCH := amd64
else ifeq ($(UNAME_ARCH),arm64)
YQ_ARCH := arm64
else ifeq ($(UNAME_ARCH),aarch64)
YQ_ARCH := arm64
else
YQ_ARCH := $(UNAME_ARCH)
endif
endif


YQ := $(CACHE_VERSIONS)/yq/$(YQ_VERSION)
$(YQ):
Expand Down
2 changes: 1 addition & 1 deletion make/go/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ GO_GET_PKGS ?=
# Settable
GO_MOD_VERSION ?= 1.22
# Settable
GO_MOD_TOOLCHAIN ?= 1.23.2
GO_MOD_TOOLCHAIN ?= 1.23.4
# Settable
GO_ALL_REPO_PKGS ?= ./cmd/... ./internal/...
# Settable
Expand Down
7 changes: 6 additions & 1 deletion private/buf/bufmigrate/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
"github.com/bufbuild/buf/private/bufpkg/bufmodule"
"github.com/bufbuild/buf/private/bufpkg/bufparse"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
"github.com/bufbuild/buf/private/pkg/normalpath"
"github.com/bufbuild/buf/private/pkg/slicesext"
"github.com/bufbuild/buf/private/pkg/storage"
Expand Down Expand Up @@ -695,7 +696,11 @@ func equivalentCheckConfigInV2(
) (bufconfig.CheckConfig, error) {
// No need for custom lint/breaking plugins since there's no plugins to migrate from <=v1.
// TODO: If we ever need v3, then we will have to deal with this.
client, err := bufcheck.NewClient(logger, bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime))
client, err := bufcheck.NewClient(logger, bufcheck.NewLocalRunnerProvider(
wasm.UnimplementedRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
))
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions private/buf/bufprotopluginexec/bufprotopluginexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const (
// defaultMajorVersion is the default major version.
defaultMajorVersion = 5
// defaultMinorVersion is the default minor version.
defaultMinorVersion = 27
defaultMinorVersion = 29
// defaultPatchVersion is the default patch version.
defaultPatchVersion = 0
defaultPatchVersion = 1
// defaultSuffixVersion is the default suffix version.
defaultSuffixVersion = ""
)
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
7 changes: 6 additions & 1 deletion private/buf/cmd/buf/buf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
"github.com/bufbuild/buf/private/bufpkg/bufimage"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1"
"github.com/bufbuild/buf/private/pkg/app/appcmd"
"github.com/bufbuild/buf/private/pkg/app/appcmd/appcmdtesting"
Expand Down Expand Up @@ -1350,7 +1351,11 @@ func TestCheckLsBreakingRulesFromConfigExceptDeprecated(t *testing.T) {
// Do not need any custom lint/breaking plugins here.
client, err := bufcheck.NewClient(
slogtestext.NewLogger(t),
bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime),
bufcheck.NewLocalRunnerProvider(
wasm.UnimplementedRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
),
)
require.NoError(t, err)
allRules, err := client.AllRules(context.Background(), check.RuleTypeBreaking, version)
Expand Down
7 changes: 6 additions & 1 deletion private/buf/cmd/buf/command/beta/lsp/lsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/bufbuild/buf/private/buf/bufcli"
"github.com/bufbuild/buf/private/buf/buflsp"
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
"github.com/bufbuild/buf/private/pkg/app/appcmd"
"github.com/bufbuild/buf/private/pkg/app/appext"
"github.com/bufbuild/buf/private/pkg/ioext"
Expand Down Expand Up @@ -115,7 +116,11 @@ func run(
}()
checkClient, err := bufcheck.NewClient(
container.Logger(),
bufcheck.NewRunnerProvider(wasmRuntime),
bufcheck.NewLocalRunnerProvider(
wasmRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
),
bufcheck.ClientWithStderr(container.Stderr()),
)
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion private/buf/cmd/buf/command/breaking/breaking.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
"github.com/bufbuild/buf/private/bufpkg/bufimage"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
"github.com/bufbuild/buf/private/pkg/app/appcmd"
"github.com/bufbuild/buf/private/pkg/app/appext"
"github.com/bufbuild/buf/private/pkg/slicesext"
Expand Down Expand Up @@ -227,7 +228,11 @@ func run(
for i, imageWithConfig := range imageWithConfigs {
client, err := bufcheck.NewClient(
container.Logger(),
bufcheck.NewRunnerProvider(wasmRuntime),
bufcheck.NewLocalRunnerProvider(
wasmRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
),
bufcheck.ClientWithStderr(container.Stderr()),
)
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion private/buf/cmd/buf/command/config/internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/bufbuild/buf/private/buf/bufcli"
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
"github.com/bufbuild/buf/private/pkg/app/appcmd"
"github.com/bufbuild/buf/private/pkg/app/appext"
"github.com/bufbuild/buf/private/pkg/normalpath"
Expand Down Expand Up @@ -196,7 +197,11 @@ func lsRun(
}()
client, err := bufcheck.NewClient(
container.Logger(),
bufcheck.NewRunnerProvider(wasmRuntime),
bufcheck.NewLocalRunnerProvider(
wasmRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
),
bufcheck.ClientWithStderr(container.Stderr()),
)
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion private/buf/cmd/buf/command/lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/bufbuild/buf/private/bufpkg/bufanalysis"
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
"github.com/bufbuild/buf/private/pkg/app/appcmd"
"github.com/bufbuild/buf/private/pkg/app/appext"
"github.com/bufbuild/buf/private/pkg/slicesext"
Expand Down Expand Up @@ -153,7 +154,11 @@ func run(
for _, imageWithConfig := range imageWithConfigs {
client, err := bufcheck.NewClient(
container.Logger(),
bufcheck.NewRunnerProvider(wasmRuntime),
bufcheck.NewLocalRunnerProvider(
wasmRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
),
bufcheck.ClientWithStderr(container.Stderr()),
)
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion private/buf/cmd/buf/command/mod/internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/bufbuild/buf/private/buf/bufcli"
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"github.com/bufbuild/buf/private/bufpkg/bufconfig"
"github.com/bufbuild/buf/private/bufpkg/bufplugin"
"github.com/bufbuild/buf/private/pkg/app/appcmd"
"github.com/bufbuild/buf/private/pkg/app/appext"
"github.com/bufbuild/buf/private/pkg/slicesext"
Expand Down Expand Up @@ -175,7 +176,11 @@ func lsRun(
// BufYAMLFiles <=v1 never had plugins.
client, err := bufcheck.NewClient(
container.Logger(),
bufcheck.NewRunnerProvider(wasm.UnimplementedRuntime),
bufcheck.NewLocalRunnerProvider(
wasm.UnimplementedRuntime,
bufplugin.NopPluginKeyProvider,
bufplugin.NopPluginDataProvider,
),
bufcheck.ClientWithStderr(container.Stderr()),
)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func upload(
var err error
plugin, err = bufplugin.NewLocalWasmPlugin(
pluginFullName,
nil, // args
func() ([]byte, error) {
wasmBinary, err := os.ReadFile(flags.Binary)
if err != nil {
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.

Loading

0 comments on commit 42c9619

Please sign in to comment.