Skip to content

Commit

Permalink
chore: update contributing documentation
Browse files Browse the repository at this point in the history
Update the contributing guide with information related to using
tox.

Signed-off-by: Billy Olsen <[email protected]>
  • Loading branch information
wolsen committed Feb 29, 2024
1 parent ee877c5 commit 726495e
Showing 1 changed file with 54 additions and 21 deletions.
75 changes: 54 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,67 @@
# lldpd
# Contributing to the lldpd charm

## Overview

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

- Generally, before developing enhancements to this charm you should consider [opening an issue](
https://github.com/canonical/charm-lldp/issues) explaining your bug or use case.
- Familiarising yourself with the [Charmed Operator Framework](https://juju.is/docs/sdk)
library will help you when working on new features or bug fixes.
- All enhancements and code changes require review before being merged. Code review typically
examines:
- code quality
- test coverage
- user experience for administrators deploying and operating this charm
- Please help us out by ensuring easy to review branches by rebasing your pull request branch
onto the `main` branch. This also avoids merge commits and creates a linear Git commit
history. Please do *not* merge the main branch into your PR.

## Developing

Create and activate a virtualenv with the development requirements:
Install `tox`, `charmcraft` and `juju`.

virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements-dev.txt
```bash
sudo apt-get install tox
sudo snap install charmcraft --classic
sudo snap install juju
```

## Code overview
## Testing

TEMPLATE-TODO:
One of the most important things a consumer of your charm (or library)
needs to know is what set of functionality it provides. Which categories
does it fit into? Which events do you listen to? Which libraries do you
consume? Which ones do you export and how are they used?
To test the charm, there are several tox targets which can be used

## Intended use case
```commandline
tox run -e format # update your code according to linting rules
tox run -e lint # code style tests
tox run -e static-charm # runs static analysis on the charm
tox run -e unit # unit tests
tox # runs lint, static analysis and unit tests
```

TEMPLATE-TODO:
Why were these decisions made? What's the scope of your charm?
## Building

## Roadmap
Build the charm in the local repository using the `charmcraft` tool.

If this Charm doesn't fulfill all of the initial functionality you were
hoping for or planning on, please add a Roadmap or TODO here
```commandline
charmcraft pack
```

## Testing
## Deploy

```commandline
# Create a model
juju add-model test
# Enable debug logging (optional)
juju model-config logging-config="<root>=INFO;unit=DEBUG"
The Python operator framework includes a very nice harness for testing
operator behaviour without full deployment. Just `run_tests`:
# Deploy the charm
juju deploy --base [email protected] ./lldpd_ubuntu-22.04-amd64.charm
```

./run_tests
## Canonical Contributor Agreement
Canonical welcomes contributions to the lldpd charm. Please check out our [contributor
agreement](https://ubuntu.com/legal/contributors) if you are interested in contributing to this
code base.

0 comments on commit 726495e

Please sign in to comment.