Skip to content

Commit

Permalink
Convert to use fixed versions of gen in buf, fix arrays bug (#240)
Browse files Browse the repository at this point in the history
* Convert to use fixed versions of gen in buf, fix arrays bug

* Remove accidental buf.gen.yaml at root

* Lock versions of protoc-gen-go for options/types generation
  • Loading branch information
Calebjh authored Aug 22, 2022
1 parent d010553 commit 51a4b3c
Show file tree
Hide file tree
Showing 24 changed files with 1,691 additions and 1,584 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Generate
run: make gentool generate-gentool
run: make generate
- name: Stale
run: git diff --exit-code
test:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lint: $(BUF)
build: $(BUF)
buf build

test: lint build
test: build
go test -v ./...

regenerate: clean-gen generate
Expand All @@ -25,7 +25,7 @@ clean-gen:
cd options && rm -f *.pb.gorm.go && rm -f *.pb.go
cd types && rm -f types.pb.go

generate: options/gorm.pb.go types/types.pb.go example/user/*.pb.go example/postgres_arrays/*.pb.go example/feature_demo/*.pb.go
generate: build options/gorm.pb.go types/types.pb.go install example/user/*.pb.go example/postgres_arrays/*.pb.go example/feature_demo/*.pb.go

options/gorm.pb.go: proto/options/gorm.proto
buf generate --template proto/options/buf.gen.yaml --path proto/options
Expand Down
2 changes: 1 addition & 1 deletion Makefile.buf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ HTTPS_GIT := https://github.com/bufbuild/buf-example.git
# See https://buf.build/docs/inputs#ssh for more details.
SSH_GIT := ssh://[email protected]/bufbuild/buf-example.git
# This controls the version of buf to install and use.
BUF_VERSION := 0.43.2
BUF_VERSION := 1.7.0
# If true, Buf is installed from source instead of from releases
BUF_INSTALL_FROM_SOURCE := false

Expand Down
5 changes: 5 additions & 0 deletions buf.work.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: v1
directories:
- proto
- example
- third_party/proto
7 changes: 1 addition & 6 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# https://docs.buf.build/lint-usage/
version: v1beta1
version: v1
name: infoblox.com/infobloxopen/protoc-gen-gorm
build:
roots:
- proto
- third_party/proto
- example/
lint:
use:
- DEFAULT
Expand Down
6 changes: 3 additions & 3 deletions example/feature_demo/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: v1beta1
version: v1
plugins:
- name: go
- remote: buf.build/library/plugins/go:v1.27.1-1
out: example
opt:
- paths=source_relative
- name: go-grpc
- remote: buf.build/library/plugins/go-grpc:v1.1.0-2
out: example
opt: paths=source_relative
- name: gorm
Expand Down
2 changes: 1 addition & 1 deletion example/feature_demo/demo_multi_file.pb.go

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

86 changes: 1 addition & 85 deletions example/feature_demo/demo_multi_file_service.pb.go

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

101 changes: 101 additions & 0 deletions example/feature_demo/demo_multi_file_service_grpc.pb.go

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

Loading

0 comments on commit 51a4b3c

Please sign in to comment.