Skip to content

fixed pgAdmin macOS dmg installation#2018

Open
shodiBoy1 wants to merge 8 commits into
devonfw:mainfrom
shodiBoy1:feature/798-878-pgadmin-macos
Open

fixed pgAdmin macOS dmg installation#2018
shodiBoy1 wants to merge 8 commits into
devonfw:mainfrom
shodiBoy1:feature/798-878-pgadmin-macos

Conversation

@shodiBoy1

@shodiBoy1 shodiBoy1 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #798 and #878

Implemented changes:

  • GlobalToolCommandlet now handles .dmg downloads on Mac: mount the dmg, copy the .app to /Applications with sudo /usr/bin/ditto, then detach the dmg.
  • extractDmg now copies the .app with ditto (the old recursive copy crashed on the framework symlinks inside pgAdmin 4.app), and always detaches the dmg in a finally.
  • getInstallationPath finds the installed app in /Applications on Mac.
  • Fixed PgAdmin#getInstallationPath so an existing PATH-based install is no longer ignored.
  • Binary name per OS: pgAdmin 4 on Mac, pgadmin4 on Linux/Windows.
  • Privileged commands are logged before running sudo (reused the Log command before asking user for sudo password #415 logging).
  • Added FOLDER_MAC_OS constant instead of a hardcoded "MacOS".
  • Added GlobalToolCommandletTest and PgAdminTest for the binary name and .app detection.

Testing instructions

Check out the PR:

  gh pr checkout 2018

Automated tests (any OS)

  mvn -pl cli -Dtest=PgAdminTest,GlobalToolCommandletTest test

Manual test (macOS)

The install copies the app to /Applications with sudo, so it has to run in a real terminal (the IntelliJ Run console can't enter a sudo password).

  1. Build once and dump the classpath (run inside the IDEasy repo):
  mvn -q -pl cli -DskipTests compile dependency:build-classpath -Dmdep.outputFile=/tmp/ide-cp.txt
  1. Run pgadmin from a terminal (adjust the two paths to your machine: where you cloned IDEasy, and your IDE test project / IDE_ROOT):
  cd ~/projects/text-fix
  IDE_ROOT=~/projects java -cp "$HOME/IdeaProjects/IDEasy/cli/target/classes:$(cat /tmp/ide-cp.txt)" com.devonfw.tools.ide.cli.Ideasy pgadmin

You should see it download the dmg, print the privileged commands, ask for your password, copy pgAdmin 4.app into /Applications, and start pgAdmin.

  1. Run the same command again it should detect pgAdmin in /Applications, skip the install (no password prompt), and just launch it.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jun 12, 2026
@shodiBoy1 shodiBoy1 self-assigned this Jun 12, 2026
@shodiBoy1 shodiBoy1 added macOS specific for Apple MacOS pgadmin postgres admin UI integration labels Jun 12, 2026
@coveralls

coveralls commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 27744303111

Coverage decreased (-0.06%) to 71.242%

Details

  • Coverage decreased (-0.06%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 248 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

248 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/io/FileAccessImpl.java 153 67.46%
com/devonfw/tools/ide/tool/GlobalToolCommandlet.java 67 15.34%
com/devonfw/tools/ide/tool/pgadmin/PgAdmin.java 16 22.92%
com/devonfw/tools/ide/context/IdeContext.java 12 77.78%

Coverage Stats

Coverage Status
Relevant Lines: 16317
Covered Lines: 12121
Line Coverage: 74.28%
Relevant Branches: 7290
Covered Branches: 4697
Branch Coverage: 64.43%
Branches in Coverage %: Yes
Coverage Strength: 3.14 hits per line

💛 - Coveralls

@shodiBoy1 shodiBoy1 marked this pull request as ready for review June 13, 2026 14:44
@shodiBoy1 shodiBoy1 moved this from 🆕 New to Team Review in IDEasy board Jun 13, 2026

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@shodiBoy1 thanks for analysing and fixing this bug.
The code looks quite redundant to already existing code (e.g. to "extract dmg", the installation routine or to prompt when running privileged operations). I got the impression that we need to understand the root cause properly and fix the bug trying to avoid the copy&paste. I hope we will soon meet in a daily or otherwise to clarify this.

@shodiBoy1

Copy link
Copy Markdown
Contributor Author

Thanks for the review, i reworked it to fix the root cause and reused existing code instead of copying it.

  • Now it calls existing extractDmg. I only fixed method that copy the .app with ditto, because old recursive copy crashed on the framework symlinks inside pgAdmin 4.app.

  • .dmg case is just one branch in the existing doInstall.

  • also reused Log command before asking user for sudo password #415 logging (pulled logPackageManagerCommands into a shared logPrivilegedCommands).

Tested on Mac (arm64):

  • pgadmin: fresh install copies the app to /Applications and starts it; running again detects it as already installed.
  • android-studio: uses the same extractDmg, still installs fine and the dmg unmounts cleanly.
  • docker: still works, no change for an already installed Docker (detected on PATH). Since Rancher also downloads a .dmg on Mac, a fresh install now goes through the same fixed path.

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

Labels

macOS specific for Apple MacOS pgadmin postgres admin UI integration

Projects

Status: Team Review

Development

Successfully merging this pull request may close these issues.

pgadmin not working on Mac

3 participants