Skip to content

fix: hold swoole at 6.2.3 and test upload marker handling - #135

Merged
ChiragAgg5k merged 3 commits into
mainfrom
fix/hold-swoole-6.2.3
Nov 3, 2026
Merged

ChiragAgg5k merged 3 commits into
mainfrom
fix/hold-swoole-6.2.3

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Prepares appwrite/base 2.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) empties tmpfiles, 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 the 6.2 branch) is not in a tagged release yet.

Changes

  • Dockerfile: PHP_SWOOLE_VERSION="v6.2.3", PHP_SWOOLE_COMMIT="8b20cd39f8c19da7aaf70290037e04f616db5ff7" (checked with git 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 existing apk upgrade.
  • tests-swoole.php + a structure-test.yml step: runs php /tests-swoole.php in the built image. It starts a Swoole server, posts a part whose Swoole-Upload-File header names an existing file, clears tmpfiles in 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 a tests.yaml commandTests entry because container-structure-test runs every arg through Go's os.Expand with 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: Dependency gets an optional excluded list of releases, which Selector never selects. The catalog excludes Swoole v6.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_test job 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.4 avoids 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 live php .github/scripts/bin/dependencies.php --dry-run on this branch reports Swoole v6.2.3 as current with 0 updates. Remove the entry once a fixed release has shipped.

Verification

Repro (server clears tmpfiles, client sends Swoole-Upload-File: /tmp/target-victim):

Image Swoole Repro tests-swoole.php
appwrite/base:2.2.8 6.2.4 target exists after request: false status 200, target deleted, exit 1
local 2.2.9 build of this branch 6.2.3 target exists after request: true status 200, target kept, exit 0

trivy image --severity HIGH,CRITICAL:

Image Findings
appwrite/base:2.2.7 curl/libcurl 8.22.0 (→ 8.23.0), docker-cli 29.8.2 (→ 29.9.2), docker-cli-compose 5.1.4 (→ 5.6.1), libexpat 2.9.0 (CVE-2026-117610, CVE-2026-118370)
appwrite/base:2.2.8 libexpat 2.9.0-r0: CVE-2026-117610, CVE-2026-118370 (fixed in 2.10.0-r0)
local 2.2.9 build 0 (alpine and the git-remote-entire Go 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 verify passes (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.

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.
@ghost

ghost commented Nov 3, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The reviewed changes have no actionable issues.

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 tests-swoole.php regression test, run it against the built image in structure-test.yml, and update the changelog entry to describe that test.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 10
File Change
Dockerfile Pins the Swoole source build to v6.2.3.
.github/scripts/src/Dependency/Application.php Passes each dependency's excluded releases to the selector.
.github/scripts/src/Dependency/Catalog.php Excludes Swoole v6.2.4 from automated updates.
.github/scripts/src/Dependency/Dependency.php Adds optional excluded-release metadata to dependencies.
.github/scripts/src/Dependency/Selector.php Skips excluded releases when choosing dependency updates.
.github/scripts/tests/Unit/Dependency/CatalogTest.php Tests the Swoole release exclusion in the dependency catalog.
.github/scripts/tests/Unit/Dependency/VersionTest.php Tests selector behavior for excluded releases.
.github/workflows/structure-test.yml Runs the standalone upload-marker regression test against the built image.
tests-swoole.php Starts a Swoole server and verifies a client-supplied upload marker does not delete its target.
CHANGES.md Documents the Swoole pin, updater exclusion, and regression test.

Reviewed the commits since 3f2e636 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

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.
@ChiragAgg5k
ChiragAgg5k merged commit 1416918 into main Nov 3, 2026
12 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/hold-swoole-6.2.3 branch November 3, 2026 13:22
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