Skip to content

Commit

Permalink
Configure Renovate (canonical#122)
Browse files Browse the repository at this point in the history
* Add renovate.json

* Team config

* Regex tweaks

* Pin exact versions

* Scaledown includes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
  • Loading branch information
renovate[bot] and dragomirp committed Mar 30, 2023
1 parent 36eba8a commit 3a28787
Show file tree
Hide file tree
Showing 11 changed files with 205 additions and 160 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- '.jujuignore'
- 'LICENSE'
- '**.md'
- 'renovate.json'
schedule:
- cron: '53 0 * * *' # Daily at 00:53 UTC
# Triggered on push to branch "main" by .github/workflows/release.yaml
Expand Down Expand Up @@ -69,15 +70,23 @@ jobs:
fail-fast: false
matrix:
tox-environments:
- backup-integration
- charm-integration
- database-relation-integration
- db-relation-integration
- db-admin-relation-integration
- ha-self-healing-integration
- password-rotation-integration
- tls-integration
name: ${{ matrix.tox-environments }}
agents-version: ["2.9.42"] # renovate: latest
include:
- tox-environments: backup-integration
agents-version: "2.9.29"
- tox-environments: charm-integration
agents-version: "2.9.29"
- tox-environments: database-relation-integration
agents-version: "2.9.29"
- tox-environments: db-relation-integration
agents-version: "2.9.29"
- tox-environments: db-admin-relation-integration
agents-version: "2.9.29"
- tox-environments: ha-self-healing-integration
agents-version: "2.9.29"
name: ${{ matrix.tox-environments }} | ${{ matrix.agents-version }}
needs:
- lib-check
- lint
Expand All @@ -93,8 +102,7 @@ jobs:
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
# This is needed until https://bugs.launchpad.net/juju/+bug/1977582 is fixed
bootstrap-options: "--agent-version 2.9.29"
bootstrap-options: "--agent-version ${{ matrix.agents-version }}"
- name: Download packed charm(s)
uses: actions/download-artifact@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ parts:
- libssl-dev
- rustc
- cargo
charm-binary-python-packages: [psycopg2-binary==2.9.5]
charm-binary-python-packages:
- psycopg2-binary==2.9.5 # renovate
3 changes: 2 additions & 1 deletion lib/charms/observability_libs/v1/kubernetes_service_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def setUp(self, *unused):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 5
LIBPATCH = 6

ServiceType = Literal["ClusterIP", "LoadBalancer"]

Expand Down Expand Up @@ -201,6 +201,7 @@ def __init__(
# Ensure this patch is applied during the 'install' and 'upgrade-charm' events
self.framework.observe(charm.on.install, self._patch)
self.framework.observe(charm.on.upgrade_charm, self._patch)
self.framework.observe(charm.on.update_status, self._patch)

# apply user defined events
if refresh_event:
Expand Down
178 changes: 89 additions & 89 deletions poetry.lock

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,68 @@ repository = "https://github.com/canonical/postgresql-k8s-operator"

[tool.poetry.dependencies]
python = "^3.8.10"
ops = "^2.0"
pgconnstr = "^1.0.1"
tenacity = "^8.2.2"
cryptography = "^39.0.2"
jsonschema = "^4.17.3"
jinja2 = "^3.1.2"
lightkube = "^0.12.0"
lightkube-models = "^1.26.0.4"
requests = "^2.28.2"
boto3 = "^1.26.87"
ops = "2.2.0"
pgconnstr = "1.0.1"
tenacity = "8.2.2"
cryptography = "39.0.2"
jsonschema = "4.17.3"
jinja2 = "3.1.2"
lightkube = "0.12.0"
lightkube-models = "1.26.0.4"
requests = "2.28.2"
boto3 = "1.26.102"
# psycopg2 = "^2.9.5" # Injected in charmcraft.yaml

[tool.poetry.group.format]
optional = true

[tool.poetry.group.format.dependencies]
black = "^22.12.0"
isort = "^5.11.4"
black = "22.12.0"
isort = "5.12.0"

[tool.poetry.group.lint]
optional = true

[tool.poetry.group.lint.dependencies]
flake8 = "^6.0.0"
flake8-docstrings = "^1.7.0"
flake8-copyright = "^0.2.4"
flake8-builtins = "^2.1.0"
pyproject-flake8 = "^6.0.0.post1"
flake8 = "6.0.0"
flake8-docstrings = "1.7.0"
flake8-copyright = "0.2.4"
flake8-builtins = "2.1.0"
pyproject-flake8 = "6.0.0.post1"
pep8-naming = "^0.13.3"
codespell = "^2.2.4"
codespell = "2.2.4"

[tool.poetry.group.unit]
optional = true

[tool.poetry.group.unit.dependencies]
coverage = {extras = ["toml"], version = "^7.0.5"}
pytest = "^7.2.2"
pytest-asyncio = "^0.20.3"
psycopg2 = {version = "^2.9.5", extras = ["binary"]}
coverage = {extras = ["toml"], version = "7.2.2"}
pytest = "7.2.2"
pytest-asyncio = "0.20.3"
psycopg2 = {version = "2.9.5", extras = ["binary"]}

[tool.poetry.group.integration]
optional = true

[tool.poetry.group.integration.dependencies]
lightkube = "^0.12.0"
pytest = "^7.1.1"
pytest-operator = "^0.23.0"
juju = "^2" # Latest juju 2
psycopg2 = {version = "^2.9.5", extras = ["binary"]}
pytest = "7.2.2"
pytest-operator = "0.23.0"
juju = "2.9.42.1" # Latest juju 2
psycopg2 = {version = "2.9.5", extras = ["binary"]}

[tool.poetry.group.ha_charm]
optional = true

[tool.poetry.group.ha_charm.dependencies]
ops = "^2.0"
tenacity = "^8.2.2"
ops = "2.2.0"
tenacity = "8.2.2"

[tool.poetry.group.relation_charm]
optional = true

[tool.poetry.group.relation_charm.dependencies]
ops = "^2.0"
ops = "2.2.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
46 changes: 46 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"reviewers": ["dragomirp", "marceloneppel", "taurus-forever"],
"enabledManagers": ["poetry", "pip_requirements", "github-actions", "regex"],
"schedule": ["after 1am and before 2am every weekday"],
"timezone": "Etc/UTC",
"prHourlyLimit": 0,
"packageRules": [
{
"matchManagers": ["poetry", "pip_requirements", "regex"],
"matchDatasources": ["pypi"],
"groupName": "Python dependencies"
}, {
"matchManagers": ["github-actions"],
"groupName": "GitHub actions"
}, {
"matchPackageNames": ["juju/juju"],
"allowedVersions": "<3.0.0",
"extractVersion": "^juju-(?<version>.*)$",
"groupName": "Juju agent"
}, {
"matchPackageNames": ["juju"],
"allowedVersions": "<3.0.0"
}
],
"regexManagers": [
{
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": ["agents-version: \\[\"(?<currentValue>.*?)\"\\] +# renovate: latest"],
"depNameTemplate": "juju/juju",
"datasourceTemplate": "github-releases",
"versioningTemplate": "loose",
"extractVersionTemplate": "Juju release"
}, {
"fileMatch": ["(^|/)([\\w-]*)charmcraft\\.ya?ml$"],
"matchStrings": ["- (?<depName>.*?)==(?<currentValue>.*?) +# renovate"],
"datasourceTemplate": "pypi",
"versioningTemplate": "loose"
}
],
"ignorePaths": [],
"ignoreDeps": []
}
24 changes: 12 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ anyio==3.6.2 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0"
attrs==22.2.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836 \
--hash=sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99
boto3==1.26.87 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:7cf46d6aa67487ae5dc43a7bd10e1ebe9b8c442c7f32f7fea259cd3df6eeb52d \
--hash=sha256:b0f7e801d6d5cb96ed89e1d39326bb072b5d9175bb6c986850c77b640474d297
botocore==1.29.87 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:2b981c3ebb347bdf2a8c3c0ce7e7712c76bfe43ae87d30776a3ab469e305f469 \
--hash=sha256:f4066e1ce1fd8790e872c70deede5d7abd94c87dcdb12892b4359245fed927f9
boto3==1.26.102 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:043f8981d10c4e7c48736df4381dac557b46c5b369b0a450d8f3d7f5fdd24db5 \
--hash=sha256:b00f416832bc59863b96175045d2ebe067d9222289bce677c48fd72c006eaaad
botocore==1.29.102 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:4bae8f502507da18ff37c61cb18745cfb11d87a61dd0ea27e346adadff92aa3f \
--hash=sha256:58b11c630d2044ea732ba4c403d29fab51e954465f9b3f7099cbf5ac0ce7ab47
certifi==2022.12.7 ; python_full_version >= "3.8.10" and python_version < "4" \
--hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \
--hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18
Expand Down Expand Up @@ -259,9 +259,9 @@ markupsafe==2.1.2 ; python_full_version >= "3.8.10" and python_full_version < "4
--hash=sha256:f1cd098434e83e656abf198f103a8207a8187c0fc110306691a2e94a78d0abb2 \
--hash=sha256:f2bfb563d0211ce16b63c7cb9395d2c682a23187f54c3d79bfec33e6705473c6 \
--hash=sha256:f8ffb705ffcf5ddd0e80b65ddf7bed7ee4f5a441ea7d3419e861a12eaf41af58
ops==2.1.1 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:b2802068557c64121bf50ccfe101b043ed08c02ac5f958e55752c476b09de63d \
--hash=sha256:bed9f14b785efaa83f89b9c76b87bd1b3b82b0350c453b41dce778b39c7410b4
ops==2.2.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:14d4c43f4a4dc0830af1b2cb21313ef93308d3c389f7bedecc14a70b69000b64 \
--hash=sha256:90fa55249f5c3a7bcb7cc73731227eac867f9bb8426100d10724fe461de142a8
pgconnstr==1.0.1 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:0656129961ae879675d0842f5237db82d31ce59c7b3211b051c33e37a864826e \
--hash=sha256:0f65830e7e3b76adf4390a8592ee52343171a17caef7436257e7bc81c44e21a7
Expand Down Expand Up @@ -361,9 +361,9 @@ sniffio==1.3.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.
tenacity==8.2.2 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:2f277afb21b851637e8f52e6a613ff08734c347dc19ade928e519d7d2d8569b0 \
--hash=sha256:43af037822bd0029025877f3b2d97cc4d7bb0c2991000a3d59d71517c5c969e0
urllib3==1.26.14 ; python_full_version >= "3.8.10" and python_version < "4" \
--hash=sha256:076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72 \
--hash=sha256:75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1
urllib3==1.26.15 ; python_full_version >= "3.8.10" and python_version < "4" \
--hash=sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305 \
--hash=sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42
websocket-client==1.5.1 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:3f09e6d8230892547132177f575a4e3e73cfdf06526e20cc02aa1c3b47184d40 \
--hash=sha256:cdf5877568b7e83aa7cf2244ab56a3213de587bbe0ce9d8b9600fc77b455d89e
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/ha_tests/application-charm/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ bases:
channel: "22.04"
parts:
charm:
charm-binary-python-packages: [psycopg2-binary==2.9.5]
charm-binary-python-packages:
- psycopg2-binary==2.9.5 # renovate
6 changes: 3 additions & 3 deletions tests/integration/ha_tests/application-charm/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ops==2.1.1 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:b2802068557c64121bf50ccfe101b043ed08c02ac5f958e55752c476b09de63d \
--hash=sha256:bed9f14b785efaa83f89b9c76b87bd1b3b82b0350c453b41dce778b39c7410b4
ops==2.2.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:14d4c43f4a4dc0830af1b2cb21313ef93308d3c389f7bedecc14a70b69000b64 \
--hash=sha256:90fa55249f5c3a7bcb7cc73731227eac867f9bb8426100d10724fe461de142a8
pyyaml==6.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf \
--hash=sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293 \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ops==2.1.1 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:b2802068557c64121bf50ccfe101b043ed08c02ac5f958e55752c476b09de63d \
--hash=sha256:bed9f14b785efaa83f89b9c76b87bd1b3b82b0350c453b41dce778b39c7410b4
ops==2.2.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:14d4c43f4a4dc0830af1b2cb21313ef93308d3c389f7bedecc14a70b69000b64 \
--hash=sha256:90fa55249f5c3a7bcb7cc73731227eac867f9bb8426100d10724fe461de142a8
pyyaml==6.0 ; python_full_version >= "3.8.10" and python_full_version < "4.0.0" \
--hash=sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf \
--hash=sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293 \
Expand Down
12 changes: 0 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ commands =
description = Run unit tests
commands =
poetry install --with unit
poetry export -f requirements.txt -o requirements.txt
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 @@ -71,7 +70,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/test_backups.py

[testenv:charm-integration]
Expand All @@ -82,7 +80,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/test_charm.py

[testenv:database-relation-integration]
Expand All @@ -93,8 +90,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry export --only relation_charm -f requirements.txt -o tests/integration/new_relations/application-charm/requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/new_relations/test_new_relations.py

[testenv:db-relation-integration]
Expand All @@ -105,7 +100,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/test_db.py

[testenv:db-admin-relation-integration]
Expand All @@ -116,7 +110,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/test_db_admin.py

[testenv:ha-self-healing-integration]
Expand All @@ -127,8 +120,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry export --only ha_charm -f requirements.txt -o tests/integration/ha_tests/application-charm/requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/ha_tests/test_self_healing.py

[testenv:password-rotation-integration]
Expand All @@ -139,7 +130,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/test_password_rotation.py

[testenv:tls-integration]
Expand All @@ -150,7 +140,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/test_tls.py

[testenv:integration]
Expand All @@ -161,7 +150,6 @@ pass_env =
CI_PACKED_CHARMS
commands =
poetry install --with integration
poetry export -f requirements.txt -o requirements.txt
poetry run pytest -v --tb native --log-cli-level=INFO -s --durations=0 {posargs} {[vars]tests_path}/integration/

[testenv:poetry-lock]
Expand Down

0 comments on commit 3a28787

Please sign in to comment.