Skip to content

Latest commit

 

History

History
131 lines (91 loc) · 5 KB

CONTRIBUTING.md

File metadata and controls

131 lines (91 loc) · 5 KB

Contributing to kpt-functions-catalog

We'd love to accept your contributions to this project. There are just a few small guidelines you need to follow.

Contributor License Agreement

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.

Code reviews

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.

Community Guidelines

This project follows Google's Open Source Community Guidelines and a Code of Conduct.

Style Guides

Contributions are required to follow these style guides:

How to Contribute

Repo Layout

├── examples: Home for all function examples
│     ├── contrib: Home for all contrib function examples
│     ├── curated_function_bar_example
│     └── curated_function_foo_example
├── functions
│     ├── contrib: Home for all contrib function source code
│     │     └── ts: Home for all typescript-based contrib function source code
│     │         ├── Makefile
│     │         └── contrib_ts_function_foo
│     ├── go: Home for all golang-based curated function source code
│     │     ├── Makefile
│     │     ├── curated_go_function_bar
│     │     └── curated_go_function_foo
│     └── ts: Home for all typescript-based curated function source code
│         ├── Makefile
│         ├── curated_ts_function_bar
│         └── curated_ts_function_foo
├── scripts
└── tests: Home for e2e tests

For each function, its files spread in the follow places:

  • functions/ directory: Each function must have its own directory in one of functions/ sub-directory. In each function's directory, it must have the following:
    • Source code (and unit tests).
    • A README.md file serving as the usage doc and will be shown in the catalog website.
    • A metadata.yaml file that follows the function metadata schema.
    • A Dockerfile to build the docker container.
  • examples/ directory: It contains examples for functions, and these examples are also being tested as e2e tests. Each function should have at least one example here. There must be a README.md file in each example directory, and it should follow the template.
  • The tests/ directory contains additional e2e tests.

E2E Tests

The e2e tests are the recommended way to test functions in the catalog. They are very easy to write and set up with our e2e test harness.

You can choose to put the e2e test in either the examples/ directory or in the tests/ directory depending on if it is worthwhile to be shown as an example.

Change Existing Functions

You must follow the layout convention when you make changes to existing functions.

If you implement a new feature, you must add a new example or modify existing one to cover it.

If you fix a bug, you must add (unit or e2e) tests to cover that.

Contribute New Functions

You must follow the layout convention when you contribute new functions.

Contact Us

Do you need a review or release of functions? We’d love to hear from you!