Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Dec 18, 2024
2 parents ec3d311 + b4d7836 commit 67b827a
Show file tree
Hide file tree
Showing 52 changed files with 4,011 additions and 3,638 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"
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 @@ -25,6 +25,7 @@ import (
"github.com/bufbuild/buf/private/bufpkg/bufanalysis"
"github.com/bufbuild/buf/private/bufpkg/bufcheck"
"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 @@ -220,7 +221,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 @@ -23,6 +23,7 @@ import (
"github.com/bufbuild/buf/private/buf/bufctl"
"github.com/bufbuild/buf/private/bufpkg/bufanalysis"
"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/stringutil"
Expand Down Expand Up @@ -145,7 +146,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.

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
Loading

0 comments on commit 67b827a

Please sign in to comment.