Build the full-stack image once at RC time, so GA can promote it - #159
Merged
Conversation
simplerisk/generate_dockerfile.sh branched its recipe on the literal string "testing", so a context-sourced build could only ever stamp `ENV version=testing`. That is the one thing standing between the full-stack image and the build-once-promote model: the RC has to carry a real version to be promotable at GA. Add the same (version, source_mode) split simplerisk-minimal already has: `context` COPYs the app from the build context, `download` emits the hash-verifying downloader stage. The default preserves back-compat exactly -- a bare "testing" still selects context, a bare version still selects download. Also restore --fail on the schema fetch (present on master, lost on testing). Without it curl writes the 404 body into /simplerisk.sql and the image ships an HTML error page as its schema. Adds test_generate_dockerfile.sh mirroring the minimal harness: 14 checks over both modes, both back-compat paths, invalid-mode rejection and idempotence. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…nimal GA promotes digests rather than rebuilding, so every image it promotes has to exist as an RC. simplerisk/simplerisk had no RC build at all -- it was only ever built on master from the prod bundle, which is exactly the rebuild the promote model removes. Add a publish-full job tagging <VERSION>-jammy/-noble, bare <VERSION> (= noble, the default) and :testing, amd64-only to match what the release build published before. No SSM tier: the full-stack image is not part of the managed fleet. Hoist version resolution into a shared resolve job so both publish jobs stamp the same release even if the testing channel rotates mid-run, and have each fetch that exact bundle by name rather than re-listing the channel. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The generators are now load-bearing for the release path -- context mode has to stamp a real ENV version, download mode has to keep the hash-verifying downloader stage -- but neither harness was wired into CI. Run both on PRs, and fail if either leaves a committed Dockerfile modified. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prerequisite for the GA promote cutover (
FEATURE-ga-promote-cutover→master). That PR makes GA a promote of an existing RC digest rather than a rebuild. Forsimplerisk/simplerisk-minimalthe RC already exists; for the full-stacksimplerisk/simpleriskimage it does not — that image has only ever been built onmasterfrom the prod bundle. This PR gives it an RC build so there is something to promote.Three changes:
1.
simplerisk/generate_dockerfile.sh— decouple version from source-mode.The generator branched its recipe on the literal string
testing, so a context-sourced build could only ever stampENV version=testing. That single coupling is what kept the full-stack image out of the build-once model — an RC has to carry a real version to be promotable. Adds the same(version, source_mode)splitsimplerisk-minimalalready has:contextCOPYs the app from the build context,downloademits the hash-verifying downloader stage. Defaults preserve back-compat exactly — a baretestingstill selects context, a bare version still selects download.Also restores
--failon the schema fetch. It is present onmaster(commit6351391) but absent ontesting; without it curl writes the 404 body into/simplerisk.sqland the image ships an HTML error page as its database schema.2.
publish-testing.yml— build the full-stack RC alongside the minimal one.New
publish-fulljob tagging<VERSION>-jammy,<VERSION>-noble, bare<VERSION>(= noble, the default) and:testing. amd64-only, matching what the release build published before. No SSM tier — the full-stack image is not part of the managed fleet.Version resolution is hoisted into a shared
resolvejob so both publish jobs stamp the same release even if the testing channel rotates mid-run, and each now fetches that exact bundle by name instead of re-listing the channel.3.
container-validation.yml— pin both generators.The generators are now load-bearing for the release path, but neither harness ran in CI. Adds a
generator_checksjob running both, plus a guard that fails if a harness leaves a committed Dockerfile modified.Release Notes
No customer-facing change. Container build/release plumbing only.
Manual Validation Steps
./simplerisk/test_generate_dockerfile.sh→ 14 checks, allok, exit 0../simplerisk-minimal/test_generate_dockerfile.sh→ still green (unchanged)../simplerisk/generate_dockerfile.sh 20260519-001→ regenerates the committed Dockerfile with only the intended-fsSLchange; no structural drift../simplerisk/generate_dockerfile.sh <V> context→ noFROM alpine/curlstage,ENV version=<V>,COPY ./simplerisk/ /var/www/simplerisk../simplerisk/generate_dockerfile.sh <V> bogus→ exits 1 withInvalid source mode.testingshould publishsimplerisk/simplerisk:<VERSION>-jammy,-noble, bare<VERSION>and move:testing.Type of Change
--failon the schema fetch)Testing Results
shellcheckclean at all severities on both changed/added scripts (CI gates aterror). One deliberateSC2016suppression where$DB_LANGmust stay literal — it is a Dockerfile ARG.actionlintclean onpublish-testing.ymlandcontainer-validation.yml.resolve→ (publish,publish-full).testing. The first post-merge testing push is the real test.CIA Impact Check
WILL NOT negatively impact Confidentiality, Integrity or Availability.
The bundle hash verification, the fail-closed download path, and the published tag set for
simplerisk-minimalare all unchanged. The full-stack image gains RC tags it did not previously have; no existing tag changes meaning. The--failrestoration is a net integrity improvement — it prevents an image shipping an HTML error page as its schema.