feat: apply configured php_version to the WordPress image#13
Conversation
WordPressConfig.php_version was written to kiqr.yaml but never read — BitnamiRuntimeProvider hardcoded PHP 8.3. Wire the configured php_version through RuntimeConfig so the config key actually selects the image: - latest: wordpress:php<php_version> (e.g. wordpress:php8.3) - pinned <ver>: wordpress:<ver>-php<php_version> (e.g. wordpress:6.7-php8.3) - wp-cli: wordpress:cli-php<php_version> (kept in sync with runtime) These official `wordpress` image tag schemes were verified to exist on Docker Hub (php8.2/8.3/8.4/8.5, <ver>-php<ver>, and cli-php<ver>) before relying on them. The default php_version remains '8.3', so the default image is functionally equivalent to the previous `wordpress:latest`. This is a pure image-tag string change; it does not alter how Docker is invoked. Tests for getWordPressImage and generateComposeServices updated to cover both latest and pinned versions and the wp-cli image. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Make sure this work with different combinations of wordpress + php version? @kjellbergzoey what do you think? |
|
Great catch @kjellberg — I verified against the Docker Hub
So e.g. Plan (follow-up PR): add a small, best-effort preflight that resolves the configured combo against the Docker Hub tags API before
This keeps the |
|
Make it validate the config before "up" @kjellbergzoey |
|
On it, @kjellberg. I'll add the validation as a fail-fast preflight step inside the Concrete plan
This keeps the 🤖 (auto-reply via Zoey) |
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>
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 #13. Co-authored-by: kjellbergzoey <kjellbergzoey@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
WordPressConfig.php_versionwas written tokiqr.yamlbykiqr initbut never read —BitnamiRuntimeProvider.getWordPressImage()hardcoded PHP 8.3. This wires the configuredphp_versionthroughRuntimeConfigso the config key actually selects the image.Image tag mapping:
latestwordpress:php<php_version>(e.g.wordpress:php8.3)<ver>wordpress:<ver>-php<php_version>(e.g.wordpress:6.7-php8.3)wordpress:cli-php<php_version>(kept in sync with the runtime PHP)Tag verification
Before relying on these schemes I verified the tags exist on Docker Hub via the registry API:
php8.2,php8.3,php8.4,php8.5✅6.7-php8.3(and the general<ver>-php<ver>scheme) ✅cli-php8.2…cli-php8.5✅Safety
php_versionis'8.3', so the default image becomeswordpress:php8.3, which is functionally equivalent to the previouswordpress:latest— no surprise upgrade for existing users.docker compose/docker compose runare invoked.Tests
tests/providers/BitnamiRuntimeProvider.test.tsupdated to cover both thelatestand pinned-version paths plus the wp-cli image;phpVersionadded to theRuntimeConfigfixtures in the provider and compose tests.npm run typecheck,npm test(72 passing), andnpm run buildall green.🤖 Generated with Claude Code