Skip to content

Stop publishing wordpress-dev under the -wordpress tags - #8

Merged
michaelaguiar merged 3 commits into
mainfrom
fix-frankenphp-variant-manifests
Oct 21, 2026
Merged

michaelaguiar merged 3 commits into
mainfrom
fix-frankenphp-variant-manifests

Conversation

@michaelaguiar

@michaelaguiar michaelaguiar commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Why

After #7 merged, the published -wordpress and -wordpress-dev tags turned out to be mixed and partly unpatched. Two workflow bugs cause this. Both predate #7.

1. -wordpress tags also contain the wordpress-dev images (since 05833ad, 2026-08-27). merge-frankenphp-dependent collects digests with the glob digest-fpdep-<ver>-<variant>-*. For wordpress that also matches digest-fpdep-<ver>-wordpress-dev-<arch>, so each <ver>-frankenphp-wordpress manifest lists four images instead of two: its own amd64/arm64 plus wordpress-dev's. Which one a host pulls depends on manifest order. Right now, for example, 8.3-frankenphp-wordpress and 8.5-frankenphp-wordpress resolve on amd64 to wordpress-dev images running PHP 8.3.30 and 8.5.2. Those images are unpatched, and they also lack the wordpress hardening: PHP_DISABLE_FUNCTIONS is empty, OPcache revalidates timestamps, and git and npm are installed.

2. wordpress-dev races wordpress. wordpress-dev is FROM …-frankenphp-wordpress, but it built in the same matrix as wordpress, so it always built on the previously published wordpress image. Combined with (1), that kept recycling old images.

A failed arch leg also used to publish a single-arch manifest silently, because the glob just matched whatever artifacts existed.

What

  • Exact digest downloads: each merge job (base, dependent, wordpress-dev) downloads …-amd64 and …-arm64 by exact artifact name, then requires exactly two digests before imagetools create. A failed leg now fails the merge and leaves the previous tag in place.
  • Separate wordpress-dev stage: build-frankenphp-wordpress-dev and merge-frankenphp-wordpress-dev run after merge-frankenphp-dependent.
  • Pinned parents: every derived build pins its FROM to the parent image published for this commit, using a build-contexts mapping from the floating tag (and its -latest form, which 8.5's Dockerfiles use) to the parent's -<sha> tag. If no run at this commit published the parent, the child fails instead of building on a stale image. The tag is per commit, not per run, so a later run at the same commit can still build on an earlier run's parent. Those runs use the same Dockerfiles, so that's acceptable. The parent always rebuilds when the child does, because changed_files is a single string, so contains(…, 'php/<v>/frankenphp/Dockerfile') also matches Dockerfile.*.

Testing

  • actionlint reports no errors. The only new shellcheck note is informational (ls | wc -l on hex-named digest files).
  • Locally with buildx, the build-contexts override of a full ghcr.io/aliasproject/php:<tag> reference replaces the FROM, an unused mapping is ignored, and a missing -<sha> tag fails the build ("not found").
  • The workflow itself can only run on main. The first real run is the post-merge dispatch below.

After merging

Run Build and Push Docker Images on main with build_php_82–build_php_85. That republishes every frankenphp tag for 8.2–8.5 correctly. Then check that each -wordpress / -wordpress-dev index has exactly two platform manifests reporting the patched PHP.

Separately, pecl.php.net has been returning intermittent HTTP 500s today, which failed several wordpress legs. If a leg fails on that, re-run the failed jobs.

merge-frankenphp-dependent downloaded each variant's per-arch digests
with the glob digest-fpdep-<ver>-<variant>-*. For wordpress that also
matched wordpress-dev's artifacts, so since 05833ad every
<ver>-frankenphp-wordpress tag listed four images: its own two plus
wordpress-dev's. Which one a host pulled depended on manifest order,
so production pulls could get the dev image (no disable_functions,
timestamp revalidation, git/npm), and on stale parents an old PHP.

wordpress-dev also built in the same matrix as wordpress, which it is
FROM, so it always built on the previously published -wordpress.

- Download each arch's digest by exact artifact name and require
  exactly two digests before creating the manifest, so a failed arch
  leg fails the merge instead of publishing a single-arch tag.
- Move wordpress-dev into its own build/merge stage after
  merge-frankenphp-dependent.
- Pin every derived build's FROM to the parent this run pushed, via a
  build context mapped to the parent's -<sha> tag. If the parent didn't
  publish, the child fails instead of building on the stale image.
merge-frankenphp-base still globbed digest-fpbase-<ver>-* with no
count check, so a failed base arch leg published a single-arch
<ver>-frankenphp tag. Download both arches by name and require two
digests, as the dependent merges now do.

Also correct the build-contexts comment: the -<sha> tag is per
commit, not per run, so a later run at the same commit can build on
an earlier run's parent.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Review round 1 (one round, matching #7)

A fresh-context reviewer read the workflow and tested build-contexts with buildx. It confirmed that:

  • the old glob matched the wordpress-dev artifacts;
  • every child's rebuild condition implies its parent's, on both the force_* and push paths;
  • the full-ref build-context override works, and a missing -<sha> tag fails the build;
  • download-artifact by name: puts bare digest files straight into the path;
  • versions that aren't being rebuilt skip every step cleanly;
  • the cache scopes and summary job are correct.
# Sev Finding Outcome
1 P2 merge-frankenphp-base still globbed with no count check, so a failed base arch leg publishes a single-arch base tag Fixed in the latest commit: exact-name downloads plus the two-digest check, the same as the other merges.
2 P3 The -<sha> tag is per commit, not per run, so a second run at the same commit can build a child on an earlier run's parent Comment and PR description corrected. Declined per-run pinning: those runs build the same Dockerfiles, and a per-run tag would add a registry tag on every run.

actionlint reports no errors after the fix. Per the one-round limit, the fix wasn't sent for a second review.

Dockerfile.wordpress-dev is only ever FROM <ver>-frankenphp-wordpress,
so the -latest mapping (and the comment explaining it) was unused, and
the wordpress-dev merge carried the wordpress-glob history comment that
only applies to the dependent merge.
@michaelaguiar

Copy link
Copy Markdown
Member Author

Round 1 addendum

The reviewer's code-review run finished late and added the following:

  • Same-commit parent reuse, re-rated to P2: still declined. If a later run at the same commit fails its base, the floating <ver>-frankenphp tag still points at the same earlier-run base the children would build on. So the republished children stay consistent with the published base, and nothing regresses to an unpatched image. The newer upstream simply isn't picked up until a run succeeds. A per-run hand-off tag would add a registry tag on every run for little benefit.
  • Unused -wordpress-latest mapping in the wordpress-dev build, and the wordpress-glob comment repeated in the wordpress-dev merge: fixed in the latest commit.
  • The reviewer checked and rejected the skill's other findings: the post-merge dispatch is already documented, and the rest were harmless, pre-existing or style.

@michaelaguiar
michaelaguiar marked this pull request as ready for review October 21, 2026 16:14
@michaelaguiar
michaelaguiar merged commit 64de9ef into main Oct 21, 2026
2 checks passed
@michaelaguiar
michaelaguiar deleted the fix-frankenphp-variant-manifests branch October 21, 2026 17:19
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