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

cherry-pick #1411 from master #1420

Closed
wants to merge 106 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
60e9004
Create v2 branch and module
johanbrandhorst Apr 18, 2020
d082534
CI: fix the gorelease base for v2
johanbrandhorst Apr 18, 2020
8149a92
Update README badge links
johanbrandhorst Apr 18, 2020
e52d05c
docs: change godoc.org links to pkg.go.dev
AyushG3112 Apr 19, 2020
ca41473
docs: fix some broken links
AyushG3112 Apr 19, 2020
11da20e
docs: fix wire guide link
AyushG3112 Apr 19, 2020
dcd40f0
Add Season of Docs project ideas page
johanbrandhorst Apr 18, 2020
a1cc462
Fix query params for in-process requests (#1227)
hb-chen Apr 21, 2020
a13dd49
Fix generating helloworld.proto
johanbrandhorst Apr 21, 2020
6fbf5d0
Upgrade protobuf to 1.4.0
johanbrandhorst Apr 18, 2020
ccace35
Remove deprecated usage of github.com/golang/protobuf/protoc-gen-go/g…
yinzara Apr 22, 2020
f40fb88
Add RPCMethod to runtime (#1234)
AyushG3112 Apr 23, 2020
f60488d
Remove usage of github.com/golang/protobuf/protoc-gen-go/generator (#…
yinzara Apr 23, 2020
e6d0536
Support generating a standalone gateway package (#1239)
ssetin Apr 25, 2020
5ece275
#1098: remove error field from error messages (#1242)
srenatus Apr 28, 2020
6219289
Move to using github docker registry for build environment
johanbrandhorst Apr 28, 2020
ed092be
Combine bazel regeneration commands
johanbrandhorst Apr 28, 2020
f75e6a7
Minimize public API
johanbrandhorst Apr 28, 2020
794b736
Add user testimonials and ADOPTERS.md
johanbrandhorst Apr 29, 2020
71a236d
Add Chef to ADOPTERS.md
johanbrandhorst Apr 30, 2020
269c812
Add Scaleway to ADOPTERS.md
johanbrandhorst Apr 30, 2020
79d5250
Use public key to authenticate for docker registry
johanbrandhorst Apr 29, 2020
bacf8a9
Remove uses of protoc-gen-go/generator
johanbrandhorst Apr 30, 2020
53da419
runtime: replace StreamError with status.Status
johanbrandhorst Apr 30, 2020
e86fbdb
protoc-gen-swagger: fix infinite loop on circular references in query…
Romeren May 4, 2020
246b6f8
Add more instructions on the GitHub releases UI
achew22 May 8, 2020
5694672
Update dependency io_bazel_rules_go to v0.22.4
renovate-bot May 9, 2020
80addb2
Update golang Docker tag to v1.14.2
renovate-bot May 9, 2020
dd7ce3e
Support streaming HttpBody
adasari May 9, 2020
fcfdaa0
Update google.golang.org/genproto commit hash to 43844f6
renovate-bot May 9, 2020
141e1d8
Update module golang/protobuf to v1.4.1
renovate-bot May 9, 2020
736daf8
Update dependency bazel_gazelle to v0.20.0
renovate-bot May 9, 2020
72ab468
Update golang.org/x/oauth2 commit hash to bf48bf1
renovate-bot May 9, 2020
562dd79
Update dependency com_github_bazelbuild_buildtools to v0.29.0
renovate-bot May 9, 2020
d2a144d
Update module google.golang.org/grpc to v1.29.1
renovate-bot May 9, 2020
9834258
Update dependency com_github_bazelbuild_buildtools to v3
renovate-bot May 9, 2020
6f6f7bb
Update module antihax/optional to v1
renovate-bot May 9, 2020
8ce6067
Add bazel CI caching
johanbrandhorst May 9, 2020
2a15025
Further tweak bazel resource limits
johanbrandhorst May 9, 2020
029cfe8
Consolidate error handling configuration
johanbrandhorst May 9, 2020
fe53821
Improved docs/_docs/season_of_docs.md (v2) (#1319)
iamrajiv May 12, 2020
3e4dfad
fixed typo in docs/_docs/usage.md in v2 branch (#1320)
iamrajiv May 12, 2020
f189ce7
Renovate: run go mod tidy after updates
johanbrandhorst May 13, 2020
9f52fd1
Update google.golang.org/genproto commit hash to 09dca8e
renovate-bot May 13, 2020
448189f
Update dependency io_bazel_rules_go to v0.23.0
renovate-bot May 13, 2020
77f9ac8
Update dependency bazel_gazelle to v0.21.0
renovate-bot May 14, 2020
43ced79
runtime: rewrite query.go in new protoreflect
johanbrandhorst May 5, 2020
699882b
runtime: rewrite fieldmask logic with protoreflect
johanbrandhorst May 8, 2020
1b447b4
all: correct use of go_package
johanbrandhorst May 14, 2020
17cd83c
Update google.golang.org/genproto commit hash to 8feb7f2
renovate-bot May 14, 2020
8ab3a0a
Update module golang/protobuf to v1.4.2
renovate-bot May 14, 2020
fbd8e33
docs: add example customizing unmarshal options (#1335)
srenatus May 15, 2020
3710874
Renovate changes from master
johanbrandhorst May 15, 2020
97ad693
Update google.golang.org/genproto commit hash to fc4c6c6
renovate-bot May 15, 2020
d38a8e1
internal/descriptor: move to generated apiconfig test
johanbrandhorst May 15, 2020
0392ecd
remove unused PKGMAP
johanbrandhorst May 15, 2020
a428784
Update dependency io_bazel_rules_go to v0.23.1
renovate-bot May 15, 2020
6af515c
Update module google/go-cmp to v0.4.1
renovate-bot May 15, 2020
8f3a028
Run bazel repositories check in CI
johanbrandhorst May 16, 2020
f997e3d
Update golang Docker tag to v1.14.3
renovate-bot May 15, 2020
e7d8d2e
build-env: update protoc version to 3.12.0
johanbrandhorst May 17, 2020
6cd4e05
all: regenerate files with new build-env
johanbrandhorst May 17, 2020
c07ffed
Improve README.md (#1363)
amanjain97 May 18, 2020
899f1f0
all: replace all uses of golang/protobuf/proto
johanbrandhorst May 17, 2020
0080920
Update google.golang.org/genproto commit hash to 08726f3
renovate-bot May 19, 2020
6f53904
PR and Issue template added to v2 branch (#1371)
iamrajiv May 21, 2020
b564678
Update google.golang.org/genproto commit hash to e9a78aa
renovate-bot May 21, 2020
7404ead
Improve prose in customizingyourgateway.md (#1374)
iamrajiv May 22, 2020
ed290d0
examples/internal/server: rewrite fieldmask_helper
johanbrandhorst May 22, 2020
3ed822c
Change default marshaller to use JSON names
johanbrandhorst May 22, 2020
49942f1
runtime: make default marshaler emit default values
johanbrandhorst May 22, 2020
96e4573
Add missing documentation for openapiv2 proto definition (#1375)
bvwells May 23, 2020
560f0a4
Remove usage of deprecated grpc.Errorf API (#1380) (#1382)
bvwells May 23, 2020
e090d4a
Fix various misspellings (#1381)
bvwells May 23, 2020
32c7633
Implement last-match-wins behaviour in mux
johanbrandhorst May 23, 2020
885c0bd
runtime: make HTTPBodyMarshaler the default
johanbrandhorst May 23, 2020
ffdd31c
runtime: remove DisallowUnknownFields()
johanbrandhorst May 23, 2020
1189f2c
Update docs for v2 (#1388)
johanbrandhorst May 24, 2020
cca518b
examples/internal: remove old generated files
johanbrandhorst May 24, 2020
57089bc
protoc-gen-swagger: update bazel rule
johanbrandhorst May 24, 2020
2ee1c8c
all: rename protoc-gen-swagger to protoc-gen-openapiv2
johanbrandhorst May 24, 2020
cc95ab4
Generate changelog for v2.0.0-beta1
johanbrandhorst May 25, 2020
877d598
utilities: move package to public API
johanbrandhorst May 25, 2020
8b74b72
Generate changelog for v2.0.0-beta.2
johanbrandhorst May 25, 2020
a6585f3
Adding docs about controlling http response status codes (#1397)
zhughes3 May 26, 2020
11764d5
Add warning note to RegisterXXXHandlerServer (#1401)
joesonw May 26, 2020
d7c70c4
Update google.golang.org/genproto commit hash to 9bb8953
renovate-bot May 26, 2020
cd6dd6a
docs: use default marshaler in examples
johanbrandhorst May 26, 2020
2d2cb57
ci: automate regeneration of repositories.bzl
johanbrandhorst May 27, 2020
5bbd365
ci: be explicit about branch and user
johanbrandhorst May 27, 2020
13f2ba7
Add module generator option (#1409)
Humpheh May 27, 2020
b45a01e
ci: split some jobs into commands
johanbrandhorst May 27, 2020
6f0a895
ci: add build-env executor
johanbrandhorst May 27, 2020
cc78ac9
ci: add job to regenerate and commit changes
johanbrandhorst May 27, 2020
7f45854
ci: only run renovate jobs on v2 branches
johanbrandhorst May 27, 2020
41e8d5b
ci: replace golint with staticcheck
johanbrandhorst May 27, 2020
fbb9fb3
renovate: enable autoMerge
johanbrandhorst May 27, 2020
7d209d4
all: fix go vet errors
johanbrandhorst May 27, 2020
181e3ea
chore(deps): update module google.golang.org/protobuf to v1.24.0
renovate-bot May 27, 2020
2c8cb1f
chore(deps): update google.golang.org/genproto commit hash to 430c106
renovate-bot May 27, 2020
5f5c2cf
chore(deps): update google.golang.org/genproto commit hash to 8367513
renovate-bot May 27, 2020
3bbfd96
ci: enable glog
johanbrandhorst May 27, 2020
b5bbb81
chore(deps): update google.golang.org/genproto commit hash to 3d3490e
renovate-bot May 28, 2020
0ffa047
Create feature.md
iamrajiv May 28, 2020
3bcfe84
Create bug.md
iamrajiv May 28, 2020
aef5acf
Create documentation.md
iamrajiv May 28, 2020
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
4 changes: 2 additions & 2 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14.0
FROM golang:1.14.3

# Warm apt cache and install dependencies
# bzip2 is required by the node_tests (to extract its dependencies).
Expand All @@ -17,7 +17,7 @@ RUN echo -e '#!/bin/bash\njava -jar /usr/local/bin/swagger-codegen-cli.jar "$@"'
chmod +x /usr/local/bin/swagger-codegen

# Install protoc
ENV PROTOC_VERSION=3.10.1
ENV PROTOC_VERSION=3.12.0
RUN wget https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip \
-O /protoc-${PROTOC_VERSION}-linux-x86_64.zip && \
unzip /protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/ && \
Expand Down
18 changes: 2 additions & 16 deletions .circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@

Contained within is the CI test setup for the Gateway. It runs on Circle CI.

### I want to regenerate the files after making changes!

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:1.14 \
/bin/bash -c 'cd /go/src/github.com/grpc-ecosystem/grpc-gateway && \
make realclean && \
make examples'
```

If this has resulted in some file changes in the repo, please ensure you check those in with your merge request.

### Whats up with the Dockerfile?

The `Dockerfile` in this folder is used as the build environment when regenerating the files (see above).
The canonical repository for this Dockerfile is `jfbrandhorst/grpc-gateway-build-env`. Please request access
before attempting to make any changes to the Dockerfile.
The `Dockerfile` in this folder is used as the build environment when regenerating the files (see CONTRIBUTING.md).
The canonical repository for this Dockerfile is `docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env`.
173 changes: 134 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,67 @@
version: 2
version: 2.1

commands:
configure_bazel:
description: Create Bazel config file (.bazelrc)
steps:
- run: |
cat > .bazelrc \<< EOF
startup --output_base /root/.cache/_grpc_gateway_bazel
build --test_output errors
build --features race
# Workaround https://github.com/bazelbuild/bazel/issues/3645
# See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
build --local_ram_resources=4096 # Circle Docker runners have 4G of memory
build --local_cpu_resources=2 # Circle Docker runners have 2 vCPU
EOF
generate:
steps:
- run: make realclean
- run: make examples
- run: make testproto
- run: go mod tidy
renovate_git_amend_push:
description: Git amend and push changes
steps:
- run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git config user.name "Renovate Bot"
git config user.email "bot@renovateapp.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/grpc-ecosystem/grpc-gateway.git
git commit --amend --no-edit
git push --force-with-lease origin ${CIRCLE_BRANCH}
fi

executors:
build-env:
environment:
## Split key to avoid github revoking it
password0: '99544cdcb19ad4e3fd64'
password1: '3ec86b2e5a431be2d72c'
GLOG_logtostderr: '1'
docker:
- image: docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env:1.14
auth:
username: gateway-ci-user
password: ${password0}${password1}

jobs:
build:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
executor: build-env
working_directory: /src/grpc-gateway
steps:
- checkout
- run: go build ./...
test:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
executor: build-env
working_directory: /src/grpc-gateway
environment:
GLOG_logtostderr: '1'
steps:
- checkout
- run: go test -race -coverprofile=coverage.txt ./...
- run: bash <(curl -s https://codecov.io/bash)
node_test:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
executor: build-env
working_directory: /src/grpc-gateway
steps:
- checkout
Expand All @@ -31,23 +73,34 @@ jobs:
npm install &&
./node_modules/.bin/gulp
generate:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
executor: build-env
working_directory: /src/grpc-gateway
steps:
- checkout
- run: make realclean
- run: make examples
- run: go mod tidy
- generate
- run: git diff --exit-code
lint:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
- image: golang:1.14
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 @@ -62,32 +115,35 @@ jobs:
working_directory: /src/grpc-gateway
steps:
- checkout
- restore_cache:
keys:
- v2-bazel-cache-{{ checksum "repositories.bzl" }}
- v2-bazel-cache-
- configure_bazel
- run:
name: Create Bazel config file (.bazelrc)
name: Check that Bazel BUILD files are up-to-date
command: |
cat > .bazelrc << EOF
startup --output_base $HOME/.cache/_grpc_gateway_bazel
build --test_output errors
build --features race
# Workaround https://github.com/bazelbuild/bazel/issues/3645
# See https://docs.bazel.build/versions/0.23.0/command-line-reference.html
build --local_ram_resources=HOST_RAM*.5
EOF
bazel run //:gazelle &&
git diff --exit-code
- 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)'
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 &&
git diff --exit-code
- 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
- save_cache:
key: v2-bazel-cache-{{ checksum "repositories.bzl" }}
paths:
- /root/.cache/_grpc_gateway_bazel
gorelease:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
executor: build-env
working_directory: /src/grpc-gateway
steps:
- checkout
Expand All @@ -97,15 +153,37 @@ 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-alpha.2
release:
docker:
- image: jfbrandhorst/grpc-gateway-build-env:1.14
executor: build-env
working_directory: /src/grpc-gateway
steps:
- checkout
- run: go mod vendor
- run: curl -sL https://git.io/goreleaser | bash
update-repositoriesbzl:
docker:
- image: l.gcr.io/google/bazel:latest
working_directory: /src/grpc-gateway
steps:
- checkout
- restore_cache:
keys:
- v2-bazel-cache-{{ checksum "repositories.bzl" }}
- v2-bazel-cache-
- configure_bazel
- run:
name: Update repositories.bzl
command: |
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories
- renovate_git_amend_push
regenerate:
executor: build-env
working_directory: /src/grpc-gateway
steps:
- checkout
- generate
- renovate_git_amend_push
workflows:
version: 2
all:
Expand All @@ -124,3 +202,20 @@ workflows:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*(-.*)*/
- update-repositoriesbzl:
filters:
branches:
only: /renovate\/v2-.+/
tags:
ignore: /.*/
- regenerate:
requires:
# Run after update-repositoriesbzl to avoid
# git conflicts
- update-repositoriesbzl
filters:
branches:
only: /renovate\/v2-.+/
tags:
ignore: /.*/

4 changes: 2 additions & 2 deletions ISSUE_TEMPLATE.md → .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
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: 🐛 Bug Report
about: Submit a bug report to help us improve
---

## 🐛 Bug Report

(A clear and concise description of what the bug is.)

## To Reproduce

(Write your steps here:)

1. Step 1...
1. Step 2...
1. Step 3...

## Expected behavior

(Write what you thought would happen.)

## Actual Behavior

(Write what happened. Add screenshots, if applicable.)

## Your Environment

(Environment name, version and operating system.)
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: 📚 Documentation
about: Report an issue related to documentation
---

## 📚 Documentation

(A clear and concise description of what the issue is.)
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: 🚀 Feature
about: Submit a proposal/request for a new feature
---

## 🚀 Feature

(A clear and concise description of what the feature is.)
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to grpc-gateway here: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CONTRIBUTING.md

Happy contributing!

-->

#### References to other Issues or PRs

<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

#### Have you read the [Contributing Guidelines](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CONTRIBUTING.md)?

#### Brief description of what is fixed or changed

#### Other comments
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ bazel-genfiles
bazel-grpc-gateway
bazel-out
bazel-testlogs
.bazelrc

# Go vendor directory
vendor
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
Loading