GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: honour pgpass file in Change Server Password dialog (#10449) by MaybeSomeone-arc18 · Pull Request #10451 · pgadmin-org/pgadmin4

Conversation

@MaybeSomeone-arc18

@MaybeSomeone-arc18 MaybeSomeone-arc18 commented Sep 23, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
MaybeSomeone-arc18 added 2 commits September 23, 2026 03:53
@MaybeSomeone-arc18
fix: honour pgpass file in Change Server Password dialog (pgadmin-org…
e933dc5
…#10449)
@MaybeSomeone-arc18
test: cover pgpass handling in ChangePasswordContent (pgadmin-org#10449)
16225b7
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dpage pushed a commit that referenced this pull request Sep 30, 2026
@MaybeSomeone-arc18 @dpage
Honour the pgpass file in the Change Server Password dialog (#10451)
bdd3282
The dialog hardcoded the pgpass flag to false, so it always demanded the
current password even when the connection authenticates via a passfile.
Pass the flag from check_pgpass through to the schema instead.

check_pgpass and change_password also disagreed about when a passfile is
in use: the former treated a password entered at connect but not saved
as a passfile connection, which would now disable the Current Password
field whilst the endpoint still required it. Both now use a shared
is_using_passfile() helper.

Fixes #10449
@dpage

dpage commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Thanks, Sanskar. Squashed and merged to master as bdd3282. I folded in one backend change: check_pgpass treated a password entered at connect (but not saved) as a passfile connection, whereas change_password did not, so with the dialog now honouring the flag the Current Password field would have been disabled whilst the endpoint still required it. Both views now share an is_using_passfile() helper, with unit tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dpage dpage closed this Sep 30, 2026
@MaybeSomeone-arc18

MaybeSomeone-arc18 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks Dave! Appreciate the quick review, and the shared is_using_passfile() helper - learned from that one. Happy to pick up more issues.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@MaybeSomeone-arc18 @dpage
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.