Skip to content

feat(pgpm): pgpm doctor — OS-aware dependency checks; robust docker daemon detection#1463

Merged
pyramation merged 1 commit into
mainfrom
feat/pgpm-doctor
Jul 26, 2026
Merged

feat(pgpm): pgpm doctor — OS-aware dependency checks; robust docker daemon detection#1463
pyramation merged 1 commit into
mainfrom
feat/pgpm-doctor

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Turns the quickstart prerequisites page into an executable check and makes pgpm docker fail with actionable, OS-specific guidance. No install-time automation — doctor only runs when invoked.

  • New pgpm doctor [--db] [--json] (pgpm/cli/src/commands/doctor.ts): checks node (fail <18, warn <20), docker (binary on PATH AND docker info daemon reachability — distinguishes "not installed" from "installed but daemon down"), docker compose (plugin or standalone, warn-only), psql (fail if missing, warn <17), and with --db a live SELECT 1 via psql using getPgEnvOptions()/getSpawnEnvWithPg(). Exit 1 on any failure; --json emits { platform, checks, summary } for CI.
  • Shared checks module pgpm/cli/src/utils/doctor.ts:
    • detectPlatform()macos | linux(+distro from /etc/os-release) | wsl(/proc/version) | windows
    • dockerInstallGuidance / dockerDaemonGuidance / psqlInstallGuidance return per-OS remediation (brew vs apt-get vs dnf vs winget; "open Docker Desktop" vs systemctl start docker + docker-group hint)
    • all checks accept an injectable CommandRunner for testing
  • pgpm docker hardened: checkDockerAvailable() (binary-only) replaced with ensureDockerReady() — start/stop now report daemon-down vs not-installed with the same OS-aware guidance; docker ls requires the daemon, not just the binary.
  • 25 unit tests (pgpm/cli/__tests__/doctor.test.ts) with mocked runners covering platform detection, each check's pass/warn/fail paths, and per-OS guidance.

Plan: https://github.com/constructive-io/constructive-planning/issues/1258 (PR 1 of the rollout; init-time checks and docs deferred).

Link to Devin session: https://app.devin.ai/sessions/3810d68dc3384dc5b4430a63da7af981
Requested by: @pyramation

@pyramation pyramation self-assigned this Jul 26, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit 0a486f6 into main Jul 26, 2026
15 checks passed
@pyramation
pyramation deleted the feat/pgpm-doctor branch July 26, 2026 19:23
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.

1 participant