Skip to content

feat(php): migrate environment from EOL PHP 7.3 to PHP 8.3#443

Merged
sanketsudake merged 2 commits into
masterfrom
php8-migration
Jun 6, 2026
Merged

feat(php): migrate environment from EOL PHP 7.3 to PHP 8.3#443
sanketsudake merged 2 commits into
masterfrom
php8-migration

Conversation

@sanketsudake
Copy link
Copy Markdown
Member

What

Part of the dependency-update series (#436#442). The largest migration of the batch: PHP 7.3 (EOL Dec 2021) → PHP 8.3.

Images

  • php:7.3-alpinephp:8.3-alpine (runtime + builder); alpine edge/testing repo removed
  • Extension list rationalized: json is built into PHP 8; xmlrpc/mcrypt were removed from core (PECL ports unmaintained); bundled extensions (ctype/curl/dom/iconv/fileinfo/pdo/phar/simplexml) are no longer recompiled — rebuilding bundled iconv fails on musl; ftp kept (it's bundled-source but not enabled by default); gd configure flags updated to the PHP 8 form

Dependencies (lock regenerated)

  • monolog ^1.22^3.10, react/http ^0.8.4^1.11, php-parser ^4.2^5.7, explicit react/socket ^1.17

server.php — API migration + hardening

  • react/http 1.x: HttpServer/SocketServer/React\Http\Message\Response; global loop auto-runs (verified: uncaught handler Throwables still produce 500 and the process keeps serving — same invariant as 0.8)
  • php-parser 5 createForNewestSupportedVersion(), Monolog 3 Level::Debug
  • Hardening from review: /v2/specialize payload validation (malformed JSON used to return a fake 201, then misleading errors on invoke — now 400 with logging), explicit functionName destructuring (kills PHP 8 Undefined array key warnings on the legacy echo path), output-buffer balance on all early-return paths (the leak was unbounded in this long-running process and could corrupt echo-mode bodies), explicit 500 + log when a named handler doesn't exist (was a silent 404), react/http error event logging

CI

  • The php7 job used hiberbee/github-action-skaffold@1.27.0, which pins skaffold 2.3.1 — too old to parse our skaffold/v4beta13 config, so the job was broken whenever it triggered (same pre-existing issue affects perl/ruby/tensorflow; fixed per-env in their PRs). Now uses SKAFFOLD_PROFILE=php7 make skaffold-run like every other job.

Releases

  • envconfig.json: runtimeVersion 8.3, version 1.31.2 → 1.32.0; environments.json regenerated. (Directory/image names stay php7/php-env — path filters and release derivation depend on them; README updated.)

Verification (local)

  • ✅ env + builder images build on php:8.3-alpine
  • php -l clean
  • ✅ Smoke: v2 handler (hellopsr::handler) → 201, invoke returns PSR-7-written body, Monolog 3 logs emitted
  • ✅ Smoke: v2 legacy echo (hello.php, no ::) → 201, invoke returns echoed body, zero undefined-key warnings
  • ✅ Malformed specialize payload → 400 (was fake-201)

🤖 Generated with Claude Code

Runtime/builder images:
- php:7.3-alpine -> php:8.3-alpine; drop the alpine edge/testing repo
- Remove json (built into PHP 8) and xmlrpc/mcrypt (removed from PHP 8
  core, PECL ports unmaintained); only compile extensions not already
  bundled with the official image (rebuilding bundled iconv fails on
  musl); modernize gd configure flags

Dependencies (composer.lock regenerated):
- monolog/monolog ^1.22 -> ^3.10, react/http ^0.8.4 -> ^1.11,
  nikic/php-parser ^4.2 -> ^5.7, explicit react/socket ^1.17

server.php migration and hardening:
- React\Http\Server -> HttpServer, RingCentral Psr7 ->
  React\Http\Message\Response, React\Socket\Server -> SocketServer,
  drop EventLoop\Factory (react 1.x auto-runs the global loop)
- ParserFactory createForNewestSupportedVersion(); Monolog Level enum
- Validate /v2/specialize payload (400 on malformed JSON instead of a
  fake 201); explicit functionName destructuring (no PHP 8 undefined
  array key warnings on the legacy echo path); balance ob_start on all
  early-return paths (the leak grew unbounded in this long-running
  process); explicit 500 + log when the named handler is missing;
  log react/http error events (framework 500s were invisible)

CI: php7 job switches from hiberbee/github-action-skaffold (pins
skaffold 2.3.1 which cannot parse our skaffold/v4beta13 config —
the job was broken whenever triggered) to make skaffold-run.

envconfig runtimeVersion 8.3, version 1.32.0; environments.json
regenerated.

Verified locally: images build; smoke tests pass for v2 handler
(PSR-7 mutation + Monolog 3 output), v2 legacy echo (no warnings),
malformed payload -> 400, php -l clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sanketsudake added a commit that referenced this pull request Jun 6, 2026
Same fix as #442/#443/#444: hiberbee/github-action-skaffold pins
skaffold 2.3.1, which cannot parse the repo's skaffold/v4beta13
config. Needed here so the perl job can validate the kind-action
hotfix end to end (identical hunk to #444, merges cleanly).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sanketsudake added a commit that referenced this pull request Jun 6, 2026
* ci: fix broken setup-kind action with helm/kind-action

engineerd/setup-kind v0.6.2 fails with 'File not found:
dist/main/index.js' (the tagged commit does not ship the compiled
action), breaking the setup-cluster step for every env job. Switch to
the maintained helm/kind-action v1.14.0 with cluster_name kind so the
kind-kind kubectl context and `kind load docker-image` defaults keep
working.

Also make collect-fission-dump best effort: a missing fission CLI
(setup failed before installing it) or empty dump no longer masks the
original job failure.

The broken bump in #436 went unnoticed because that PR touched no env
directories, so no job exercised setup-cluster pre-merge; this PR
includes a perl README link fix so the perl job validates the action
end to end.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci(perl): run skaffold via make instead of the stale skaffold action

Same fix as #442/#443/#444: hiberbee/github-action-skaffold pins
skaffold 2.3.1, which cannot parse the repo's skaffold/v4beta13
config. Needed here so the perl job can validate the kind-action
hotfix end to end (identical hunk to #444, merges cleanly).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sanketsudake sanketsudake merged commit 8a57238 into master Jun 6, 2026
15 checks passed
@sanketsudake sanketsudake deleted the php8-migration branch June 6, 2026 16:29
sanketsudake added a commit that referenced this pull request Jun 6, 2026
…444)

perl:
- Pin perl:latest -> perl:5.42 (reproducible builds);
  envconfig runtimeVersion 5.42, version 1.32.0

tensorflow-serving:
- Pin unpinned tensorflow/serving -> tensorflow/serving:2.20.0
  (latest stable); upstream publishes amd64 only, so the Makefile
  target restricts PLATFORMS to linux/amd64
- GO_VERSION 1.13 (EOL 2021) -> 1.26 with go-modules migration: the
  Dockerfile used a pre-modules GOPATH layout and bare `go get`,
  which modern Go refuses; now go mod init/tidy/build (resolves
  pkg/errors + zap)
- envconfig runtimeVersion 2.20.0, version 1.32.0

CI: perl and tensorflow jobs drop hiberbee/github-action-skaffold
(pins skaffold 2.3.1, which cannot parse our skaffold/v4beta13
config) in favour of make skaffold-run, same as #442/#443.

environments.json regenerated.

Verified locally: perl image builds and boots (Dancer2 routes respond
on perl 5.42.2); tensorflow image builds for linux/amd64 with the
modules migration; make dry-run confirms the PLATFORMS override
produces a valid amd64-only push for the release flow.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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