Skip to content

Latest commit

 

History

History
168 lines (120 loc) · 6.78 KB

File metadata and controls

168 lines (120 loc) · 6.78 KB

Contributing

This document explains the processes and practices recommended for contributing enhancements to the Aproxy Subordinate charm.

Overview

  • 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 Matrix public channel or Discourse.
  • Familiarizing yourself with the Juju documentation 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 operators of this charm.
  • Once your pull request is approved, we squash and merge your pull request branch onto the main branch. This creates a linear Git commit history.
  • For further information on contributing, please refer to our Contributing Guide.

Code of conduct

When contributing, you must abide by the Ubuntu Code of Conduct.

Changelog

Please ensure that any new feature, fix, or significant change is documented by adding an entry to the CHANGELOG.md file. Use the date of the contribution as the header for new entries.

To learn more about changelog best practices, visit Keep a Changelog.

Submissions

If you want to address an issue or a bug in this project, notify in advance the people involved to avoid confusion; also, reference the issue or bug number when you submit the changes.

  • Fork our GitHub repository and add the changes to your fork, properly structuring your commits, providing detailed commit messages and signing your commits.
  • Make sure the updated project builds and runs without warnings or errors; this includes linting, documentation, code and tests.
  • Submit the changes as a pull request (PR).

Your changes will be reviewed in due time; if approved, they will be eventually merged.

AI

You are free to use any tools you want while preparing your contribution, including AI, provided that you do so lawfully and ethically.

Avoid using AI to complete issues tagged with the "good first issues" label. The purpose of these issues is to provide newcomers with opportunities to contribute to our projects and gain coding skills. Using AI to complete these tasks undermines their purpose.

We have created instructions and tools that you can provide AI while preparing your contribution: copilot-collections

While it isn't necessary to use copilot-collections while preparing your contribution, these files contain details about our quality standards and practices that will help the AI avoid common pitfalls when interacting with our projects. By using these tools, you can avoid longer review times and nitpicks.

If you choose to use AI, please disclose this information to us by indicating AI usage in the PR description (for instance, marking the checklist item about AI usage). You don't need to go into explicit details about how and where you used AI.

Avoid submitting contributions that you don't fully understand. You are responsible for the entire contribution, including the AI-assisted portions. You must be willing to engage in discussion and respond to any questions, comments, or suggestions we may have.

Signing commits

To improve contribution tracking, we use the Canonical contributor license agreement (CLA) as a legal sign-off, and we require all commits to have verified signatures.

Canonical contributor agreement

Canonical welcomes contributions to the Aproxy Subordinate charm. Please check out our contributor agreement if you're interested in contributing to the solution.

The CLA sign-off is simple line at the end of the commit message certifying that you wrote it or have the right to commit it as an open-source contribution.

Verified signatures on commits

All commits in a pull request must have cryptographic (verified) signatures. To add signatures on your commits, follow the GitHub documentation.

Develop

To make contributions to this charm, you'll need a working development setup.

The code for this charm can be downloaded as follows:

git clone https://github.com/canonical/aproxy-operator

Make sure to install uv. For example, you can install uv on Ubuntu using:

sudo snap install astral-uv --classic

For other systems, follow the uv installation guide.

Then install tox with its extensions, and install a range of Python versions:

uv python install
uv tool install tox --with tox-uv
uv tool update-shell

To create a development environment, run:

uv sync --all-groups
source .venv/bin/activate

Test

This project uses tox for managing test environments. There are some pre-configured environments that can be used for linting and formatting code when you're preparing contributions to the charm:

  • tox: Executes all of the basic checks and tests (lint, unit, static, and coverage-report).
  • tox -e fmt: Runs formatting using ruff.
  • tox -e lint: Runs a range of static code analysis to check the code.
  • tox -e static: Runs other checks such as bandit for security issues.
  • tox -e unit: Runs the unit tests.
  • tox -e integration: Runs the integration tests.

Build the charm

Build the charm in this git repository using:

charmcraft pack

Deploy

# Create a model
juju add-model charm-dev
# Enable DEBUG logging
juju model-config logging-config="<root>=INFO;unit=DEBUG"
# Deploy the charm with a required config
juju deploy ./aproxy.charm --config proxy-address=<target.proxy>
# Integrate with a principal charm
juju integrate aproxy <principal-charm>