...

Text file src/github.com/grpc-ecosystem/grpc-gateway/v2/CONTRIBUTING.md

Documentation: github.com/grpc-ecosystem/grpc-gateway/v2

     1# How to contribute
     2
     3## Code reviews
     4
     5All submissions, including submissions by project members, require review.
     6
     7## I want to regenerate the files after making changes
     8
     9### Using Docker
    10
    11It should be as simple as this (run from the root of the repository):
    12
    13```bash
    14docker run -v $(pwd):/grpc-gateway -w /grpc-gateway --rm ghcr.io/grpc-ecosystem/grpc-gateway/build-env:1.19 \
    15    /bin/bash -c 'make install && \
    16        make clean && \
    17        make generate'
    18docker run -itv $(pwd):/grpc-gateway -w /grpc-gateway --entrypoint /bin/bash --rm \
    19    ghcr.io/grpc-ecosystem/grpc-gateway/build-env:1.19 -c '\
    20        bazel run :gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories && \
    21        bazel run :gazelle && \
    22        bazel run :buildifier'
    23```
    24
    25You may need to authenticate with GitHub to pull `docker.pkg.github.com/grpc-ecosystem/grpc-gateway/build-env`.
    26You can do this by following the steps on the [GitHub Package docs](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry).
    27
    28### Using Visual Studio Code dev containers
    29
    30This repo contains a `devcontainer.json` configuration that sets up the build environment in a container using
    31[VS Code dev containers](https://code.visualstudio.com/docs/remote/containers). If you're using the dev container,
    32you can run the commands directly in your terminal:
    33
    34```sh
    35$ make install && make clean && make generate
    36```
    37
    38```sh
    39$ bazel run :gazelle -- update-repos -from_file=go.mod -to_macro=repositories.bzl%go_repositories && \
    40    bazel run :gazelle && \
    41    bazel run :buildifier
    42```
    43
    44Note that the above-listed docker commands will not work in the dev container, since volume mounts from
    45nested docker container is not possible.
    46
    47If this has resulted in some file changes in the repo, please ensure you check those in with your merge request.
    48
    49## Making a release
    50
    51To make a release, follow these steps:
    52
    531. Decide on a release version. The `gorelease` job can
    54   recommend whether the new release should be a patch or minor release.
    551. Tag the release on `main`.
    56   1. The release can be created using the command line, or also through GitHub's [releases
    57      UI](https://github.com/grpc-ecosystem/grpc-gateway/releases/new).
    58   1. If you create a release using the web UI you can publish it as a draft and have it
    59      reviewed by another maintainer.
    60   1. Update the release description. Try to include some of the highlights of this release,
    61      ideally with links to the PRs and crediting the contributors.
    621. Update the gorelease job in .github/ci.yaml to point to the new release version.
    631. Sit back and pat yourself on the back for a job well done :clap:.

View as plain text