Add Copilot setup steps workflow#11590
Conversation
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
✨ Benchmark results
⚡ Benchmark Comparison
|
| coverage: none | ||
|
|
||
| - name: Install PHP dependencies | ||
| run: composer install --no-interaction --prefer-dist --optimize-autoloader |
There was a problem hiding this comment.
@copilot change this to:
composer install --ignore-platform-reqs --optimize-autoloader --no-interaction --no-plugins --no-scripts --prefer-dist
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
| VERSION=dev | ||
|
|
||
| - name: Pull docker-compose dependency images | ||
| run: docker compose pull --ignore-buildable |
There was a problem hiding this comment.
@copilot the CI failed because appwrite-dev is still being pull but results in:
Error response from daemon: pull access denied for appwrite-dev, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
It shouldn't be pulled because it was just built and it's a buildable and the param --ignore-buildable was passed.
There was a problem hiding this comment.
Fixed in 7b3d99e. The root cause was that services like appwrite-realtime, appwrite-worker-*, etc. use image: appwrite-dev but don't have a build: section, so --ignore-buildable didn't skip them.
The fix uses docker compose config --format json to get the fully resolved config, then filters out any service whose image is appwrite-dev before passing the remainder to docker compose pull.
Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testFunctionsStats |
1 | 10.13s | Logs |
UsageTest::testPrepareSitesStats |
1 | 6ms | Logs |
Commit c457a50 - 5 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.05s | Logs |
DocumentsDBConsoleClientTest::testTimeout |
1 | 121.56s | Logs |
LegacyConsoleClientTest::testUpsertDocument |
1 | 241.79s | Logs |
LegacyCustomClientTest::testAttributeResponseModels |
1 | 120.78s | Logs |
LegacyCustomServerTest::testTimeout |
1 | 120.96s | Logs |
Adds
.github/workflows/copilot-setup-steps.ymlto pre-warm the Copilot coding agent environment so it can run tests without rebuilding from scratch on every session.What it does
appwrite-devDocker image — uses thedevelopmenttarget withTESTING=true, mirroringtests.ymldocker compose pull --ignore-buildableto stay automatically in sync withdocker-compose.yml(no hardcoded image list)Cache strategy
Per-ref GHA cache scoping prevents conflicts when multiple Copilot agent sessions run concurrently on different branches, with a fallback to
main's warm cache for new branches:Original prompt
Add the following file to the repository at
.github/workflows/copilot-setup-steps.yml:This workflow pre-warms the GitHub Actions Docker layer cache and pulls all dependency images defined in
docker-compose.yml, so that the GitHub Copilot coding agent environment is ready to run tests without needing to build or pull images from scratch each time.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: What should be included in the .github/workflows/copilot-setup-steps.yml for this repo?
Assistant: Based on my analysis of the
appwrite/appwriterepository — its language composition (TypeScript 72.4%, PHP 26.7%),composer.json,package.json, and existing CI workflows — here is what thecopilot-setup-steps.ymlshould contain, along with a full explanation.What to Include in
.github/workflows/copilot-setup-steps.ymlKey Requirements (from GitHub Docs)
copilot-setup-steps— this is how Copilot coding agent identifies it.workflow_dispatch,push, andpull_requeston the file path so you can validate it easily.contents: readis sufficient for cloning).What This Repo Needs
Looking at the repo's stack:
composer.json("php": ">=8.3.0")curl,imagick,mbstring,json,yaml,dom,redis,swoole,pdo,openssl,zlib,sockets,fileinfocomposer install.nvmrc/package.jsonfor versiondocker compose up -d); thetests.ymlbuilds a Docker image and runs tests inside itRecommended
copilot-setup-steps.yml