Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
62 changes: 61 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"],
"reviewers": ["dragomirp", "marceloneppel", "taurus-forever"],
"reviewers": ["dragomirp", "lucasgameiroborges", "marceloneppel", "taurus-forever"],
"packageRules": [
// Later rules override earlier rules
{
Expand All @@ -10,6 +10,66 @@
}, {
"matchPackageNames": ["python"],
"allowedVersions": "<3.11"
},
{
"matchDepNames": ["Juju 2"],
"matchPackageNames": ["juju/juju"],
"allowedVersions": "<3.0.0",
"extractVersion": "^v(?<version>.*)$",
"groupName": "Juju 2"
},
{
"matchDepNames": ["Juju 3"],
"matchPackageNames": ["juju/juju"],
"allowedVersions": "<3.2.0",
"extractVersion": "^v(?<version>.*)$",
"groupName": "Juju 3"
},
{
"matchDepNames": ["libjuju 2"],
"matchPackageNames": ["juju"],
"matchManagers": ["regex"],
"matchDatasources": ["pypi"],
"versioning": "loose",
"allowedVersions": "<3",
"groupName": "Juju 2"
}
],
"regexManagers": [
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"(- agent: )(?<currentValue>.*?) +# renovate: latest juju 2"
],
"depNameTemplate": "Juju 2",
"packageNameTemplate": "juju/juju",
"datasourceTemplate": "github-releases",
"versioningTemplate": "loose",
"extractVersionTemplate": "Juju release"
},
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"(- agent: )(?<currentValue>.*?) +# renovate: latest juju 3"
],
"depNameTemplate": "Juju 3",
"packageNameTemplate": "juju/juju",
"datasourceTemplate": "github-releases",
"versioningTemplate": "loose",
"extractVersionTemplate": "Juju release"
},
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"(libjuju: )==(?<currentValue>.*?) +# renovate: latest libjuju 2"
],
"depNameTemplate": "libjuju 2",
"packageNameTemplate": "juju",
"datasourceTemplate": "pypi",
"versioningTemplate": "loose"
}
]
}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
fail-fast: false
matrix:
juju:
- agent: 2.9.46
libjuju: ^2
- agent: 2.9.49 # renovate: latest juju 2
libjuju: ==2.9.46.1 # renovate: latest libjuju 2
allure: false
- agent: 3.1.7
- agent: 3.1.8 # renovate: latest juju 3
allure: true
name: Integration test charm | ${{ matrix.juju.agent }}
needs:
Expand Down
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resources:
postgresql-image:
type: oci-image
description: OCI image for PostgreSQL
upstream-source: ghcr.io/canonical/charmed-postgresql@sha256:a9b6f25cc6a12b0cb81cb19be76804f4a9452e4388ab2a11efd2d57a316977c5
upstream-source: ghcr.io/canonical/charmed-postgresql@sha256:31cf150b4523481202c1ff9b7b5d7f0b36729edad89d61242d8f1eb56b2912c0

peers:
database-peers:
Expand Down
56 changes: 28 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repository = "https://github.com/canonical/postgresql-k8s-operator"
python = "^3.10"
ops = "^2.12.0"
cryptography = "^42.0.5"
boto3 = "^1.34.84"
boto3 = "^1.34.88"
pgconnstr = "^1.0.1"
requests = "^2.31.0"
tenacity = "^8.2.3"
Expand Down Expand Up @@ -43,7 +43,7 @@ cosl = "*"
optional = true

[tool.poetry.group.format.dependencies]
ruff = "^0.3.7"
ruff = "^0.4.1"

[tool.poetry.group.lint]
optional = true
Expand Down Expand Up @@ -72,9 +72,10 @@ pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workf
pytest-operator = "^0.34.0"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.1.1", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v13.1.1", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
juju = "^3.2.2"
# renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940
juju = "<=3.4.0.0"
psycopg2-binary = "^2.9.9"
boto3 = "^1.34.84"
boto3 = "^1.34.88"
tenacity = "^8.2.3"
allure-pytest = "^2.13.5"

Expand Down
38 changes: 20 additions & 18 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,26 @@ async def test_postgresql_parameters_change(ops_test: OpsTest) -> None:
for unit_id in UNIT_IDS:
host = await get_unit_address(ops_test, f"{APP_NAME}/{unit_id}")
logger.info("connecting to the database host: %s", host)
with psycopg2.connect(
f"dbname='postgres' user='operator' host='{host}' password='{password}' connect_timeout=1"
) as connection, connection.cursor() as cursor:
settings_names = ["max_prepared_transactions", "shared_buffers", "lc_monetary"]
cursor.execute(
sql.SQL("SELECT name,setting FROM pg_settings WHERE name IN ({});").format(
sql.SQL(", ").join(sql.Placeholder() * len(settings_names))
),
settings_names,
)
records = cursor.fetchall()
settings = convert_records_to_dict(records)
connection.close()

# Validate each configuration set by Patroni on PostgreSQL.
assert settings["max_prepared_transactions"] == "100"
assert settings["shared_buffers"] == "128"
assert settings["lc_monetary"] == "en_GB.utf8"
try:
with psycopg2.connect(
f"dbname='postgres' user='operator' host='{host}' password='{password}' connect_timeout=1"
) as connection, connection.cursor() as cursor:
settings_names = ["max_prepared_transactions", "shared_buffers", "lc_monetary"]
cursor.execute(
sql.SQL("SELECT name,setting FROM pg_settings WHERE name IN ({});").format(
sql.SQL(", ").join(sql.Placeholder() * len(settings_names))
),
settings_names,
)
records = cursor.fetchall()
settings = convert_records_to_dict(records)

# Validate each configuration set by Patroni on PostgreSQL.
assert settings["max_prepared_transactions"] == "100"
assert settings["shared_buffers"] == "128"
assert settings["lc_monetary"] == "en_GB.utf8"
finally:
connection.close()


@pytest.mark.group(1)
Expand Down