Skip to content

Commit 79350d0

Browse files
dragomirprenovate[bot]sinclert-canonicalmarceloneppela-velasco
authored
[MISC] Sync up changes from 14 (#928)
* Update charmcraft.yaml build tools (#903) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update canonical/data-platform-workflows action to v31.0.1 (#902) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * [DPE-6344] LDAP IV: Define pebble service (#897) * Update ghcr.io/canonical/charmed-postgresql:14.17-22.04_edge Docker digest to 5f8d51a (#908) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * [DPE-6344] LDAP V: Define mapping option (#900) * Update charmcraft.yaml build tools (#912) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * [DPE-6910] Remove duplicate parameters specification (#896) * Remove duplicate parameters specification Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Enable config test Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Fix linting Signed-off-by: Marcelo Henrique Neppel <[email protected]> --------- Signed-off-by: Marcelo Henrique Neppel <[email protected]> * [MISC] Conditional checksum calculation (#901) * Conditional checksum calculation * Converge s3 resource creation * Tactically deployed sleep * Early fail * Update charmcraft.yaml build tools (#916) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Create SECURITY.md (#914) * Update pull_request_template.md (#918) * [MISC] Add missing connection vars (#920) * Update README file's security section (#921) * Add empty lines after headings * Update security section * Update link to make it clear that's not GitHub issues * [DPE-6218] Static code analysis (#915) * Create actionlint.yaml * Create tiobe_scan.yaml * Add push event to trigger the workflow once * Install libpq-dev * Remove push event * Test adding unit venv to PATH * Test sourcing unit venv * Fix sourcing * Test installing dependencies * Activate virtual environment * Add poetry dependency * Fix TICS auth token variable * Move results to the right folder * Delete .github/actionlint.yaml * Install ops * Install dependencies through poetry * Install extra dependencies * Install dependencies from all groups * Remove unnecessary step * Remove permission * Remove push trigger * Add double quotes to environment variables Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Add push trigger * Remove push trigger Signed-off-by: Marcelo Henrique Neppel <[email protected]> --------- Signed-off-by: Marcelo Henrique Neppel <[email protected]> * Update dependency uv to v0.6.14 (#924) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --------- Signed-off-by: Marcelo Henrique Neppel <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Sinclert Pérez <[email protected]> Co-authored-by: Marcelo Henrique Neppel <[email protected]> Co-authored-by: Andreia <[email protected]> Co-authored-by: Vladimir Izmalkov <[email protected]>
1 parent c8e2f34 commit 79350d0

File tree

12 files changed

+177
-81
lines changed

12 files changed

+177
-81
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
## Issue
22

3-
43
## Solution
4+
5+
## Checklist
6+
- [ ] I have added or updated any relevant documentation.
7+
- [ ] I have cleaned any remaining cloud resources from my accounts.

.github/workflows/tiobe_scan.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2025 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
name: Weekly TICS scan
5+
6+
on:
7+
schedule:
8+
- cron: "0 2 * * 6" # Every Saturday 2:00 AM UTC
9+
workflow_dispatch:
10+
11+
jobs:
12+
TICS:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Create and activate virtual environment
19+
run: |
20+
python3 -m venv .venv
21+
. .venv/bin/activate
22+
pip install flake8 poetry pylint pytest tox
23+
poetry install --all-groups
24+
echo PATH="$PATH" >> "$GITHUB_ENV"
25+
26+
- name: Run coverage tests
27+
run: |
28+
tox -e unit
29+
30+
- name: Move results to the necessary folder for TICS
31+
run: |
32+
mkdir -p .cover
33+
mv coverage.xml .cover/cobertura.xml
34+
35+
- name: TICS GitHub Action
36+
uses: tiobe/tics-github-action@v3
37+
with:
38+
mode: qserver
39+
project: postgresql-k8s-operator
40+
viewerUrl: https://canonical.tiobe.com/tiobeweb/TICS/api/cfg?name=default
41+
branchdir: ${{ env.GITHUB_WORKSPACE }}
42+
ticsAuthToken: ${{ secrets.TICSAUTHTOKEN }}
43+
installTics: true
44+
calc: ALL

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,24 @@ juju relate postgresql-k8s:db finos-waltz-k8s
9595
**Note:** The endpoint `db-admin` provides the same legacy interface `pgsql` with PostgreSQL admin-level privileges. It is NOT recommended to use it from security point of view.
9696

9797
## OCI Images
98+
9899
This charm uses pinned and tested version of the [charmed-postgresql](https://github.com/canonical/charmed-postgresql-rock/pkgs/container/charmed-postgresql) rock.
99100

100101
## Security
101-
Security issues in the Charmed PostgreSQL K8s Operator can be reported through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File). Please do not file GitHub issues about security issues.
102+
103+
Security issues in the Charmed PostgreSQL K8s Operator can be reported through [private security reports](https://github.com/canonical/postgresql-k8s-operator/security/advisories/new) on GitHub.
104+
For more information, see the [Security policy](SECURITY.md).
102105

103106
## Contributing
107+
104108
Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on enhancements to this charm following best practice guidelines, and [CONTRIBUTING.md](https://github.com/canonical/postgresql-k8s-operator/blob/main/CONTRIBUTING.md) for developer guidance.
105109

106110
## License
111+
107112
The Charmed PostgreSQL K8s Operator [is distributed](https://github.com/canonical/postgresql-k8s-operator/blob/main/LICENSE) under the Apache Software License, version 2.0.
108113
It installs/operates/depends on [PostgreSQL](https://www.postgresql.org/ftp/source/), which [is licensed](https://www.postgresql.org/about/licence/) under PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
109114

110115
## Trademark Notice
116+
111117
PostgreSQL is a trademark or registered trademark of PostgreSQL Global Development Group.
112118
Other trademarks are property of their respective owners.

SECURITY.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Security policy
2+
3+
## What qualifies as a security issue
4+
5+
Credentials leakage, outdated dependencies with known vulnerabilities, and
6+
other issues that could lead to unprivileged or unauthorized access to the
7+
database or the system.
8+
9+
## Reporting a vulnerability
10+
11+
The easiest way to report a security issue is through
12+
[GitHub](https://github.com/canonical/postgresql-k8s-operator/security/advisories/new). See
13+
[Privately reporting a security
14+
vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)
15+
for instructions.
16+
17+
The repository admins will be notified of the issue and will work with you
18+
to determine whether the issue qualifies as a security issue and, if so, in
19+
which component. We will then handle figuring out a fix, getting a CVE
20+
assigned and coordinating the release of the fix.
21+
22+
The [Ubuntu Security disclosure and embargo
23+
policy](https://ubuntu.com/security/disclosure-policy) contains more
24+
information about what you can expect when you contact us, and what we
25+
expect from you.

lib/charms/postgresql_k8s/v0/postgresql.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# Increment this PATCH version before using `charmcraft publish-lib` or reset
3737
# to 0 if you are raising the major API version
38-
LIBPATCH = 48
38+
LIBPATCH = 49
3939

4040
# Groups to distinguish HBA access
4141
ACCESS_GROUP_IDENTITY = "identity_access"
@@ -626,6 +626,7 @@ def list_access_groups(self) -> Set[str]:
626626
Returns:
627627
List of PostgreSQL database access groups.
628628
"""
629+
connection = None
629630
try:
630631
with self._connect_to_database() as connection, connection.cursor() as cursor:
631632
cursor.execute(
@@ -646,6 +647,7 @@ def list_users(self) -> Set[str]:
646647
Returns:
647648
List of PostgreSQL database users.
648649
"""
650+
connection = None
649651
try:
650652
with self._connect_to_database() as connection, connection.cursor() as cursor:
651653
cursor.execute("SELECT usename FROM pg_catalog.pg_user;")
@@ -664,6 +666,7 @@ def list_users_from_relation(self) -> Set[str]:
664666
Returns:
665667
List of PostgreSQL database users.
666668
"""
669+
connection = None
667670
try:
668671
with self._connect_to_database() as connection, connection.cursor() as cursor:
669672
cursor.execute(

poetry.lock

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ requires-poetry = ">=2.0.0"
88
[tool.poetry.dependencies]
99
python = "^3.10"
1010
ops = "^2.18.1"
11-
boto3 = "^1.35.99"
11+
boto3 = "^1.37.22"
1212
pgconnstr = "^1.0.1"
1313
requests = "^2.32.3"
1414
tenacity = "^9.0.0"

0 commit comments

Comments
 (0)