- Contributions should follow the "Code Standards" section of this document.
- If adding an endpoint or resource to the API, also follow "Adding an API Resource".
- Follow commit message guidelines.
- Use
git rebase [-i]
to clean up your contribution and resolve pending merge conflicts. - Submit a pull request and ensure that CI passes.
List outdated packages
pip list --local --outdated
Then review and decide what upgrades to make, if any.
Changes to requirements.txt
should always be by pull request.
- Add tests for every change made
- Tests should be realistic and exercise a wide range of possibilities
- Use Google Style Docstrings.
- Add docstrings to all functions with a one-line description of its purpose.
Ensure that ./tests/bin/run-tests-docker.sh -- -l
exits without errors.
- The subject line should be a phrase describing the commit and limited to 50 characters
- The subject line should be as specific as possible, e.g. "Add new API resource for user API keys", rather than "Update authentication".
- Write a description of your API resource and its business functionality.
- Choose a descriptive name for your resource that aligns with existing names.
- Create a URL from the name. If your resource is a collection, the name should be a pluralized noun, e.g., "files".
- All API resources must have input validation
- New API resources should follow the error handling convention and raise webapp2.HTTPException
- Create a new resource file, called
<resource_name>.yaml
, e.g.,files.yaml
. Create this file in theswagger/paths
directory. - In
index.yaml
, add an$include
line for your resource file, e.g.,- paths/files.yaml
. - In your resource file, define your resource. Begin by adding a
description
property with the description you wrote in step 1. - Add example properties for both request and response. Examples should be stored in the
examples/
directory, e.g.,swagger/examples/request/files.json
. - Use JSONSchema.net to generate a JSON schema for both request and response body. Edit the schema as necessary. Before generating your schema, scroll down and uncheck "allow additional properties". Schemas are stored in the
schemas/
directory, e.g.,swagger/schemas/input/files.json
. - Verify that the example properties pass schema validation by running the unit tests. New schemas and examples will be tested automatically. (See testing instructions below)
Follow the procedures outlined in our testing instructions.