Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Align the root PHP requirement with the PHP 8.2+ dependency lock or retain a PHP 8.1-compatible lock.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates the PHP SDK relay for PHP 8.3 compatibility and improves startup failure handling.
Changes:
- Pins Composer resolution to PHP 8.3 and re-locks compatible dependencies.
- Updates the Docker image to PHP 8.3.
- Enables fail-fast setup and cleans stale temporary checkouts.
| File | Summary |
|---|---|
package-testing/php-sdk-relay/Dockerfile |
Uses PHP 8.3. |
package-testing/php-sdk-relay/composer.lock |
Locks PHP 8.3-compatible dependencies. |
package-testing/php-sdk-relay/composer.json |
Adds the PHP platform override; the PHP 8.1 requirement conflicts with the resulting lock. |
package-testing/php-sdk-relay/build-and-run.sh |
Adds fail-fast behavior and temporary-directory cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Response from codex: Fact-check of this PR description, 3 rounds, against the diff, the repo files, and the author's executed evidence (docker runs, CI API results).
VERDICT: POST AS IS - Both edits match the supplied evidence. |
e5635c1 to
9863d37
Compare
|
🤖 Response from codex: Fact-check of the updated PR description (four changes), against the diff, the repo files, and the author's executed evidence (docker runs; CI run and probe-run logs from the GitHub API). One run per section, iterated until no factual defect remained.
VERDICT: POST AS IS (every section, on the posted text). |
|
🤖 Response from codex: Review of
|
|
🤖 Response from Claude: Re the Copilot review overview on
|
|
🤖 Response from codex: Review of
|
|
🤖 Response from Claude: Re the Copilot review overview on
codex adjudicated this separately and returned REPLY (no change). |
The lock had symfony/options-resolver v8.1.0, which needs PHP >= 8.4.1. The CI runner has PHP 8.3.6, so composer install refused the lock. Set config.platform.php to 8.3.0. This makes composer resolve for PHP 8.3 on any machine. Re-lock with `composer update symfony/options-resolver`. The only package change is symfony/options-resolver v8.1.0 -> v7.4.8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Without set -e, a failed composer install did not stop the script. The script then started php -S on a relay with no vendor/ directory. A failed git clone also did not stop it: its `exit 1` ran in a subshell. The relay then served the locked eppo/php-sdk, not the requested ref. Remove tmp/ before the clone instead of mkdir -p. With set -e, a failed cp leaves tmp/ in place, and git clone refuses a non-empty directory. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The relay image used php:8.1. The lock now needs PHP >= 8.2, and composer.json sets config.platform.php to 8.3.0. With that override, composer install on PHP 8.1 passes, and the relay then fails on each request in vendor/composer/platform_check.php. Use the PHP version the lock targets. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The lock needs PHP >= 8.2, but composer.json still said ^8.1. Set require.php to ^8.3, the same version as config.platform.php. Now vendor/composer/platform_check.php requires PHP >= 8.3.0. The lock refresh (`composer update --lock`) changes only the content-hash and the platform entry. No package changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
test-sdk.sh set SDK_REF to its third argument or main. The composite action passes the ref in the SDK_REF env and calls test-sdk.sh with two arguments. So the sdk_ref input had no effect, and every run tested SDK main. Now the third argument wins, then the SDK_REF env, then main. The php and node relays now fetch the ref with git fetch, not git clone -b. git clone -b accepts only a branch or a tag. git fetch also accepts a full commit SHA and a pull request ref. A pull_request ref_name (<N>/merge) maps to refs/pull/<N>/merge. The relays log the commit that they check out. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
test-sdk.sh polled the relay URL for 5 minutes and did not check the relay process. A relay that failed at once still cost 5 minutes, and its error was only in the sdk.log artifact. Pass the launch script PID to wait_for_url. If the script exits with a non-zero status, stop at once. A script that exits 0 may leave the server running (for example `docker run -d`), so polling continues. When the relay does not start, print the last 50 lines of sdk.log to the step log. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…pinned The action checked out Eppo-exp/sdk-test-data with no ref. In a consumer repo, that is the default branch, whatever ref the consumer put after @ in `uses:`. So the relay code did not follow the pin. A new step reads github.action_repository and github.action_ref through env, the form that works in a composite action. If the action comes from Eppo-exp/sdk-test-data, checkout uses that ref. Otherwise (a local ./ action, or empty values) the ref is empty, and checkout keeps its default. The step logs both values and the chosen ref. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
build-and-run.sh used a fixed relative tmp/ and ran rm -Rf tmp before and after the checkout. The path depends on the caller's cwd, so a manual run from another directory could delete an unrelated tmp/. Use mktemp -d, remove it after the copy into vendor/, and remove it on exit so a failed fetch leaves nothing behind. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
test-sdk.sh resolved SDK_REF, then sourced .env, so a SDK_REF line in .env beat an explicit sdkRef argument. The script header and the README say the argument wins. Resolve SDK_REF after .env, next to the other env defaults. Order: argument, then SDK_REF from .env or the shell, then main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ba55e6e to
5140fd9
Compare

🤖 Generated from Claude
Jira: FFESUPPORT-969. PHP package tests fail since 2026-06-22. This PR fixes them, plus 3 harness bugs found on the way.
config.platform.php8.3.0,require.php^8.3, Dockerfilephp:8.3).symfony/options-resolverv8.1.0 → v7.4.8. No other package changes.composer installfailed.build-and-run.sh:set -e. Check out the SDK in a privatemktemp -ddir, removed after the copy and on exit.tmp/depended on the caller's cwd.test-sdk.sh: honorsdk_ref(argument → env →main). php and node relays fetch the ref: branch, tag, full SHA, or<N>/merge.test-sdk.sh:59resetSDK_REFtomain. Relays that read it always gotmain.test-sdk.sh: stop when the relay launch script exits non-zero. Print the last 50 lines ofsdk.log.@refinuses:). No ref → today's default.mainharness files.CI (manual dispatch; no workflow runs on PRs for these paths):
Test Packaged SDKsat5140fd9, the head after the rebase onmain(#163 merged) (run): all 6 jobs pass, php 264/264. Every job pulled the testing-api and runner images that #163's release workflows pushed. Before the rebase, atba55e6e(run): all 6 jobs pass, php 264/264. Probe run: pinned checkout works,v4.2.1and70/mergepass, a bad ref fails in 5 s.After merge (both consumers pin
@main, so they get all changes at the next run):v*tag runs test the tag, notmain.mainruns hid.Details: php relay (changes 1–2)
composer installrefused the lock (see thesdk.logartifact). Noset -e, so the script startedphp -Swith novendor/. Each request failed, and the health check timed out after 5 min. Examples: main run 30020967684, branch run 36277178730.composer update symfony/options-resolveronly. A full update changes 15 more packages and removes 2 (incl.psr/http-message1.1 → 2.0,symfony/cache6.4 → 7.4). The relay replaces onlyvendor/eppo/php-sdk/, so the rest stays as locked. Lock also getsplatform.php^8.3, a newcontent-hash, andplatform-overrides.8.3.0. CI runs 8.3.6. Composer reads8.3as8.3.0. php-sdk uses the sameX.Y.Zform (8.1.0). Today8.3.0and8.3.6resolve the same. The solver never picks a package whose PHP floor is above 8.3.0. Not8.1.0: PHP 8.1 is end of life, and CI does not run it.require.php^8.3. The lock needs PHP ≥ 8.2, so^8.1was wrong.^8.3matches the platform value.platform_check.phpnow requires ≥ 8.3.0.set -e. A failedcomposer install, SDK checkout, orcpintovendor/now stops the script at the real error. Before, the clone'sexit 1ran in a subshell,cpcopied nothing, and the relay tested v4.2.1.php src/eppo_poller.php &runs in the background (not affected).php -Sis last.mktemp -d.mainused a fixed relativetmp/and deleted it. That path depends on the caller's cwd (CI: the relay dir viapushd; Docker:/relayapp), so a manual run elsewhere could delete an unrelatedtmp/. A fresh private dir per run also keeps stale files from a failed run out ofvendor/. AnEXITtrap removes it when the fetch fails. Nothing else in the relay usestmp/.composer installchecks against 8.3.0, not the real PHP. On PHP 8.1 the install passes, then each request fails inplatform_check.php. CI does not use this Dockerfile.docker-run.shand the README do.Details:
sdk_ref(change 3)sdk_refin envSDK_REFand callstest-sdk.shwith 2 arguments, so${3:-main}always gavemain. Order now:sdkRefargument, thenSDK_REFfrom.envor the shell (.envwins, as it does for the other env defaults such asEPPO_API_HOST), thenmain. Before,.envalso beat the argument.git init+git fetch --depth 1+git checkout FETCH_HEAD.git clone -btakes only a branch or tag.<N>/mergemaps torefs/pull/<N>/merge. Each relay logs the commit it checks out.git clone -b. dotnet clones only whenSDK_REFis not empty (always, as before). java and go do not readSDK_REF. node still prefersSDK_VERSION; no consumer sets it. In this repo the workflow passes nosdk_ref, so every relay still getsmain.Details: fail fast (change 4)
wait_for_urlgets the launch script PID, on all 3 launch paths (build-and-run.sh,docker-run.sh,build-and-run-<platform>.sh). Non-zero exit: stop at the next failed poll (5 s interval), message "SDK Relay launch script exited with status N", job exits 1.docker run -d). So it cannot trip this check.docker-run.shhas no-d. php'sdocker-run.shhas-d, butbuild-and-run.shruns first. android (not in CI) exits afteradb shell am start: 0 on success, so polling continues. The check covers startup only.Details: pinned checkout (change 5)
github.action_repositoryandgithub.action_refthrough stepenv, the form the contexts docs name for composite actions. Direct reads inrunare empty (actions/runner#2473).Eppo-exp/sdk-test-data→ checkout that ref. Else (local./action, empty, other repo) → empty ref. Inactions/checkout@v3, empty = noref: the triggering ref here, else the default branch. Worst case = today's behavior. The step logs both values and its choice.Evidence
CI
5140fd9(head: the same 9 commits rebased onmain33da68c, which includes fix(FFESUPPORT-999): remediate September 2026 vulnerabilities #163;git range-diffshows each commit unchanged): all 6 jobs pass. php 264/264, node 264/264, java 256/258 (2 skipped), go/ruby/python 229/239 (10 skipped). Each job pulled runnersha256:a57af999…and testing-apisha256:c928cf0b…, the digests that fix(FFESUPPORT-999): remediate September 2026 vulnerabilities #163's release workflows pushed.ba55e6e(head before the rebase,.envprecedence fix): all 6 jobs pass, php 264/264.20eb741(addsmktemp): all 6 jobs pass, php 264/264.9863d37: php 264/264 (PHP 8.3.6, options-resolver v7.4.8), node 264/264, java 256/258 (2 skipped), go/ruby/python 229/239 (10 skipped). Resolve step logged empty values (local action), so checkout used its default.c64282b(changes 1–2 only): all pass, php 264/264.e5635c1(temporary commit, since removed; 3 php jobs):@9863d37…withsdk_ref: v4.2.1: checked out sdk-test-data9863d37; relay checked out php-sdk9e25253(v4.2.1); 264/264.sdk_ref: 70/merge: relay checked out2deacf7; 264/264.sdk_ref: no-such-ref-969: failed 5 s after relay start, with "couldn't find remote ref" and "launch script exited with status 1" in the step log (expected).After merge, a push to
mainruns the same workflow.Local (docker; real
test-sdk.sh, stubdockerwhere noted). CI pulls the publishedlatesttesting-api and runner images; the local full tests built them from this repo. CI clones the SDK at run time.origin/mainlock fails on PHP 8.3.6 and 8.3.35. New lock installs on 8.3.6, 8.3.35, 8.4.26, 8.5.11. Full package test with images built from this repo: 264/264 on 8.3.6.composer audit --lockedand OSV (42 packages): no advisories. On 8.5.11, a fullcomposer update --dry-runkeeps v7.4.8; withoutconfig.platformit picks v8.1.0..envand shell;.envbeats shell; shell alone used; nothing →main. php relay checks out thels-remotecommit formain, a slashed branch, tagv4.3.0, a full SHA,70/merge,refs/pull/68/merge. Bad ref exits 1 in 3 s. Full tests: phpv4.2.1264/264, php70/merge264/264, nodev4.0.1264/264, node127/merge264/264.docker): healthy php relay passes.mainlock: stops in ~5 s, status 2, options-resolver error shown. BadSDK_REF: status 1. Missing command: 127. Platform script exit 5: status 5. Background server + exit 0: passes. Exit 0 with no server: keeps polling. On macOS bash 3.2.57, statuses 3, 127, and 5, the background-server case, and a platform script with a foreground server give the same results.mktemp(relay Dockerfile image):v4.2.1relay answers HTTP 200, checks out9e25253; an unrelatedtmp/sentinelin the cwd survives; no temp dir left. Bad ref: exit 1 in < 1 s, temp dir removed, sentinel intact.mktemp -dalso works on macOS.mainfor (Eppo-exp/sdk-test-data,main); empty for (actions/checkout,v3), (empty, empty), (Eppo-exp/sdk-test-data, empty).Not validated · follow-ups
Not validated
main). The probe used the same code path at a pinned SHA.pull_requestrun in a consumer: neither has one.<N>/mergetested locally and in the probe.Follow-ups
git clone -b(branch or tag only). python's|| ( echo ...; exit 1 )does not stop its script.action.ymlsayssdk_versionoverridessdk_ref. Of the CI relays, only node readsSDK_VERSION.🤖 Generated with Claude Code