Skip to content

fix: honour pgpass file in Change Server Password dialog (#10449) - #10451

Open
MaybeSomeone-arc18 wants to merge 2 commits into
pgadmin-org:masterfrom
MaybeSomeone-arc18:fix-10449-pgpass-change-password
Open

MaybeSomeone-arc18 wants to merge 2 commits into
pgadmin-org:masterfrom
MaybeSomeone-arc18:fix-10449-pgpass-change-password

Conversation

@MaybeSomeone-arc18

@MaybeSomeone-arc18 MaybeSomeone-arc18 commented Sep 23, 2026

Copy link
Copy Markdown

Fixes #10449.

The Change Server Password dialog always required the current password, even when the server connects via a pgpass file. ChangePasswordContent never accepted the isPgpassFileUsed prop that showChangeServerPassword() passes, and built its schema with the value hardcoded to false.

  • Accept isPgpassFileUsed (default false) and pass it to ChangePasswordSchema
  • Add it to propTypes
  • Pass the save button label through gettext()
  • Add regression/javascript/Dialogs/ChangePasswordContent.spec.js covering both the pgpass and the ordinary password case

The new tests fail on master and pass with this change. I haven't touched the hasCsrfToken point mentioned in the issue, to keep this focused.

Summary by CodeRabbit

  • Bug Fixes
    • The current-password field is disabled and no longer required when a pgpass file is in use.
  • Improvements
    • The password-change dialog’s Save button label is now localized.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pgadmin-org/pgadmin4/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6d4459b7-5dc4-47eb-baf0-a7e905875861

📥 Commits

Reviewing files that changed from the base of the PR and between d0315c5 and 16225b7.

📒 Files selected for processing (2)
  • web/pgadmin/static/js/Dialogs/ChangePasswordContent.jsx
  • web/regression/javascript/Dialogs/ChangePasswordContent.spec.js

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The change-password dialog now passes isPgpassFileUsed to its schema, which controls the current-password field. The save button label uses gettext(...). Tests cover both pgpass states and mismatched passwords.

Changes

Change-password dialog

Layer / File(s) Summary
Schema wiring and validation
web/pgadmin/static/js/Dialogs/ChangePasswordContent.jsx, web/regression/javascript/Dialogs/ChangePasswordContent.spec.js
The dialog passes isPgpassFileUsed to the schema and declares the prop. The Change label uses gettext(...). Tests check the current-password field with and without pgpass and verify mismatch validation.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 16225

The pgpass-aware password dialog is mergeable after normal checks; no actionable risk remains identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: honoring pgpass use in the Change Server Password dialog.
Linked Issues check ✅ Passed Issue #10449 requires the current-password field to be disabled and optional when pgpass is in use, while keeping it enabled and required otherwise. ChangePasswordContent now accepts `isPgpassFileUs…
Out of Scope Changes check ✅ Passed The changes support Issue #10449. Exporting ChangePasswordSchema allows the regression test to validate its behavior. The save-button translation addresses the issue's localization note. No unrelate…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change Server Password wrongly requires a current password when a pgpass file is used

1 participant