From 4210bd813f3ceee68d4c57f5b4b03d4a85a0f9be Mon Sep 17 00:00:00 2001 From: MiaAltieri Date: Wed, 31 Jul 2024 08:53:38 +0000 Subject: [PATCH 01/10] add more suggestions from Carl --- .github/workflows/ci.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 552006a4..0c04706f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,15 +50,11 @@ jobs: uses: codecov/codecov-action@v3 build: - name: Build charm | ${{ matrix.path }} + name: Build charm uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v16.7.0 - strategy: - matrix: - path: - - . with: cache: true - path-to-charm-directory: ${{ matrix.path }} + integration-test: name: Integration test charm | 3.4.4 needs: From 7f6dbd0180c28c6383842653a5c312c5e4c06277 Mon Sep 17 00:00:00 2001 From: MiaAltieri Date: Wed, 31 Jul 2024 09:12:08 +0000 Subject: [PATCH 02/10] add Carls feedback --- .github/workflows/ci.yaml | 8 ++-- .github/workflows/release.yaml | 4 +- CONTRIBUTING.md | 69 ++++++++++++++++++++++++----- charmcraft.yaml | 31 ++++++++----- renovate.json | 80 ---------------------------------- tox.ini | 8 ++-- 6 files changed, 86 insertions(+), 114 deletions(-) delete mode 100644 renovate.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c04706f..aaa10f56 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -56,16 +56,16 @@ jobs: cache: true integration-test: - name: Integration test charm | 3.4.4 + name: Integration test charm needs: - lint - unit-test - build uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v16.7.0 with: - artifact-prefix: packed-charm-cache-true + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} cloud: microk8s - microk8s-snap-channel: 1.29-strict/stable - juju-agent-version: 3.4.4 + microk8s-snap-channel: 1.29-strict/stable # renovate: latest microk8s + juju-agent-version: 3.4.4 # renovate: juju-agent-pin-minor permissions: contents: write # Needed for Allure Report beta diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a0eff4d9..d2e141d6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,11 +10,11 @@ jobs: uses: ./.github/workflows/ci.yaml secrets: inherit permissions: - contents: write # Needed for Allure Report beta + contents: write # Needed for Allure Report beta build: name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm_without_cache.yaml@v16.7.0 + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v16.3.0 release-charm: name: Release charm diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20e88bcc..fc01c95f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,34 +1,79 @@ # Contributing -To make contributions to this charm, you'll need a working [development setup](https://juju.is/docs/sdk/dev-setup). +## Overview -You can create an environment for development with `tox`: +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 + ](https://github.com/canonical/mongos-k8s-operator/issues) 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](https://chat.charmhub.io/charmhub/channels/charm-dev) or + [Discourse](https://discourse.charmhub.io/). +- Familiarising yourself with the [Charmed Operator + Framework](https://juju.is/docs/sdk) 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 rebasing your pull + request branch onto the `main` branch. This also avoids merge commits and + creates a linear Git commit history. + +## Developing +Install `tox`, `poetry`, and `charmcraftcache` + +Install pipx: https://pipx.pypa.io/stable/installation/ ```shell -tox devenv -e integration -source venv/bin/activate +pipx install tox +pipx install poetry +pipx install charmcraftcache ``` -## Testing +You can create an environment for development: + +```shell +poetry install +``` -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: +### Testing ```shell tox run -e format # update your code according to linting rules tox run -e lint # code style -tox run -e static # static type checking tox run -e unit # unit tests tox run -e integration # integration tests -tox # runs 'format', 'lint', 'static', and 'unit' environments +tox # runs 'lint' and 'unit' environments ``` -## Build the charm +## Build charm Build the charm in this git repository using: ```shell -charmcraft pack +tox run -e build-dev ``` -