We would love to accept your patches and contributions to this project.
Contributions to this project must be accompanied by a Contributor License Agreement (CLA). 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.
If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again.
Visit https://cla.developers.google.com/ to see your current agreements or to sign a new one.
This project follows Google's Open Source Community Guidelines.
If you find a bug, a mistake in the documentation, or have a feature request, please open an issue. This helps us track problems and improve the project.
If you want to start a conversation, share an idea, or ask a question, feel free to use GitHub Discussions.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose.
This repository enforces Conventional Commits for Pull Request titles.
Your PR title must follow this format: type: description. If your change
is a breaking change (e.g., removing a schema field or file), you must
add ! before the colon: type!: description.
Common Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the coderefactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools and libraries
Examples:
feat: add new payment gatewayfix: resolve crash on checkoutdocs: update setup guidefeat!: remove deprecated buyer field from checkout
We use linters and automated checks to maintain code quality and consistency. These checks run automatically via GitHub Actions when you open a pull request. Your pull request must pass all checks before it can be merged.
You can run many of these checks locally before committing by installing and
using pre-commit:
pip install pre-commit
pre-commit installThis will set up pre-commit hooks to run automatically when you git commit.
- Fork the repository and create your branch from
main. - Make your changes, ensuring you follow the setup instructions below.
- If you've installed
pre-commit, it will run checks as you commit. - Ensure your pull request title follows the Conventional Commits format.
- Fill out the pull request template in GitHub, providing details about your change.
- Push your branch to GitHub and open a pull request.
- Address any automated check failures or reviewer feedback.
- Make relevant updates to JSON files in
source/ - Run
python generate_schemas.pyto generate updated files inspec/ - Check outputs from step above to ensure deltas are expected. You may need to
extend
generate_schemas.pyif you are introducing a new generation concept
To validate JSON and YAML files format and references in spec/, run
python validate_specs.py.
If you change any JSON schemas in spec/, you must regenerate any SDK client
libraries that depend on them. For example, to regenerate Python Pydantic
models run bash sdk/python/generate_models.sh. Our CI system runs
scripts/ci_check_models.sh to verify that models can be generated
successfully from the schemas.
It is also important to go through documentation locally whenever spec files are updated to ensure there are no broken references or stale/missing contents.
- Ensure dependencies are installed:
pip install -r requirements-docs.txt - Run the development server:
mkdocs serve --watch spec - Open http://127.0.0.1:8000 in your browser
- Before submitting a pull request with documentation changes, run
mkdocs build --strictto ensure there are no warnings or errors. Our CI build uses this command and will fail if warnings are present (e.g., broken links).
To avoid polluting your global environment, use a virtual environment. Prefix
the virtual environment name with a . so the versioning control systems don't
track pip install files:
$ sudo apt-get install virtualenv python3-venv
$ virtualenv .ucp # or python3 -m venv .ucp
$ source .ucp/bin/activate
(.ucp) $ pip install -r requirements-docs.txt
(.ucp) $ mkdocs serve --watch spec
(.ucp) $ deactivate # when done