tree: 7309c1eb19b6ed35a425649e2dfde0a9f130871e [path history] [tgz]
  1. execv/
  2. testdata/
  3. _internal_version.go.txt
  4. _README.md.txt
  5. _version.go.txt
  6. Dockerfile
  7. go.mod
  8. go.sum
  9. main.go
  10. main_test.go
  11. modconfig.go
  12. README.md
internal/postprocessor/README.md

postprocessor

Running OwlBot locally

Follow instructions in OwlBot Usage Guide - “How will I test my .github/.OwlBot.yaml file” using the instructions for split repositories. Note, if you replace step 2 with a clone of your own fork of the googleapis/googleapis-gen.git repo, you can see how changes in your forked googleapis-gen repo are eventually propagated through to the library without making changes to the protos. Lack of permissions may also force you to clone a fork instead of the repo.

After following these steps the generated code will have replaced corresponding files in the google-cloud-go repo.

Docker container

The Docker container needs to be built with the context of the entire google-cloud-go/internal directory. When building the container, do so from the google-cloud-go/internal directory

Running the post-processor locally

The Docker container name needed will be found in the .github/OwlBot.yaml and github/OwlBot.lock.yaml files. To run post-processor run:

docker pull <container-name>
docker run --user $(id -u):$(id -g) --rm -v $(pwd):/repo -w /repo <container-name>

Testing the post-processor locally

You can run the post-processor locally on selected directories or on all of the clients in the root directory.

Run post-processor on all clients

From the google-cloud-go/internal/postprocessor directory run:

go run main.go -client-root="../.." -googleapis-dir="/path/to/local/googleapis"

Run post-processor on select clients

From the google-cloud-go/internal/postprocessor directory run the same command, but with an added dirs flag containing a comma-separated list of the names of the clients on which to run the post-processor. The example below shows the command for running the post-processor on the accessapproval and asset libraries:

go run main.go -client-root="../.." -googleapis-dir="/path/to/local/googleapis" -dirs="accessapproval,asset"

Initializing new modules

To initialize the internal/version.go, go.mod, README.md, and CHANGES.md files in a new module, add the module to the slice in modconfig.go. The entry should correspond to the location where the go.mod file should be initialized minus the prefix “google-cloud-go/”