Repository navigation
fix: hold swoole at 6.2.3 and test upload marker handling - #135
Merged
Merged
Conversation
Swoole v6.2.4 unlinks the path named by a client-supplied Swoole-Upload-File multipart part header when the request is freed, even after the app clears tmpfiles (swoole/swoole-src#6309). Pin v6.2.3 again, add a structure test that fails on any build that deletes the file, and have the weekly updater skip v6.2.4 so it keeps shipping other security updates instead of opening a PR that can never pass.
🟢 Tier S · Ready to merge
Pins Swoole to v6.2.3 and configures the dependency updater to skip v6.2.4 while continuing to select later releases and other package updates. Adds a multipart upload-marker regression test that runs against the built image, with selector coverage and changelog updates. Latest changes: The latest commits add a standalone
📂 Walkthrough · 10
Reviewed the commits since |
container-structure-test expands $name in command args from the image environment, so inline PHP variables became empty strings and the test failed to parse. A standalone script run with docker run keeps the PHP readable and runnable by hand.
This was referenced Nov 9, 2026
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.
Summary
Prepares
appwrite/base2.2.9: Swoole goes back to v6.2.3, CI gets a runtime test for upload marker handling against the built image, and the weekly updater skips Swoole v6.2.4. All other 2.2.8 package updates stay.Why
The Monday dependency run moved 2.2.8 from Swoole v6.2.3 to v6.2.4. On v6.2.4, a multipart part with a client-supplied
Swoole-Upload-File: <path>header makes Swoole unlink<path>when the request is freed, even after the application clears$request->tmpfiles. Appwrite's HTTP adapter (packages/http/src/Adapter/Swoole/Request.php) emptiestmpfiles, which is enough on v6.2.3 but not on v6.2.4. The upstream fix (swoole/swoole-src#6309, commits 06207974e and 532277a79 on the6.2branch) is not in a tagged release yet.Changes
Dockerfile:PHP_SWOOLE_VERSION="v6.2.3",PHP_SWOOLE_COMMIT="8b20cd39f8c19da7aaf70290037e04f616db5ff7"(checked withgit ls-remote https://github.com/swoole/swoole-src refs/tags/v6.2.3; the tag is lightweight, so this is the commit), with a one-line comment explaining the hold. Nothing else changes. The rebuild picks up newer Alpine packages through the existingapk upgrade.tests-swoole.php+ astructure-test.ymlstep: runsphp /tests-swoole.phpin the built image. It starts a Swoole server, posts a part whoseSwoole-Upload-Fileheader names an existing file, clearstmpfilesin the handler, and exits non-zero unless the response is 200 and the file still exists. Checking the status code as well means a request that never reaches the server cannot pass the test. It isn't atests.yamlcommandTestsentry because container-structure-test runs every arg through Go'sos.Expandwith the image env, so inline PHP variables ($target,$server) became empty strings and the PHP failed to parse (first CI run). As a script it stays readable and can be run by hand:docker run --rm -v "$PWD/tests-swoole.php:/tests-swoole.php:ro" <image> php /tests-swoole.php. The root.dockerignore(*test*.*) keeps it out of the build context..github/scripts:Dependencygets an optionalexcludedlist of releases, whichSelectornever selects. The catalog excludes Swoolev6.2.4. Unit tests cover the selector behaviour and the catalog entry.CHANGES.md: 2.2.9 entry.Guard: runtime test plus a narrow hold
The runtime test is the real guard. It runs in the
structure_testjob against the built image, and the automation only merges once those exact CI runs pass, so any Swoole release that still deletes the file cannot ship.Without a hold, though, every Monday run would select v6.2.4 again, fail this test, and leave a red PR. All dependencies move together in one PR, so that would also block every other security update (Alpine packages, extensions) until Swoole tags a fix. Excluding exactly
v6.2.4avoids that. The updater keeps v6.2.3, and once v6.2.5 or later is tagged it gets picked up automatically and has to pass the test like any other release. A livephp .github/scripts/bin/dependencies.php --dry-runon this branch reports Swoolev6.2.3as current with 0 updates. Remove the entry once a fixed release has shipped.Verification
Repro (server clears
tmpfiles, client sendsSwoole-Upload-File: /tmp/target-victim):tests-swoole.phpappwrite/base:2.2.8target exists after request: falsestatus 200, target deleted, exit 1target exists after request: truestatus 200, target kept, exit 0trivy image --severity HIGH,CRITICAL:appwrite/base:2.2.7appwrite/base:2.2.8git-remote-entireGo binary)The local 2.2.9 build ships curl/libcurl 8.23.0-r0, docker-cli 29.9.2-r0, docker-cli-compose 5.6.1-r0 and libexpat 2.10.0-r0.
composer verifypasses (Pint, PHPStan, 160 PHPUnit tests, 91 parity contracts). container-structure-test isn't installed locally (its gcr.io image needs auth), so the rest of the suite runs in CI only.Not tagged or released. 2.2.9 will be tagged by hand after merge.