Add prebuilt CI image and images.yml workflow #57
Labels
No labels
bug
duplicate
enhancement
good first issue
help wanted
question
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/incr#57
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adopt ffr's CI-image approach. This is the concrete implementation of #46 — that ticket states the goal, this one states the method.
Current cost per CI run
.forgejo/workflows/ci.ymlruns oncatthehacker/ubuntu:act-latestand, every single run:setup-phpwith 8 extensions (pdo_mysql, mbstring, xml, dom, bcmath, gd, exif, pcntl) plus pcovmysql:8.0service containerffr does none of this — it runs directly in
forge.lvl0.xyz/lvl0/fedi-feed-router-ci:php8.3-3, where PHP and extensions are already baked in, and the whole job is checkout → composer install → pint → phpstan → phpunit.Scope
docker/build/Dockerfile.ci— PHP 8.3 + the extension set + composer.forgejo/workflows/images.yml— mirror ffr's: matrix build, triggered on pushes tomaintouchingdocker/build/**or the workflow itself, plusworkflow_dispatch. Tag:php8.3-N,:latest,:${{ github.sha }}ci.ymlto run in that image and drop thesetup-phpstep and the MySQL wait loopDecisions to make during planning
Does the DB stay? ffr's CI has no service container. Whether incr still needs
mysql:8.0depends on how #54's tests are written — if they use SQLite in-memory or pure factories, the service container and the wait loop both disappear and the run gets dramatically faster. Worth deciding deliberately rather than inheriting.Skip
Dockerfile.base? ffr builds both a base and a CI image. incr already hasdocker/production/Dockerfiledoing that job, so probably only the CI image is needed here.Do not regress
incr's
build.ymlis ahead of ffr's — it buildslinux/amd64,linux/arm64via QEMU where ffr is amd64-only. Keep multi-arch.Likewise
ci.yml's coverage-parsing and PR-comment steps have no ffr equivalent and should be preserved. Note the comment step already hascontinue-on-error: truefrom7c56df3(DNS unreachable from the runner) — that workaround should be re-evaluated once CI runs in a controlled image.Sequencing
Cheapest after #52. Once React is gone, the separate
buildjob (npm ci+npm run build) shrinks to almost nothing or disappears, which changes what the image needs to contain.Acceptance criteria
images.ymlci.ymlruns in it with nosetup-phpstep⚠️ Bootstrap gap — CI will be red on
release/0.4.0until mergeci.ymlnow runs inforge.lvl0.xyz/lvl0/incr-ci:php8.3-1, which does not exist yet.images.ymlbuilds it only on pushes tomaintouchingdocker/build/**, andworkflow_dispatchonly appears in the Forgejo UI once the workflow exists on the default branch.So the sequence is:
main—images.ymlfires, builds and pushesincr-ci:php8.3-1.Accepted deliberately rather than diverging from ffr's main-only image convention or hand-seeding the registry. If the red run becomes a nuisance before merge, adding
release/*toimages.yml's branch filter closes the gap in one line.Do not interpret the failing run as a broken pipeline — check the pull error names
incr-cibefore investigating anything else.Done —
1fecc2bdocker/build/Dockerfile.ci—php:8.3-cliwithpdo_mysql,mbstring,dom,xml,bcmath,fileinfo,pcntl,gd,pcovbaked in, plus git/unzip/nodejs/netcat-openbsd and Composer. Debian rather than alpine, following ffr's note about DNS timeouts against codeload during composer install..forgejo/workflows/images.yml— matrix build onmainpushes touchingdocker/build/**, plusworkflow_dispatch. Tags:php8.3-1,:latest,:${{ github.sha }}.ci.yml— now runs in the prebuilt image; thesetup-phpstep (PHP 8.3 + 8 extensions + pcov, installed on every single run) is gone.Only a CI image was added, no
Dockerfile.base—docker/production/Dockerfilealready covers the runtime, as the ticket anticipated.Open decision resolved: the database stays
The ticket flagged this as a planning call. Settled with evidence rather than inherited from ffr:
tests/Feature/DropUsersMigrationTest.php:53queriesinformation_schema.columnsdropForeign, theunsignedIntegerceiling, and theSQLSTATE[22003]overflow that caught a real bug during #50Switching to SQLite in-memory would silently weaken exactly the tests that have been catching defects all milestone. The
mysql:8.0service and the readiness loop stay — hencenetcat-openbsdin the image.The win is therefore from baking PHP in, not from dropping the DB.
Two bugs caught while writing this
Composer cache path was wrong.
ci.ymlcached~/.composer/cache, which is whatcatthehacker/ubuntuproduced. Onphp:8.3-cliComposer uses~/.cache/composer(ffr's value). Left unchanged, the cache key would have matched but the path would have been empty — a silent permanent cache miss, and the obvious "why is CI still slow" trap.The
buildjob would have broken. It runsnpm ci, but the new CI image is PHP-only. Moved tonode:22-bookworm-slim.Not regressed
build.ymlstill buildslinux/amd64,linux/arm64— ahead of ffr, preserved as the ticket requiredcontinue-on-errorPR comment from7c56df3The
continue-on-errorworkaround is worth re-evaluating once runs happen in the controlled image, as the ticket suggests — but that needs a real run to assess, so it stays for now.Outstanding: the measurement
"Wall-clock CI time measurably lower than the current baseline" cannot be checked yet — the image does not exist until v0.4.0 merges to
main(see the bootstrap note above). That measurement belongs to #46, which stays open for it.Gates
PHPUnit 33 tests, 81 assertions PASS. No app code touched.