Skip to content

Conversation

@dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Aug 17, 2025

Port of canonical/postgresql-k8s-operator#1060

Postgresql side of custom username implementation based on DA-176.

Checklist

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

@codecov
Copy link

codecov bot commented Aug 17, 2025

Codecov Report

❌ Patch coverage is 36.50794% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.61%. Comparing base (cab9d43) to head (d11de2e).
⚠️ Report is 63 commits behind head on 16/edge.

Files with missing lines Patch % Lines
src/relations/postgresql_provider.py 32.75% 33 Missing and 6 partials ⚠️
src/charm.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           16/edge    #1100      +/-   ##
===========================================
- Coverage    65.09%   64.61%   -0.49%     
===========================================
  Files           17       17              
  Lines         4277     4329      +52     
  Branches       654      667      +13     
===========================================
+ Hits          2784     2797      +13     
- Misses        1318     1351      +33     
- Partials       175      181       +6     

☔ 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.

@dragomirp dragomirp added the enhancement New feature, UI change, or workload upgrade label Aug 17, 2025

def _on_relation_broken(self, event: RelationBrokenEvent) -> None:
"""Correctly update the status."""
self.update_username_mapping(event.relation.id, None)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As is the oversee_users method will not delete custom usernames, since it cannot guess them and the relation should already be terminated. That means that re-relating with the same username will error out (the user already exists). We will need to port the logic for user deletion from k8s.

@dragomirp dragomirp marked this pull request as ready for review August 25, 2025 13:38
@dragomirp dragomirp requested review from a team, marceloneppel and taurus-forever and removed request for a team August 25, 2025 13:39
Copy link
Member

@marceloneppel marceloneppel left a comment

Choose a reason for hiding this comment

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

LGTM!

@taurus-forever taurus-forever requested a review from delgod August 26, 2025 12:15
@dragomirp dragomirp merged commit 394352f into 16/edge Aug 29, 2025
225 of 235 checks passed
@dragomirp dragomirp deleted the dpe-7379-custom-username branch August 29, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, UI change, or workload upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants