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

Updated Patch behavior #806

Closed
wants to merge 8 commits into from
Closed
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
36 changes: 22 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,32 @@ jobs:
- run: dep ensure --vendor-only
- run: go get golang.org/x/lint/golint
- run: make lint
bazel_lint:
bazel:
docker:
- image: l.gcr.io/google/bazel:latest
working_directory: /go/src/github.com/grpc-ecosystem/grpc-gateway
steps:
- checkout
- run: 'bazel --output_base=$HOME/.cache/_grpc_gateway_bazel run //:buildifier_check ||
(echo "Bazel files not formatted, please run \`bazel run :buildifier\`"; exit 1)'
- run: 'test -z "$(bazel --output_base=$HOME/.cache/_grpc_gateway_bazel run //:gazelle_diff)" ||
(echo "Bazel files out-of-date, please run \`bazel run :gazelle_diff\`"; exit 1)'
bazel_test:
docker:
- image: l.gcr.io/google/bazel:latest
working_directory: /go/src/github.com/grpc-ecosystem/grpc-gateway
steps:
- checkout
- run: bazel --output_base=$HOME/.cache/_grpc_gateway_bazel test --test_output=errors --features=race //...
- run:
name: Create Bazel config file (.bazelrc)
command: |
cat > .bazelrc << EOF
startup --output_base $HOME/.cache/_grpc_gateway_bazel
build --test_output errors
build --features race
EOF
- run:
name: Check that Bazel BUILD files are up-to-date
command: 'test -z "$(bazel run //:gazelle_diff)" ||
(echo "ERROR: Bazel files out-of-date, please run \`bazel run :gazelle_fix\`" >&2; exit 1)'
- run:
name: Run tests with Bazel
command: bazel test //...
- 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
build_linux_release:
docker:
- image: jfbrandhorst/grpc-gateway-build-env
Expand Down Expand Up @@ -153,8 +162,7 @@ workflows:
- node_test
- generate
- lint
- bazel_lint
- bazel_test
- bazel
- build_linux_release:
filters:
branches:
Expand Down
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildifier(
)

# gazelle:exclude third_party
# gazelle:exclude vendor

gazelle(
name = "gazelle_diff",
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ All submissions, including submissions by project members, require review.
Great, it should be as simple as thus (run from the root of the directory):

```bash
$ docker run -v $(pwd):/go/src/github.com/grpc-ecosystem/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env \
docker run -v $(pwd):/go/src/github.com/grpc-ecosystem/grpc-gateway --rm jfbrandhorst/grpc-gateway-build-env \
/bin/bash -c 'cd /go/src/github.com/grpc-ecosystem/grpc-gateway && \
make realclean && \
make examples SWAGGER_CODEGEN="${SWAGGER_CODEGEN}"'
docker run -itv $(pwd):/grpc-gateway -w /grpc-gateway --entrypoint /bin/bash --rm \
l.gcr.io/google/bazel -c 'bazel run :gazelle_fix; bazel run :buildifier'
```

If this has resulted in some file changes in the repo, please ensure you check those in with your merge request.
63 changes: 57 additions & 6 deletions Gopkg.lock

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

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUNTIME_GO=$(RUNTIME_PROTO:.proto=.pb.go)
OPENAPIV2_PROTO=protoc-gen-swagger/options/openapiv2.proto protoc-gen-swagger/options/annotations.proto
OPENAPIV2_GO=$(OPENAPIV2_PROTO:.proto=.pb.go)

PKGMAP=Mgoogle/protobuf/descriptor.proto=$(GO_PLUGIN_PKG)/descriptor,Mexamples/proto/sub/message.proto=$(PKG)/examples/proto/sub
PKGMAP=Mgoogle/protobuf/field_mask.proto=google.golang.org/genproto/protobuf/field_mask,Mgoogle/protobuf/descriptor.proto=$(GO_PLUGIN_PKG)/descriptor,Mexamples/proto/sub/message.proto=$(PKG)/examples/proto/sub
ADDITIONAL_GW_FLAGS=
ifneq "$(GATEWAY_PLUGIN_FLAGS)" ""
ADDITIONAL_GW_FLAGS=,$(GATEWAY_PLUGIN_FLAGS)
Expand Down
2 changes: 2 additions & 0 deletions examples/clients/abe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ go_library(
"examplepb_a_bit_of_everything_repeated.go",
"examplepb_body.go",
"examplepb_numeric_enum.go",
"examplepb_update_v2_request.go",
"message_path_enum_nested_path_enum.go",
"nested_deep_enum.go",
"pathenum_path_enum.go",
"protobuf_empty.go",
"protobuf_field_mask.go",
"sub_string_message.go",
],
importpath = "github.com/grpc-ecosystem/grpc-gateway/examples/clients/abe",
Expand Down
Loading