We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
This project follows Google's Open Source Community Guidelines.
Most of this library is created via code generation. Changes merged that affect the code generation tooling will not be seen until:
- The nightly job that evaluates changes is run and opens a PR
- The PR is reviewed and merged
The data types offered by this library are generated from protobuf. Changes will not be accepted.
Validation tests are generated based on metadata in the protos that are used to define the event data types. This is a custom generator that can be modified.
Once test generation is modified, the code update made by running the generator will include the test updates.
- Modify the template code: generators/templates/validationtest.gotpl
- Modify the template parameter creation: generators/protoc-gen-go-googlecetypes/generator.go
If you modify the protoc-gen-go-googlecetypes Go code, the generator will not pick
up your changes unless you run go install
from inside the protoc-gen-go-googlecetypes
directory.
Send a PR to the google-cloudevents parent repository to add or update a complete JSON test case in the testdata directory.
Generate the library using protobuf-based tooling.
git clone https://github.com/googleapis/google-cloudevents-go
cd google-cloudevents-go
sh ./tools/setup-generator.sh
export GENERATE_DATA_SOURCE="${PWD}/tmp/google-cloudevents"
export GENERATE_PROTOC_PATH=tmp/protobuf/bin/protoc
sh ./generate-code.sh
The "data source" for code generation is a collection of protos maintained in googleapis/google-cloudevets.
If you have a local copy of this repository, such as for trying modifications to those protos, you can use these instructions to use that copy instead of retrieving a new clone.
cd /path/to/shared/repositories
git clone https://github.com/googleapis/google-cloudevents --depth 1
cd path/to/the/project
git clone https://github.com/googleapis/google-cloudevents-go
# Configure this before running the setup script to reuse the repository.
export GENERATE_DATA_SOURCE=/absolute/path/to/shared/repositories/google-cloudevents
sh ./tools/setup-generator.sh
export GENERATE_PROTOC_PATH=tmp/protobuf/bin/protoc
sh ./generate-code.sh
Running the generate-code.sh
script might result in an error similar to:
/bin/realpath: illegal option -- -
OSX and other environments do not have a version of the realpath
command
that includes support for --relative-to
.
On OSX, this can be fixed by installing coreutils
, such as via this
homebrew formulae.