This documents explains the processes and practices recommended for contributing enhancements to this operator.
- Generally, before developing enhancements to this charm, you should consider opening an issue explaining your use case.
- If you would like to chat with us about your use-cases or proposed implementation, you can reach us at Canonical Mattermost public channel or Discourse.
- Familiarising yourself with the Charmed Operator Framework library will help you a lot when working on new features or bug fixes.
- All enhancements require review before being merged. Code review typically
examines
- code quality
- test coverage
- user experience for Juju administrators this charm.
- Please help us out in ensuring easy to review branches by re-basing your pull
request branch onto the
main
branch. This also avoids merge commits and creates a linear Git commit history.
You can create an environment for development with tox
:
tox devenv -e integration
source venv/bin/activate
tox run -e format # update your code according to linting rules
tox run -e lint # code style
tox run -e unit # unit tests
tox run -e integration-* # integration tests
tox # runs 'lint' and 'unit' environments
In case your tests are re-using existing test charms with no modifications, feel free to ignore this section.
For test charms that may support multiple Ubuntu versions (typically for libraries that are expected to work across legacy versions) the following mechanism is available.
By default, with no parameters the first Ubuntu version is taken, that's specified in the helper charm's charmcraft.yaml
.
The current default is jammy
with base_index: 0
(i.e. being specified as the first build-on/run-on
environment).
Ordering goes in a way that newest version comes first, older ones decreasingly after.
(This allows for meaningful defaults for helper charms for libs that only support newer/latest Ubuntu series.)
In case any further Ubuntu versions are to be used when executing the tests, the following pytest
parameters are to be added
at execution time
os_series
: The name of the Ubuntu series to be used for build/deploy (default:jammy
)build_bases_index
: The number of item in order (counting from0
) referring to thedb_libs_series
specified in the helper charm'scharmcraft.yaml
NOTE: In case using the mechanism above, make sure that the os_series
fixture's value is passed for the
series
option to your charm when deploying it in the test pipeline execution (typically: the build_and_deploy
test function).
Build the charm in this git repository using:
charmcraft pack
This charm is not meant to be deployed itself, and is used as a mechanism for hosting libraries only.
Canonical welcomes contributions to the Charmed Template Operator. Please check out our contributor agreement if you're interested in contributing to the solution.