Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to buf.build/go/spdx #3350

Merged
merged 3 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ private/bufpkg/buftesting/cache/
private/pkg/bandeps/cmd/bandeps/bandeps
private/pkg/git/cmd/git-ls-files-unstaged/git-ls-files-unstaged
private/pkg/licenseheader/cmd/license-header/license-header
private/pkg/spdx/cmd/spdx-go-data/spdx-go-data
private/pkg/storage/cmd/ddiff/ddiff
private/pkg/storage/cmd/storage-go-data/storage-go-data
private/pkg/storage/storageos/tmp/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
/private/pkg/bandeps/cmd/bandeps/bandeps
/private/pkg/git/cmd/git-ls-files-unstaged/git-ls-files-unstaged
/private/pkg/licenseheader/cmd/license-header/license-header
/private/pkg/spdx/cmd/spdx-go-data/spdx-go-data
/private/pkg/storage/cmd/ddiff/ddiff
/private/pkg/storage/cmd/storage-go-data/storage-go-data
/private/pkg/storage/storageos/tmp/
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.34.2-20240821192916-45ba72cdd479.2
buf.build/go/bufplugin v0.3.0
buf.build/go/protoyaml v0.2.0
buf.build/go/spdx v0.2.0
connectrpc.com/connect v1.17.0
connectrpc.com/otelconnect v0.7.1
github.com/bufbuild/protocompile v0.14.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ buf.build/go/bufplugin v0.3.0 h1:0kxad9/q3nCEbHVYR02crapmRyVT0zTqC/gNkzxuWSs=
buf.build/go/bufplugin v0.3.0/go.mod h1:Znx3zF4ThDWGN1eGFMsbVT9LkMcVV4MKeAC9hiGdN6g=
buf.build/go/protoyaml v0.2.0 h1:2g3OHjtLDqXBREIOjpZGHmQ+U/4mkN1YiQjxNB68Ip8=
buf.build/go/protoyaml v0.2.0/go.mod h1:L/9QvTDkTWcDTzAL6HMfN+mYC6CmZRm2KnsUA054iL0=
buf.build/go/spdx v0.2.0 h1:IItqM0/cMxvFJJumcBuP8NrsIzMs/UYjp/6WSpq8LTw=
buf.build/go/spdx v0.2.0/go.mod h1:bXdwQFem9Si3nsbNy8aJKGPoaPi5DKwdeEp5/ArZ6w8=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
connectrpc.com/connect v1.17.0 h1:W0ZqMhtVzn9Zhn2yATuUokDLO5N+gIuBWMOnsQrfmZk=
connectrpc.com/connect v1.17.0/go.mod h1:0292hj1rnx8oFrStN7cB4jjVBeqs+Yx5yDIC2prWDO8=
Expand Down
8 changes: 2 additions & 6 deletions make/buf/all.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ GO_BINS := $(GO_BINS) \
private/pkg/git/cmd/git-ls-files-unstaged \
private/pkg/storage/cmd/ddiff \
private/pkg/storage/cmd/storage-go-data \
private/pkg/licenseheader/cmd/license-header \
private/pkg/spdx/cmd/spdx-go-data
private/pkg/licenseheader/cmd/license-header
GO_TEST_BINS := $(GO_TEST_BINS) \
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver \
private/buf/cmd/buf/command/alpha/protoc/internal/protoc-gen-insertion-point-writer \
Expand Down Expand Up @@ -82,13 +81,10 @@ bandeps: installbandeps
postlonglint:: bandeps

.PHONY: godata
godata: installspdx-go-data installwkt-go-data installbuf-legacyfederation-go-data $(PROTOC)
godata: installwkt-go-data installbuf-legacyfederation-go-data $(PROTOC)
rm -rf private/gen/data/datawkt
mkdir -p private/gen/data/datawkt
wkt-go-data "$(CACHE_INCLUDE)" --package datawkt --protobuf-version "$(PROTOC_VERSION)" > private/gen/data/datawkt/datawkt.gen.go
rm -rf private/gen/data/dataspdx
mkdir -p private/gen/data/dataspdx
spdx-go-data --package dataspdx > private/gen/data/dataspdx/dataspdx.gen.go
ifdef LEGACY_FEDERATION_FILE_PATH
rm -rf private/gen/data/datalegacyfederation
mkdir -p private/gen/data/datalegacyfederation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"fmt"
"strings"

"buf.build/go/spdx"
"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref"
"github.com/bufbuild/buf/private/gen/data/dataspdx"
"github.com/bufbuild/buf/private/pkg/slicesext"
"golang.org/x/mod/modfile"
"golang.org/x/mod/semver"
Expand Down Expand Up @@ -66,8 +66,8 @@ func newConfig(externalConfig ExternalConfig, options []ConfigOption) (*Config,
}
spdxLicenseID := externalConfig.SPDXLicenseID
if spdxLicenseID != "" {
if licenseInfo, ok := dataspdx.GetLicenseInfo(spdxLicenseID); ok {
spdxLicenseID = licenseInfo.ID()
if license, ok := spdx.LicenseForID(spdxLicenseID); ok {
spdxLicenseID = license.ID
} else {
return nil, fmt.Errorf("unknown SPDX License ID %q", spdxLicenseID)
}
Expand Down
Loading