Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump cryptography from 42.0.8 to 43.0.1 #2

Open
wants to merge 54 commits into
base: 6/edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3f17d90
chore: setup initial repository
Gu1nness Nov 5, 2024
b0fc9a2
chore: Add basic CI
Gu1nness Nov 5, 2024
7e4cc72
chore: bump ruff
Gu1nness Nov 5, 2024
04a6328
chore: Add poetry pre-commits
Gu1nness Nov 5, 2024
6b2daa3
wip: add pre-commit run
Gu1nness Nov 5, 2024
4eeeb74
wip: state
Gu1nness Nov 5, 2024
d2ff9fc
wip: state & utils & config
Gu1nness Nov 6, 2024
f482e33
wip: Substrate workloads + mongo + first tests
Gu1nness Nov 6, 2024
88cb329
fix: Useless pre-commit
Gu1nness Nov 6, 2024
3607d2b
wip: more tests + metadata
Gu1nness Nov 6, 2024
47eafc0
wip: be more accurate + implement more services
Gu1nness Nov 7, 2024
d91aaa7
chore: improve typing
Gu1nness Nov 7, 2024
66d40dc
fix: run pre-commit
Gu1nness Nov 8, 2024
2beacdb
fix: add libs
Gu1nness Nov 8, 2024
95bce97
wip: update workloads + config manager
Gu1nness Nov 8, 2024
ae9e9c5
test: add testing
Gu1nness Nov 8, 2024
2f7ec56
wip: states, scopes, rework workload
Gu1nness Nov 12, 2024
d5fd089
wip: add unit handling (1s round)
Gu1nness Nov 12, 2024
3d9f309
wip: Better view of states, and start adding configurations.
Gu1nness Nov 13, 2024
5fdd3a4
feat: add k8s manager
Gu1nness Nov 13, 2024
0ba7ead
wip: state, core, k8s manager
Gu1nness Nov 13, 2024
4e42969
feat: start integrating S3 as a test
Gu1nness Nov 13, 2024
691ba75
feat: Unified exceptions for workload exec
Gu1nness Nov 13, 2024
3a25fbf
wip: work on backup manager.
Gu1nness Nov 14, 2024
cc5263c
feat: backup manager and events.
Gu1nness Nov 15, 2024
5393e3a
wip: mongo manager + tls manager (started)
Gu1nness Nov 15, 2024
97419f4
wip: TLS manager
Gu1nness Nov 19, 2024
919a93c
feat: Password actions + drop pydantic models for now
Gu1nness Nov 19, 2024
5d20fe9
wip: mongodb operator
Gu1nness Nov 19, 2024
b71b9f3
wip: work on mongodb operator.
Gu1nness Nov 20, 2024
a827938
wip: better interface
Gu1nness Nov 20, 2024
788bf46
wip: go on interfaces + events + mongodb manager
Gu1nness Nov 20, 2024
3f1c03f
feat: charm skeleton + mongodb operator
Gu1nness Nov 21, 2024
2a1749d
fix: rework config
Gu1nness Nov 21, 2024
2b5dd48
fix: allow extra in config
Gu1nness Nov 21, 2024
a665b18
fix: managers are objects.
Gu1nness Nov 21, 2024
810ceb9
fix: commands & backup events
Gu1nness Nov 21, 2024
146ffe8
fix: common path + str to f-string
Gu1nness Nov 21, 2024
be3eb9d
fix: requirer-data
Gu1nness Nov 21, 2024
1164f6f
fix: more bug-fix with real deployment
Gu1nness Nov 21, 2024
5e5ccf7
fix: role accessor
Gu1nness Nov 21, 2024
fa919f5
fix: use relation values.
Gu1nness Nov 22, 2024
b87ac36
fix: multiple fixes + external connectivity for config
Gu1nness Nov 22, 2024
d084af0
fix: more fixes for first charm
Gu1nness Nov 22, 2024
c74d0d7
test: New snap
Gu1nness Nov 22, 2024
97fd01e
fix: typo
Gu1nness Nov 22, 2024
0315198
fix: fixes on params + url
Gu1nness Nov 22, 2024
411a5c5
fix: the other way around for checks.
Gu1nness Nov 22, 2024
06d196e
fix: update backup manager
Gu1nness Nov 22, 2024
d0ab00a
fix: string format
Gu1nness Nov 22, 2024
2ada534
fix: add env
Gu1nness Nov 22, 2024
357d6e3
chore(backup status): protect from wrong interpretation
Gu1nness Nov 22, 2024
df44977
test: Start adding unit tests
Gu1nness Nov 22, 2024
e9afcca
chore(deps-dev): bump cryptography from 42.0.8 to 43.0.1
dependabot[bot] Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
juju
charm
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: File a bug report
labels: bug

---

<!-- Thank you for submitting a bug report! All fields are required unless marked optional. -->

## Steps to reproduce
<!-- Please enable debug logging by running `juju model-config logging-config="<root>=INFO;unit=DEBUG"` (if possible) -->
1.

## Expected behavior


## Actual behavior
<!-- If applicable, add screenshots -->


## Versions

<!-- Run `lsb_release -sd` -->
Operating system:

<!-- Run `juju version` -->
Juju CLI:

<!-- Model version from `juju status` -->
Juju agent:

<!-- App revision from `juju status` or (advanced) commit hash -->
Charm revision:

<!-- Run `lxd version` -->
LXD:

## Log output
<!-- Please enable debug logging by running `juju model-config logging-config="<root>=INFO;unit=DEBUG"` (if possible) -->
<!-- Then, run `juju debug-log --replay > log.txt` and upload "log.txt" file here -->
Juju debug log:

<!-- (Optional) Copy the logs that are relevant to the bug & paste inside triple backticks below -->


## Additional context
<!-- (Optional) Add any additional information here -->
38 changes: 38 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!-- Provide a general summary of your changes in the Title above -->
<!-- markdownlint-disable MD041 -->

## 🏷 Type of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation Update
- [ ] Tooling and CI changes
- [ ] Dependencies upgrade or change

## 📝 Description
<!--
Describe your changes in detail including:
- the purpose and scope of this PR (what)
- the impacted components (where, often match conventional commit scope)
- explanation/algorithm if require (how)
-->

## 📑 Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- Either the associated JIRA reference or a paragraph. -->

## 🧪 How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## ✅ Checklist
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the [**CONTRIBUTING**](../blob/main/CONTRIBUTING.md) document.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Run tests

on:
pull_request:
push:
branches:
- main
- feat/**
schedule:
- cron: "53 0 * * *" # Daily at 00:53 UTC
workflow_dispatch:

jobs:
pre-commit:
name: Run pre-commits
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tox & poetry
run: |
pipx install tox
pipx install poetry
- name: Set up python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'poetry'
- name: Install pre-commit
run: |
poetry install
poetry run pre-commit install
- name: Run pre-commit hooks
run: |
poetry run pre-commit run --all-files

lint:
name: Lint
uses: canonical/data-platform-workflows/.github/workflows/[email protected]

unit-test:
name: Unit test charm
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tox & poetry
run: |
pipx install tox
pipx install poetry
- name: Set up python environment
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: 'poetry'
- name: Run tests
run: tox run -e unit
61 changes: 61 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Test & Publish to PyPI

on:
workflow_dispatch:

jobs:
build:
name: Build package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Build package
run: poetry build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

unit-test:
name: Test package
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry and tox
run: |
pipx install tox
pipx install poetry
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'poetry'
- name: Run unit tests
run: tox run -e unit

publish:
name: Publish to PyPI
needs:
- build
runs-on: ubuntu-latest
environment: production
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
permissions:
id-token: write # Needed for trusted publishing (https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/)
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Charm specific
*.charm
*.snap

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -15,6 +19,7 @@ downloads/
eggs/
.eggs/
lib/
!single_kernel_mongo/lib/
lib64/
parts/
sdist/
Expand Down
57 changes: 57 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
default_install_hook_types:
- pre-commit
- commit-msg
- pre-push
- post-checkout
- post-merge

default_stages:
- pre-commit

repos:
- repo: meta
hooks:
- id: check-hooks-apply

- repo: https://github.com/python-poetry/poetry
rev: 1.8.4
hooks:
- id: poetry-check
- id: poetry-lock

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-yaml
- id: check-added-large-files
- id: debug-statements
- id: check-toml
- id: detect-private-key
exclude: "tests/unit/data/key.pem"
- id: check-merge-conflict
- id: end-of-file-fixer
- id: mixed-line-ending

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
language: system
args: ["--config-file=pyproject.toml","."]
pass_filenames: false

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies: [tomli]
args: ["--write-changes"]
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing

## Overview

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/mongo-single-kernel-library/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` and `poetry`

Install pipx: [https://pipx.pypa.io/stable/installation/](https://pipx.pypa.io/stable/installation/)

```shell
pipx install tox
pipx install poetry
```

You can create an environment for development:

```shell
poetry install
```

### Testing

```shell
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
```

### `pre-commit` hooks

This repository comes with a sensible [pre-commit](https://github.com/pre-commit/pre-commit) hook configuration.
Please install it with `pre-commit install` as this will be checked in the CI anyway.

## Canonical Contributor Agreement

Canonical welcomes contributions to the Charmed MySQL-Router Operator. Please
check out our [contributor agreement](https://ubuntu.com/legal/contributors) if you're interested in contributing to the solution.
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# mongo-single-kernel-library
Library containing shared code for MongoDB operators (mongodb, mongos, VM and k8s)
# Mongo Operators Single Kernel library

Library containing shared code for MongoDB operators (mongodb, mongos, VM and k8s).

The goal of this library is to provide reusable and shared code for the four
mongo charms:

* [MongoDB VM](https://github.com/canonical/mongodb-operator/)
* [MongoDB Kubernetes](https://github.com/canonical/mongodb-k8s-operator/)
* [Mongos VM](https://github.com/canonical/mongos-operator/)
* [Mongos Kubernetes](https://github.com/canonical/mongos-k8s-operator/)

## Code layout

The source code can be found in [./single_kernel_mongo/](./single_kernel_mongo/)
The layout is organised as so:

* [configurations](./single_kernel_mongo/config)
* [core services](./single_kernel_mongo/core/)
* [events handlers](./single_kernel_mongo/events/)
* [event managers](./single_kernel_mongo/managers/)
* [charm state](./single_kernel_mongo/state/)
* [charm workloads](./single_kernel_mongo/workload/)
* [utils and helpers](./single_kernel_mongo/utils/)
* [abstract charm skeleton](./single_kernel_mongo/abstract_charm.py)

## Project and community

Charmed Mongos K8s is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback.

* Check our [Code of Conduct](https://ubuntu.com/community/ethos/code-of-conduct)
* Raise software issues or feature requests on [GitHub](https://github.com/canonical/mongo-single-kernel-library/issues)
* Report security issues through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File).
* Meet the community and chat with us on [Matrix](https://matrix.to/#/#charmhub-data-platform:ubuntu.com)
* [Contribute](https://github.com/canonical/mongo-single-kernel-library/blob/main/CONTRIBUTING.md) to the code

## License

The Mongo Single Library is free software, distributed under the Apache Software License, version 2.0. See [LICENSE](https://github.com/canonical/mongo-single-kernel-library/blob/main/LICENSE) for more information.
Loading