Skip to content

Commit

Permalink
Merge branch 'main' into dpe-5827-all-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Nov 19, 2024
2 parents 026d946 + f50d373 commit 21e0b13
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 47 deletions.
58 changes: 36 additions & 22 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>canonical/data-platform//renovate_presets/charm.json5"],
"reviewers": ["team:data-platform-postgresql"],
"packageRules": [
// Later rules override earlier rules
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'github>canonical/data-platform//renovate_presets/charm.json5',
],
reviewers: [
'team:data-platform-postgresql',
],
packageRules: [
{
"matchPackageNames": ["pydantic"],
"allowedVersions": "<2.0.0"
matchPackageNames: [
'pydantic',
],
allowedVersions: '<2.0.0',
},
{
"matchManagers": ["regex"],
"matchDepNames": ["juju"],
"matchDatasources": ["pypi"],
"allowedVersions": "<3",
"groupName": "Juju agents"
}
matchManagers: [
'custom.regex',
],
matchDepNames: [
'juju',
],
matchDatasources: [
'pypi',
],
allowedVersions: '<3',
groupName: 'Juju agents',
},
],
"regexManagers": [
customManagers: [
{
"fileMatch": ["^\\.github/workflows/[^/]+\\.ya?ml$"],
"matchStrings": [
"(libjuju: )==(?<currentValue>.*?) +# renovate: latest libjuju 2"
customType: 'regex',
fileMatch: [
'^\\.github/workflows/[^/]+\\.ya?ml$',
],
matchStrings: [
'(libjuju: )==(?<currentValue>.*?) +# renovate: latest libjuju 2',
],
"depNameTemplate": "juju",
"datasourceTemplate": "pypi",
"versioningTemplate": "loose"
}
]
depNameTemplate: 'juju',
datasourceTemplate: 'pypi',
versioningTemplate: 'loose',
},
],
}
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
jobs:
lint:
name: Lint
uses: canonical/data-platform-workflows/.github/workflows/[email protected].4
uses: canonical/data-platform-workflows/.github/workflows/[email protected].5

unit-test:
name: Unit test charm
Expand All @@ -39,13 +39,13 @@ jobs:
- name: Run tests
run: tox run -e unit
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/[email protected].4
uses: canonical/data-platform-workflows/.github/workflows/[email protected].5
with:
cache: true

Expand All @@ -59,7 +59,7 @@ jobs:
allure_on_amd64: false
- agent: 3.4.6 # renovate: juju-agent-pin-minor
allure_on_amd64: true
- snap_channel: 3.6/beta
- snap_channel: 3.6/candidate
allure_on_amd64: false
architecture:
- amd64
Expand All @@ -69,15 +69,15 @@ jobs:
allure_on_amd64: true
architecture: arm64
- juju:
snap_channel: 3.6/beta
snap_channel: 3.6/candidate
allure_on_amd64: false
architecture: arm64
name: Integration | ${{ matrix.juju.agent || matrix.juju.snap_channel }} | ${{ matrix.architecture }}
needs:
- lint
- unit-test
- build
uses: canonical/data-platform-workflows/.github/workflows/[email protected].4
uses: canonical/data-platform-workflows/.github/workflows/[email protected].5
with:
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
architecture: ${{ matrix.architecture }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:

build:
name: Build charm
uses: canonical/data-platform-workflows/.github/workflows/[email protected].4
uses: canonical/data-platform-workflows/.github/workflows/[email protected].5

release:
name: Release charm
needs:
- ci-tests
- build
uses: canonical/data-platform-workflows/.github/workflows/[email protected].4
uses: canonical/data-platform-workflows/.github/workflows/[email protected].5
with:
channel: 14/edge
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
sync-docs:
name: Sync docs from Discourse
uses: canonical/data-platform-workflows/.github/workflows/[email protected].4
uses: canonical/data-platform-workflows/.github/workflows/[email protected].5
with:
reviewers: a-velasco,izmalk
permissions:
Expand Down
12 changes: 9 additions & 3 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 = 38
LIBPATCH = 39

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

Expand Down Expand Up @@ -375,8 +375,12 @@ def _generate_database_privileges_statements(
UNION SELECT 2 AS index,'ALTER SEQUENCE '|| sequence_schema || '."' || sequence_name ||'" OWNER TO {};' AS statement
FROM information_schema.sequences WHERE NOT sequence_schema IN ('pg_catalog', 'information_schema')
UNION SELECT 3 AS index,'ALTER FUNCTION '|| nsp.nspname || '."' || p.proname ||'"('||pg_get_function_identity_arguments(p.oid)||') OWNER TO {};' AS statement
FROM pg_proc p JOIN pg_namespace nsp ON p.pronamespace = nsp.oid WHERE NOT nsp.nspname IN ('pg_catalog', 'information_schema')
UNION SELECT 4 AS index,'ALTER VIEW '|| schemaname || '."' || viewname ||'" OWNER TO {};' AS statement
FROM pg_proc p JOIN pg_namespace nsp ON p.pronamespace = nsp.oid WHERE NOT nsp.nspname IN ('pg_catalog', 'information_schema') AND p.prokind = 'f'
UNION SELECT 4 AS index,'ALTER PROCEDURE '|| nsp.nspname || '."' || p.proname ||'"('||pg_get_function_identity_arguments(p.oid)||') OWNER TO {};' AS statement
FROM pg_proc p JOIN pg_namespace nsp ON p.pronamespace = nsp.oid WHERE NOT nsp.nspname IN ('pg_catalog', 'information_schema') AND p.prokind = 'p'
UNION SELECT 5 AS index,'ALTER AGGREGATE '|| nsp.nspname || '."' || p.proname ||'"('||pg_get_function_identity_arguments(p.oid)||') OWNER TO {};' AS statement
FROM pg_proc p JOIN pg_namespace nsp ON p.pronamespace = nsp.oid WHERE NOT nsp.nspname IN ('pg_catalog', 'information_schema') AND p.prokind = 'a'
UNION SELECT 6 AS index,'ALTER VIEW '|| schemaname || '."' || viewname ||'" OWNER TO {};' AS statement
FROM pg_catalog.pg_views WHERE NOT schemaname IN ('pg_catalog', 'information_schema')) AS statements ORDER BY index) LOOP
EXECUTE format(r.statement);
END LOOP;
Expand All @@ -386,6 +390,8 @@ def _generate_database_privileges_statements(
sql.Identifier(user),
sql.Identifier(user),
sql.Identifier(user),
sql.Identifier(user),
sql.Identifier(user),
)
)
statements.append(
Expand Down
18 changes: 9 additions & 9 deletions poetry.lock

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

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ optional = true

[tool.poetry.group.integration.dependencies]
pytest = "^8.3.3"
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.4", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.5", subdirectory = "python/pytest_plugins/github_secrets"}
pytest-operator = "^0.38.0"
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.4", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.4", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.5", subdirectory = "python/pytest_plugins/pytest_operator_cache"}
pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.5", subdirectory = "python/pytest_plugins/pytest_operator_groups"}
# renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940
juju = "<=3.5.0.0"
boto3 = "*"
Expand All @@ -73,7 +73,7 @@ landscape-api-py3 = "^0.9.0"
mailmanclient = "^3.3.5"
psycopg2-binary = "^2.9.10"
allure-pytest = "^2.13.5"
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.4", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}
allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v23.0.5", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"}

# Testing tools configuration
[tool.coverage.run]
Expand Down

0 comments on commit 21e0b13

Please sign in to comment.