Skip to content

feat: warn on Dokku version mismatch via pinned dokku.version#3

Merged
guess merged 11 commits into
mainfrom
worktree-encapsulated-dreaming-hennessy
Apr 28, 2026
Merged

feat: warn on Dokku version mismatch via pinned dokku.version#3
guess merged 11 commits into
mainfrom
worktree-encapsulated-dreaming-hennessy

Conversation

@guess

@guess guess commented Apr 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Wire up the existing dokku.version config field to actually enforce a minimum: on up and diff, query dokku version and warn if the server is older than the pinned floor.
  • Behavior is opt-in (silent when the field is absent, which is today's default), warning-only on drift, error on unparseable server output. validate stays offline — no server query added there.
  • Adds src/modules/version.ts with a pure compareSemver helper and a runner-aware ensureDokkuVersion. 13 new unit tests.
  • New reference doc at docs/reference/dokku.md, linked from the README Features table.

Test plan

  • bun test passes (228 tests, including 13 new)
  • bun run build succeeds clean
  • Run dokku-compose up against a server with dokku.version unset — no warning, no behavior change
  • Run dokku-compose up with dokku.version: "<higher than server>" pinned — warning prints, command continues
  • Run dokku-compose diff with a pinned-higher version — same warning prints once at the top of diff output
  • Run dokku-compose validate <file> with dokku.version set — completes offline, no server query, no warning

guess added 11 commits April 28, 2026 14:18
Address gaps surfaced by a junior-developer review pass:
- Add Prerequisites covering bun/vitest and Context vs Runner types
- Show full final test and module file contents instead of "append" steps
- Make up.ts insertion explicit so existing docker_auth line is preserved
- Resolve conflicting README placement instruction
- Specify validate command shape and a real fixture path
Wire ensureDokkuVersion into computeDiff so that diff, like up,
warns when the server's Dokku version is below the pinned minimum.
The check is warning-only and opt-in via dokku.version in the config.

No diff.test.ts changes were needed: the test fixture omits
dokku.version, so ensureDokkuVersion returns immediately without
querying the server.
- Share `extractServerVersion(output)` between `ensureDokkuVersion` and
  `runExport`. Both call sites previously inlined the same regex against
  `dokku version` output.
- Drop the parenthetical "warning-only, opt-in via dokku.version" portion
  of the call-site comments — the function name already says what's
  happening. Keep `up.ts`'s "Phase 0:" prefix to match the existing
  navigational pattern in that file.
@guess
guess merged commit 8d8aa29 into main Apr 28, 2026
1 check passed
@guess
guess deleted the worktree-encapsulated-dreaming-hennessy branch April 28, 2026 20:17
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