Skip to content

Commit

Permalink
Merge v2 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
johanbrandhorst authored Oct 14, 2020
2 parents bb9b89e + d4e62de commit 26104fd
Show file tree
Hide file tree
Showing 292 changed files with 28,440 additions and 16,547 deletions.
44 changes: 32 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ commands:
executors:
build-env:
environment:
## Split key to avoid github from revoking it
## Split key to avoid github revoking it
password0: '99544cdcb19ad4e3fd64'
password1: '3ec86b2e5a431be2d72c'
GLOG_logtostderr: '1'
Expand Down Expand Up @@ -84,8 +84,22 @@ jobs:
working_directory: /src/grpc-gateway
steps:
- checkout
- run: go get golang.org/x/lint/golint
- run: make lint
- restore_cache:
keys:
- v1-staticcheck-cache-{{ checksum "go.sum" }}
- v1-staticcheck-cache-
- run:
name: Install staticcheck outside local module
command: |
cd $(mktemp -d) &&
go mod init tmp &&
go get honnef.co/go/tools/cmd/staticcheck
- run: staticcheck ./...
- save_cache:
key: v1-staticcheck-cache-{{ checksum "go.sum" }}
paths:
- /root/.cache/go-build
- /root/.cache/staticcheck
fuzzit:
docker:
- image: fuzzitdev/fuzzit:golang1.12-stretch-llvm9
Expand All @@ -106,16 +120,22 @@ jobs:
- configure_bazel
- run:
name: Check that Bazel BUILD files are up-to-date
command: 'bazel run //:gazelle -- --mode=diff ||
(echo "ERROR: Bazel files out-of-date, please run \`bazel run :gazelle\`" >&2; exit 1)'
command: |
bazel run //:gazelle &&
git diff --exit-code
- run:
name: Run tests with Bazel
command: bazel test //...
name: Check that repositories.bzl is up-to-date
command: |
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories &&
git diff --exit-code
- run:
name: Check formatting of Bazel BUILD files
command: 'bazel run //:buildifier_check ||
(echo "ERROR: Bazel files not formatted, please run \`bazel run :buildifier\`" >&2; exit 1)'
when: always
command: |
bazel run //:buildifier &&
git diff --exit-code
- run:
name: Run tests with Bazel
command: bazel test //...
- save_cache:
key: v2-bazel-cache-{{ checksum "repositories.bzl" }}
paths:
Expand All @@ -131,7 +151,7 @@ jobs:
cd $(mktemp -d) &&
go mod init tmp &&
go get golang.org/x/exp/cmd/gorelease@latest
- run: gorelease
- run: gorelease -base=v2.0.0-beta.5
release:
executor: build-env
working_directory: /src/grpc-gateway
Expand Down Expand Up @@ -182,7 +202,7 @@ workflows:
- update-repositoriesbzl:
filters:
branches:
only: /renovate\/.+/
only: /renovate\/master-.+/
tags:
ignore: /.*/
- regenerate:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
```sh
go get -u github.com/grpc-ecosystem/grpc-gateway
```
- [ ] Delete the `protoc-gen-grpc-gateway` and `protoc-gen-swagger` binary from your `PATH`,
- [ ] Delete the `protoc-gen-grpc-gateway` and `protoc-gen-openapiv2` binary from your `PATH`,
and reinstall the latest versions:
```sh
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2
```

## I still have a problem!
Expand Down
6 changes: 3 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ builds:
- windows
goarch:
- amd64
- main: ./protoc-gen-swagger/main.go
id: protoc-gen-swagger
binary: protoc-gen-swagger
- main: ./protoc-gen-openapiv2/main.go
id: protoc-gen-openapiv2
binary: protoc-gen-openapiv2
env:
- CGO_ENABLED=0
goos:
Expand Down
63 changes: 60 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")

buildifier(
name = "buildifier",
Expand All @@ -11,16 +12,72 @@ buildifier(
)

# gazelle:exclude third_party
# gazelle:exclude vendor
# gazelle:exclude _output
# gazelle:prefix github.com/grpc-ecosystem/grpc-gateway
# gazelle:prefix github.com/grpc-ecosystem/grpc-gateway/v2
# gazelle:go_proto_compilers //:go_apiv2
# gazelle:go_grpc_compilers //:go_apiv2, //:go_grpc

gazelle(name = "gazelle")

package_group(
name = "generators",
packages = [
"//protoc-gen-grpc-gateway/...",
"//protoc-gen-swagger/...",
"//protoc-gen-openapiv2/...",
],
)

go_proto_compiler(
name = "go_apiv2",
options = [
"paths=source_relative",
],
plugin = "@org_golang_google_protobuf//cmd/protoc-gen-go",
suffix = ".pb.go",
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:any_go_proto",
"@io_bazel_rules_go//proto/wkt:api_go_proto",
"@io_bazel_rules_go//proto/wkt:compiler_plugin_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:field_mask_go_proto",
"@io_bazel_rules_go//proto/wkt:source_context_go_proto",
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@io_bazel_rules_go//proto/wkt:type_go_proto",
"@io_bazel_rules_go//proto/wkt:wrappers_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
],
)

go_proto_compiler(
name = "go_grpc",
options = [
"paths=source_relative",
"require_unimplemented_servers=false",
],
plugin = "@org_golang_google_grpc_cmd_protoc_gen_go_grpc//:protoc-gen-go-grpc",
suffix = "_grpc.pb.go",
visibility = ["//visibility:public"],
deps = [
"@io_bazel_rules_go//proto/wkt:any_go_proto",
"@io_bazel_rules_go//proto/wkt:api_go_proto",
"@io_bazel_rules_go//proto/wkt:compiler_plugin_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:field_mask_go_proto",
"@io_bazel_rules_go//proto/wkt:source_context_go_proto",
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@io_bazel_rules_go//proto/wkt:type_go_proto",
"@io_bazel_rules_go//proto/wkt:wrappers_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
],
)
Loading

0 comments on commit 26104fd

Please sign in to comment.