Skip to content

Commit

Permalink
[MISC] Use preset renovate configuration (#316)
Browse files Browse the repository at this point in the history
* Use preset renovate configuration

* Switch to dpw pin

* Tweak libjuju2 pin

* Bump libs
  • Loading branch information
dragomirp authored Jun 27, 2024
1 parent 9203720 commit 96c62d1
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 174 deletions.
71 changes: 4 additions & 67 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -7,87 +7,24 @@
{
"matchPackageNames": ["pydantic"],
"allowedVersions": "<2.0.0"
}, {
"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"],
"matchDepNames": ["juju"],
"matchDatasources": ["pypi"],
"versioning": "loose",
"allowedVersions": "<3",
"groupName": "Juju 2"
},
{
"matchDepNames": ["Microk8s"],
"matchPackageNames": ["canonical/microk8s"],
"extractVersion": "^v(?<version>.*)$",
"groupName": "Microk8s"
"groupName": "Juju agents"
}
],
"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$"],
"fileMatch": ["^\\.github/workflows/[^/]+\\.ya?ml$"],
"matchStrings": [
"(libjuju: )==(?<currentValue>.*?) +# renovate: latest libjuju 2"
],
"depNameTemplate": "libjuju 2",
"packageNameTemplate": "juju",
"depNameTemplate": "juju",
"datasourceTemplate": "pypi",
"versioningTemplate": "loose"
},
{
"customType": "regex",
"fileMatch": ["^(workflow-templates|\\.github/workflows)/[^/]+\\.ya?ml$"],
"matchStrings": [
"microk8s-snap-channel: (?<currentValue>.*?)-strict/stable +# renovate: latest microk8s"
],
"depNameTemplate": "Microk8s",
"packageNameTemplate": "canonical/microk8s",
"datasourceTemplate": "github-releases",
"versioningTemplate": "loose",
"extractVersionTemplate": "Microk8s release"
}
]
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
fail-fast: false
matrix:
juju:
- agent: 2.9.49 # renovate: latest juju 2
- agent: 2.9.49 # renovate: juju-agent-pin-minor
libjuju: ==2.9.49.0 # renovate: latest libjuju 2
allure_on_amd64: false
- agent: 3.1.8 # renovate: latest juju 3
Expand All @@ -62,7 +62,7 @@ jobs:
- amd64
include:
- juju:
agent: 3.1.8 # renovate: latest juju 3
agent: 3.1.8 # renovate: juju-agent-pin-minor
allure_on_amd64: true
architecture: arm64
name: Integration test charm | ${{ matrix.juju.agent }} | ${{ matrix.architecture }}
Expand Down
11 changes: 5 additions & 6 deletions lib/charms/postgresql_k8s/v0/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

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

INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles"

Expand Down Expand Up @@ -604,12 +604,11 @@ def build_postgresql_parameters(
# Use 25% of the available memory for shared_buffers.
# and the remaining as cache memory.
shared_buffers = int(available_memory * 0.25)
parameters["shared_buffers"] = f"{int(shared_buffers * 128 / 10**6)}"
effective_cache_size = int(available_memory - shared_buffers)
parameters.setdefault("shared_buffers", f"{int(shared_buffers / 10**6)}MB")
parameters.update({"effective_cache_size": f"{int(effective_cache_size / 10**6)}MB"})
else:
# Return default
parameters.setdefault("shared_buffers", "128MB")
parameters.update({
"effective_cache_size": f"{int(effective_cache_size / 10**6) * 128}"
})
return parameters

def validate_date_style(self, date_style: str) -> bool:
Expand Down
Loading

0 comments on commit 96c62d1

Please sign in to comment.