-
Notifications
You must be signed in to change notification settings - Fork 9
Add container structure tests for utopia-php/image PNG ↔ WebP conversion #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Comment |
Dockerfile
Outdated
| # Install Composer | ||
| RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
|
||
| # Copy composer.json and install dependencies | ||
| COPY composer.json /usr/src/code/composer.json | ||
| RUN composer install --no-dev --working-dir=/usr/src/code | ||
|
|
||
| # Copy test files | ||
| COPY tests /tests | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot don't install composer in the Dockerfile. install the composer as part of the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Composer installation moved to the test script (run-image-conversion-test.sh). The Dockerfile no longer installs Composer - it's now installed on-the-fly during test execution. (commit 4d82f3f)
Dockerfile
Outdated
| # Copy test files | ||
| COPY tests /tests | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot don't copy tests in. Mount the tests in at runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Tests are no longer copied into the Docker image. The workflow now creates a temporary test layer at runtime that includes the tests, keeping the base image clean. (commit 731125d)
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
.github/workflows/test.yml
Outdated
| cat > Dockerfile.test <<EOF | ||
| FROM appwrite-base-test | ||
| COPY tests /tests | ||
| EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Create a test Dockerfile alongside the main Dockerfile that uses the repo's Dockerfile as a base, copies tests in and uses a multi-stage build with a composer stage that installs the necessary dependencies for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Created Dockerfile.test with:
- Multi-stage build using composer:latest stage to install dependencies
- Uses appwrite-base-test (built from main Dockerfile) as the base image
- Pre-installs utopia-php/image via Composer in a separate stage
- Copies pre-installed vendor directory and test files into final image
- Test script now checks for pre-installed dependencies before attempting to install
The workflow simply builds both Dockerfiles in sequence. (commit fca4bb2)
fca4bb2 to
1a0f313
Compare
Adds validation that the Docker image can perform bidirectional image format conversion using utopia-php/image.
Changes
Test Coverage
The test validates:
Implementation Details
The test infrastructure is completely separated from the production Docker image using a multi-stage build approach:
This architecture leverages Docker's multi-stage builds for efficient dependency management while keeping the production image production-ready and unbloated.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.