feat: validate WordPress × PHP image combo before pulling#17
Merged
kjellberg merged 1 commit intoJun 7, 2026
Merged
Conversation
Add a best-effort preflight that checks the configured WordPress + PHP combination against Docker Hub before `kiqr up`/`kiqr restart` start containers. Not every `wordpress:<ver>-php<php>` tag is published (e.g. 6.4-php8.5, 6.7-php8.5), so the pull would otherwise fail with a confusing error. New `src/lib/image-tags.ts` exposes a pure, fetch-injectable API: - wordpressImageTag(): mirrors BitnamiRuntimeProvider tag scheme - wordpressTagExists(): 200->true, 404->false, else/throw->null - availablePhpVersionsFor(): lists published PHP versions for a WP version - validateWordPressPhp(): blocks only on a confirmed-missing tag and reports the supported PHP versions; never blocks when offline/unknown Wired into up.tsx and restart.tsx as a StepRunner step that runs before the docker compose up step. Docker invocation logic is unchanged. Addresses the WordPress x PHP combo concern raised on kiqr#13. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kjellbergzoey
force-pushed
the
feat/validate-wordpress-php-combo
branch
from
June 7, 2026 16:46
546514b to
4da77a4
Compare
Contributor
Author
|
Rebased onto current main (which now includes Biome #10 and the kiqr agent #22). The conflict was purely the Biome reformat of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds a best-effort preflight that validates the configured WordPress × PHP combination against Docker Hub before
kiqr up(andkiqr restart) try to pull the image.Not every
wordpress:<ver>-php<php>tag is published — for examplewordpress:6.4-php8.5andwordpress:6.7-php8.5do not exist — so adocker compose pullwould otherwise fail with a confusing low-level error. This directly addresses the WordPress × PHP combo concern raised in review on the merged #13.How
New
src/lib/image-tags.ts— pure and fetch-injectable so it is unit-testable without the network:wordpressImageTag(version, php)— mirrorsBitnamiRuntimeProvider.getWordPressImage's tag scheme (php8.3for latest,6.7-php8.3for a pinned version).wordpressTagExists(tag, fetchImpl)—GET /v2/repositories/library/wordpress/tags/<tag>;200 → true,404 → false, any other status or thrown error →null.availablePhpVersionsFor(version, fetchImpl)— lists the PHP versions that ARE published for a WordPress version (sorted, de-duplicated);[]on error.validateWordPressPhp(version, php, fetchImpl)— returns{ok, tag, message?, availablePhp?}.Wired into
up.tsxandrestart.tsxas aStepRunnerstep ("Validating WordPress + PHP version…") that runs before the docker compose up step. It throws the actionable.messagewhen the combo is confirmed missing, pointing the user to fixwordpress.php_versioninkiqr.yaml. Docker invocation logic is unchanged.Best-effort by design (never blocks offline)
The check only fails on a positively confirmed missing tag (HTTP 404). Any unknown result — network failure, offline, rate-limit, unexpected status — resolves to
nulland the step passes, sokiqr upis never blocked by Docker Hub being unreachable.Tests
tests/lib/image-tags.test.tsuses an injected mock fetch (no network): tag-building combos,wordpressTagExists(200/404/500/throw),availablePhpVersionsForparsing/sorting/error paths, andvalidateWordPressPhpfor exists→ok, missing→{ok:false}listing available PHP, and network-null→ok.npm run typecheck,npm test(130 passing), andnpm run buildall green.Note: this PR intentionally does not add Biome or
biome.json; the new/changed code is written to match the style in #10.🤖 Generated with Claude Code