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

[MISC] Use preset renovate configuration #316

Merged
merged 5 commits into from
Jun 27, 2024
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
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"
Comment on lines +25 to 27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lib juju 2 is the only custom config left.

},
{
"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