Skip to content

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Sep 26, 2025

Issue

With the new predefined roles implemented for PG 16, if a client app requests a database called databases while the PG charm tries to set up the roles for it, a failure will happen because one of the roles will conflict with the already existing charmed_databases_owner role (responsible for owning all the databases).

Solution

This PR is a follow-up from canonical/postgresql-single-kernel-library#18.

The data directory permissions were fixed, as it was done on canonical/postgresql-operator#1156. Some more fixes across this charm codebase might need to be done to make everything consistent.

Another thing that was done in this PR was to move the Pebble container that is retrieved multiple times in src/charm.py to a cached property. There are still some other places in other Python files that retrieve the Pebble container and need to be updated. This new cached property will also be useful when we start passing the container to the single kernel library objects.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.29%. Comparing base (f5c14e1) to head (c5d5b63).
⚠️ Report is 3 commits behind head on 16/edge.

Files with missing lines Patch % Lines
src/charm.py 50.00% 16 Missing ⚠️

❌ Your project status has failed because the head coverage (67.29%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           16/edge    #1108      +/-   ##
===========================================
+ Coverage    67.23%   67.29%   +0.05%     
===========================================
  Files           19       19              
  Lines         3956     3951       -5     
  Branches       564      564              
===========================================
- Hits          2660     2659       -1     
+ Misses        1123     1119       -4     
  Partials       173      173              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…lid database name and to handle storage ownership and permissions

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel force-pushed the add-invalid-database-name branch from 9bc9be2 to 13c94d6 Compare September 26, 2025 18:45
@marceloneppel marceloneppel changed the title Put container in a cached property, and update pdate lib to handle ne… Handle invalid database name Sep 26, 2025
@marceloneppel marceloneppel added the not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes label Sep 26, 2025
…se-name

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…se-name

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…se-name

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel changed the title Handle invalid database name [DPE-8473] Handle invalid database name (databases) Oct 2, 2025
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…se-name

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel marked this pull request as ready for review October 7, 2025 20:33
@marceloneppel marceloneppel merged commit dab4766 into 16/edge Oct 9, 2025
203 of 212 checks passed
@marceloneppel marceloneppel deleted the add-invalid-database-name branch October 9, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Libraries: Out of sync not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants