Skip to content

CONTRIBUTING

Contributing to Hera

Thank you for considering a contribution to Hera! Your time is the ultimate currency, and the community highly appreciates your willingness to dedicate some time to Hera for the benefit of everyone!

Please keep in mind the following guidelines and practices when contributing to Hera:

  1. Your commit must be signed. Hera uses an application that enforces the Developer Certificate of Origin (DCO). Currently, a Contributor License Agreement (CLA) check also appears on submitted pull requests. This can be safely ignored and is not a requirement for contributions to hera. This is an artifact as the Argo Project is slowly migrating projects from CLA to DCO.
  2. Use make format to format the repository code. make format maps to a usage of black, and the repository adheres to whatever black uses as its strict pep8 format. No questions asked!
  3. Use make lint test to lint, run tests, and typecheck on the project.
  4. Add unit tests for any new code you write.
  5. Add an example, or extend an existing example, with any new features you may add. Use make examples to ensure that the documentation and examples are in sync.

Adding new Workflow tests

Hera has an automated-test harness that is coupled with our documentation. In order to add new tests, please follow these steps -

Local Hera examples

Tests that do not correspond to any upstream Argo Workflow examples should live in examples/workflows/*.py

In order to add a new workflow test to test Hera functionality, do the following - - Create a new file under examples/workflows, for example - my_test.py - Define your new workflow. Make sure that the target workflow you wish to export and test against is named w - Run tests using make test. Hera tests will generate a golden copy of the output YAML with the name my-test.yaml if it does not exist already - If you would like to update the golden copy of the test files, you can run make regenerate-test-data - The golden copies must be checked in to ensure that regressions may be caught in the future

Upstream Hera examples

Tests that correspond to any upstream Argo Workflow examples should live in examples/workflows/upstream/*.py. These tests exist to ensure that Hera has complete parity with Argo Workflows and also to catch any regressions that might happen.

In order to add a new workflow test to test Hera functionality, do the following - - Create a new file under examples/workflows/upstream that corresponds with the name of the upstream example yaml file. If the yaml file has a hyphen, your python file name should replace those with an underscore. eg. if you are trying to replicate archive-location.yaml your python file should be called archive_location.py - Define your new workflow. Make sure that the target workflow you wish to export and test against is named w - Run tests using make test. Hera tests will generate a golden copy of the output YAML with the name archive-location.yaml and also generate a local copy of the upstream yaml file with the name archive-location.upstream.yaml - If you would like to update the golden copy of the test files, you can run make regenerate-test-data - The golden copies must be checked in to ensure that regressions may be caught in the future

Code of Conduct

Please be mindful of and adhere to the CNCF’s Code of Conduct when contributing to hera.

Comments