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

[DPE-6248] Avoid spamming error logs when ZK is not trusted #119

Merged
merged 9 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

build:
name: Build charms
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v22.0.0
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v24.0.5
with:
cache: true
path-to-charm-directory: ${{ matrix.path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v22.0.0
uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v24.0.5
with:
cache: false

Expand All @@ -40,7 +40,7 @@ jobs:
- lib-check
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v22.0.0
uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v24.0.5
with:
channel: 3/edge
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
Expand Down
9 changes: 8 additions & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ parts:
- pkg-config
- libffi-dev
- libssl-dev
override-build:
override-build: |
# get latest rust stable toolchain
rustup default stable

# Convert subset of poetry.lock to requirements.txt
curl -sSL https://install.python-poetry.org | python3 -
/root/.local/bin/poetry self add poetry-plugin-export
/root/.local/bin/poetry export --only main,charm-libs --output requirements.txt

craftctl default
charm-strict-dependencies: true
charm-requirements: [requirements.txt]
bases:
- build-on:
- name: "ubuntu"
Expand Down
1,121 changes: 638 additions & 483 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ pytest-operator = ">0.20"
requests = ">2.25"
kazoo = ">=2.8"
jsonschema = ">=4.10"
pytest-operator-cache = { git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache" }
pytest-operator-cache = { git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.5", subdirectory = "python/pytest_plugins/pytest_operator_cache" }
# To be enabled if we are using groups on integration tests
# pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v6.1.1", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
pytest-microceph = { git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/microceph" }
pytest-microceph = { git = "https://github.com/canonical/data-platform-workflows", tag = "v24.0.5", subdirectory = "python/pytest_plugins/microceph" }

[tool.poetry.group.format.dependencies]
pyright = "^1.1.301"
Expand Down
43 changes: 0 additions & 43 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/managers/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def remove_service(self, service_name: str) -> None:
self.client.delete(Service, name=service_name)
except ApiError as e:
if e.status.code == 403:
logger.error("Could not apply service, application needs `juju trust`")
logger.debug("Could not apply service, application needs `juju trust`")
return
if e.status.code == 404:
return
Expand Down
14 changes: 5 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,14 @@ deps =
[testenv:format]
description = Apply coding style standards to code
commands =
poetry config warnings.export false
poetry --no-root install
poetry export -f requirements.txt -o requirements.txt --without-hashes

poetry --no-root install --only fmt
poetry install --only fmt
poetry run black {[vars]all_path}
poetry run ruff check --fix {[vars]all_path}

[testenv:lint]
description = Check code against coding style standards
commands =
poetry install --no-root --only lint
poetry install --only lint
poetry run codespell {tox_root} \
--skip {tox_root}/.git \
--skip {tox_root}/.tox \
Expand All @@ -65,13 +61,13 @@ commands =
poetry run ruff check {[vars]all_path}
poetry run black --check --diff {[vars]all_path}

poetry --no-root install
poetry install --with lint
poetry run pyright

[testenv:unit]
description = Run unit tests
commands =
poetry install --no-root --with unit
poetry install --with unit
poetry run coverage run --source={[vars]src_path} \
-m pytest -v --tb native -s {posargs} {[vars]tests_path}/unit
poetry run coverage report
Expand All @@ -86,5 +82,5 @@ pass_env =
{[testenv]pass_env}
CI
commands =
poetry --no-root install --with integration
poetry install --with integration
poetry run pytest -vv --tb native --log-cli-level=INFO -s {posargs} {[vars]tests_path}/integration/{env:TEST_FILE}
Loading