Publish the production image instead of the Xdebug variant - #78
Merged
Conversation
Greptile SummaryThe PR explicitly targets the production Docker stage throughout CI while separately building, testing, and publishing the Xdebug variant.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains within the scope of this follow-up review. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "(fix): publish production image instead ..." | Re-trigger Greptile |
Every build workflow ran `docker image build ... .` with no --target, and Docker defaults to the last stage. The last stage is `xdebug`, so every published appwrite/base image has shipped Xdebug since the variant was added in 1.2.0 — and Trivy and dive were scanning that image rather than the one users actually run. Reordering the stages cannot fix this: `xdebug` is `FROM final`, so it has to be declared after `final`, which necessarily makes it last. Forward stage references do not resolve — Docker reinterprets the name as an external image and fails the pull — so an explicit --target is the only reliable control. tests.yaml only ever asserted module presence, so the xdebug image satisfied it and CI stayed green while shipping the wrong artifact. Add an excludedOutput guard so the production image cannot silently regain Xdebug, and wire up tests-xdebug.yaml, which had no consumer since 1.2.0. Publish the variant under -xdebug rather than dropping it. Appwrite's development image supplies an ini expecting xdebug.so to already exist in the base, so consumers that want Xdebug need a real image to pin. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
abnegate
force-pushed
the
fix/publish-final-not-xdebug
branch
from
August 7, 2026 02:22
d72022e to
9b1702e
Compare
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.
Problem
Every workflow builds with
docker image build ... .and no--target. Docker defaults to the last stage, and the last stage isxdebug:So every published
appwrite/baseimage has shipped Xdebug since the variant was introduced in 1.2.0. Trivy and dive were also measuring that image rather than the one users actually run.This is pre-existing on
main, not introduced by the SHA-pinning work.Why not reorder the stages instead
xdebugisFROM final, so it must be declared afterfinal— which necessarily makes it last. Forward stage references don't resolve; Docker reinterprets the name as an external image:An explicit
--targetis the only reliable control, so the README now documents it as required for local builds too.Why CI never caught it
tests.yamlonly ever asserted module presence. The Xdebug image satisfies every one of those assertions, so CI stayed green while shipping the wrong artifact. This PR adds anexcludedOutputguard so the production image cannot silently regain Xdebug.tests-xdebug.yamlhas existed since 1.2.0 with no workflow consuming it; it is now wired into the structure-test workflow.Why the variant is published rather than dropped
Downstream consumers do depend on the base providing
xdebug.so. Appwrite'sdevelopmentstage copies adev/xdebug.inicontainingzend_extension=xdebugbut never installs the extension itself, while itsbase/productionstages strip Xdebug back out — compensating for this bug from both directions.Nothing tracks a floating tag (consumers pin
1.4.4,1.2.1,1.2.0,0.11.3,0.5.0…), so this changes nothing retroactively. The variant is now published as<sha>-xdebug/<tag>-xdebugso those consumers have a real image to pin when they bump.Changes
--target finalin all four build workflows (build-and-push,structure-test,dive,trivy)-xdebugtags, per-arch plus manifeststests-xdebug.yamlintostructure-test.ymltests.yaml: assert Xdebug is absent--target finalas requiredVerification
Both variants built locally on
arm64:php -m--target finalxdebug; all 56 expected modules present--target xdebugxdebugpresentFollow-up (not in this PR)
appwrite/appwriteshould point itsdevelopmentstage atappwrite/base:<version>-xdebugbefore bumping its pin, otherwise--build-arg DEBUG=truebuilds will fail to load the extension.🤖 Generated with Claude Code