Skip to content

Boot-test every image before it gets a tag - #15

Merged
michaelaguiar merged 2 commits into
mainfrom
aliasbot/ali-1101-smoke-test
Oct 21, 2026
Merged

michaelaguiar merged 2 commits into
mainfrom
aliasbot/ali-1101-smoke-test

Conversation

@michaelaguiar

Copy link
Copy Markdown
Member

Closes ALI-1101 (https://linear.app/alias-project-inc/issue/ALI-1101), except the dry_run input (see below).

Why

The Monday no-cache rebuild pushes -latest without ever starting the image. A base that cannot start would replace the working one. (ALI-1092 was a related incident, though a smoke test of the base would not have caught that one.)

What

  • .github/scripts/smoke-test.sh <variant> <image> <php-version>: boots the image and checks PHP version, extensions per variant, non-root, healthy, and for frankenphp a PHP page served over HTTP (SAPI frankenphp), the docker-configure output and Composer. Runnable by hand.
  • frankenphp merge jobs (base, dev/wordpress, wordpress-dev): smoke-test the amd64 digest before imagetools create applies any tag. Per-arch digests now download to /tmp/digests/{amd64,arm64} so the amd64 one can be identified.
  • cli job: pushes by digest, smoke-tests, then tags with imagetools create.
  • A failure leaves <tag>, -latest and -<sha> untouched, and the child images (dev, wordpress, wordpress-dev) are held back because their jobs need the parent to succeed.

Tested locally

  • Passes on the real 8.4 cli, base, dev, wordpress, wordpress-dev and 8.5 cli images.
  • Fails on a wrong PHP version, a missing extension, and an image with a bad CMD (2.5s).
  • actionlint and shellcheck report nothing from these changes (the remaining findings are in the existing Build Summary step).

Not verified

The workflow itself cannot run before merge. After merging, trigger workflow_dispatch with force_build_all and check each merge job. Things only a real run proves: multi-platform push-by-digest for the cli images, pulling by digest on the runner, and sparse-checkout of the script.

Not included

  • arm64 is not booted (the merge-job runners are amd64).
  • The dry_run input: child jobs build FROM the parent's -<sha> tag, which a dry run never creates. Needs its own design.

Weekly no-cache rebuilds pushed -latest without ever starting the image.
Now each image is pushed by digest, booted by .github/scripts/smoke-test.sh
(PHP version, extensions, non-root, healthy, serving PHP over HTTP for the
frankenphp images), and only then tagged. A failing image leaves the
existing tags alone and holds back the images built FROM it.

Only the amd64 image is booted. The dry_run input from the ticket is not
included: child jobs build FROM the parent's -<sha> tag, which a dry run
never creates.

ALI-1101
…e comment

Review of #15 found: the README said every image is booted, but arm64 images
are not; a failing docker run in the CLI path exited under set -e without the
SMOKE TEST FAILED line; and the wordpress-dev merge job's comment claimed it
holds back images built FROM it, but nothing is built from wordpress-dev.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (fresh-context reviewer, code-review at high effort)

No P1 or P2 findings. Confirmed by the reviewer: a failed smoke step cannot lead to a tag (tag and merge steps get an implicit success()), a skipped build skips smoke and tag too, download-artifact@v4 puts files directly in path, docker run repo@sha256:<digest> works after the GHCR login, the multi-platform CLI digest resolves to the amd64 image on the runner, sparse-checkout is valid, the script is committed 100755, a bad CMD fails the frankenphp path, and the script has no false-pass or false-fail path it could find. actionlint is at the baseline (12 findings, all in the existing Build Summary step); shellcheck is clean.

Finding Outcome
P3: no dry_run input (ticket item 2) Redirected to ALI-1112, expanded after this review. The reviewer is right that my reasoning only rules out a full dry run: a base-only dry run (build, smoke, no tags, no children) is feasible and is now listed there as option 2. Still not in this PR: even a base-only run writes untagged digests to GHCR, so it needs a design decision rather than a quick add.
P3: CLI index is tagged after booting only amd64 Declined for this PR, tracked in ALI-1113. Adding an arm64 step needs QEMU, which I cannot run locally, and a flaky emulated run would fail the weekly tag closed. Decision recorded there; native frankenphp arm64 legs are the better first step.
P3: README said every image is booted Fixed in 0c7baec: now says the amd64 image of every variant, and that arm64 is built but not booted.
P3: stale "holds back images built FROM this one" comment in the wordpress-dev merge job Fixed in 0c7baec.
P3: a failing docker run in the CLI path exited under set -e without the SMOKE TEST FAILED line Fixed in 0c7baec; checked against a nonexistent image.

Re-checked after the fixes: smoke test passes on 8.4-cli, shellcheck clean, actionlint unchanged at baseline.

Still unproven: the workflow can only run after merge. Trigger workflow_dispatch with force_build_all and confirm: multi-platform push-by-digest for the CLI images, pulling by digest on the runner, and the sparse checkout.

@michaelaguiar
michaelaguiar marked this pull request as ready for review October 21, 2026 23:31
@michaelaguiar
michaelaguiar merged commit c0a92cb into main Oct 21, 2026
2 checks passed
@michaelaguiar
michaelaguiar deleted the aliasbot/ali-1101-smoke-test branch October 21, 2026 23:35
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