Skip to content

Conversation

@dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Jul 31, 2025

Don't skip custom users when generating pg_hba configuration

Checklist

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

@dragomirp dragomirp changed the base branch from main to 16/edge July 31, 2025 13:20
@dragomirp dragomirp added the not bug or enhancement PR is not 'bug' or 'enhancement'. For release notes label Jul 31, 2025
@codecov
Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.02%. Comparing base (823e0a0) to head (8722254).
⚠️ Report is 1 commits behind head on 16/edge.

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

❌ Your project status has failed because the head coverage (66.02%) 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    #1072      +/-   ##
===========================================
+ Coverage    65.84%   66.02%   +0.17%     
===========================================
  Files           17       17              
  Lines         4178     4179       +1     
  Branches       609      610       +1     
===========================================
+ Hits          2751     2759       +8     
+ Misses        1284     1276       -8     
- Partials       143      144       +1     

☔ 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 changed the title [DPE-7594] Add all users [DPE-7594] Add custom users to pg_hba filter Jul 31, 2025
Comment on lines +2462 to +2470
if user in (
"backup",
"monitoring",
"operator",
"postgres",
"replication",
"rewind",
):
continue
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied from the trigger.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please create a dedicated Jira ticket on Mohamed to decide the behavior here, as we are adding here backward compatibility to the current behavior which is not the best way to do in modernly hardened charm.

Thank you!

@dragomirp dragomirp marked this pull request as ready for review July 31, 2025 14:43
@dragomirp dragomirp requested review from a team, marceloneppel and taurus-forever and removed request for a team July 31, 2025 14:43
Comment on lines +285 to +286
if plugins:
self.enable_disable_extensions(dict.fromkeys(plugins, True), database)
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 change for PGB.

Comment on lines +2462 to +2470
if user in (
"backup",
"monitoring",
"operator",
"postgres",
"replication",
"rewind",
):
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Please create a dedicated Jira ticket on Mohamed to decide the behavior here, as we are adding here backward compatibility to the current behavior which is not the best way to do in modernly hardened charm.

Thank you!

Comment on lines 2516 to 2517
else:
logger.debug(f"User {user} has no databases to connect to")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The structure of relations_user_databases_map changed with logical replication. Should it be ported back to 14/edge?

Copy link
Member

Choose a reason for hiding this comment

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

Done: #1075

Comment on lines 2516 to 2517
else:
logger.debug(f"User {user} has no databases to connect to")
Copy link
Member

Choose a reason for hiding this comment

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

Done: #1075

@dragomirp dragomirp merged commit 1609fa2 into 16/edge Aug 4, 2025
154 of 159 checks passed
@dragomirp dragomirp deleted the add-all-users branch August 4, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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