Skip to content

Commit

Permalink
[DPE-6248] Avoid spamming error logs when ZK is not trusted (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Batalex authored Jan 7, 2025
1 parent 629982a commit 1d3ff8c
Show file tree
Hide file tree
Showing 8 changed files with 686 additions and 568 deletions.
4 changes: 2 additions & 2 deletions .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 Expand Up @@ -111,7 +111,7 @@ jobs:
- unit-test
- build
- integration-test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 120
steps:
- name: Checkout
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,168 changes: 665 additions & 503 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,16 @@ optional = true

[tool.poetry.group.integration.dependencies]
pytest = ">=7.2"
# FIXME (libjuju): Unpin once GH#1093 is fixed
# (impossible to parse storage constraints)
juju = "^3.2.0,<3.5.2"
# FIXME (libjuju): Once we have libjuju 3.5.2.1
websockets = "<14.0"
juju = "^3.6.0"
coverage = { extras = ["toml"], version = ">7.0" }
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}

0 comments on commit 1d3ff8c

Please sign in to comment.