Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions preview-service/container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
# was Factorio 2.1.14 against a pin that meant 2.1.12, and only the assertion
# below stood between it and production.
#
# With the tag present, Renovate tracks `2.1.16` and can only ever re-pin THAT
# With the tag present, Renovate tracks `2.1.17` and can only ever re-pin THAT
# tag's digest, so a silent version jump is impossible by construction rather
# than merely detectable. Moving to a new Factorio is then a deliberate edit of
# the tag, the digest and the assertion together - which
# test/dockerfile.test.mjs checks stay in agreement.
#
# Refresh the digest for a tag with:
# docker pull --platform linux/amd64 factoriotools/factorio:2.1.16
# docker inspect --format='{{index .RepoDigests 0}}' factoriotools/factorio:2.1.16
FROM factoriotools/factorio:2.1.16@sha256:f96d574869b633a849cc68d500ad066bd0eb55228e5b4f00047baf7cf5bc8ed9
# docker pull --platform linux/amd64 factoriotools/factorio:2.1.17
# docker inspect --format='{{index .RepoDigests 0}}' factoriotools/factorio:2.1.17
FROM factoriotools/factorio:2.1.17@sha256:e9227748c507a52f97bbd42c88e5c73702297bbdf4322c2f3ca8a71676ec1222

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: the in-build version assertion further down this file wasn't bumped with this tag.

This line now pins 2.1.17, but line 27 still asserts Version: 2.1.16:

RUN /opt/factorio/bin/x64/factorio --version | grep -q "Version: 2.1.16"

That makes dockerfile.test.mjs's "the FROM tag and the in-build version assertion name the same version" test fail deterministically ("the FROM tag (2.1.17) and the version assertion (2.1.16) disagree"), which runs inside preview:test — part of the required verify check. If the image were ever actually built, this RUN would also fail directly, since the 2.1.17 base image reports Version: 2.1.17.

Per CLAUDE.md, the tag and this assertion must move together, and the PR's own description states this must be updated "in the same commit" for a tag change. Line 27 needs Version: 2.1.17.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: the worker's FACTORIO_VERSION wasn't bumped along with this tag.

preview-service/worker/wrangler.jsonc#L7 still declares "FACTORIO_VERSION": "2.1.16" and is untouched by this PR. That makes dockerfile.test.mjs's "the worker's FACTORIO_VERSION matches the image the container actually runs" test fail deterministically, also blocking preview:test — part of the required verify check.

Beyond the test failure, that test's own comment explains this variable feeds the R2 cache key, so a real mismatch would silently mix renders from two different Factorio versions under one cache key — the same regression recorded as having actually happened on the 2.1.14 bump. See the pinning convention in CLAUDE.md.

Fixing this needs FACTORIO_VERSION bumped to 2.1.17 in wrangler.jsonc and pnpm run types:sync run afterward to regenerate worker-configuration.d.ts (which wrangler types --check also gates on inside preview:test).


# Node for the HTTP wrapper (base image is Debian-based).
USER root
RUN apt-get update && apt-get install -y --no-install-recommends nodejs && rm -rf /var/lib/apt/lists/*

# Fail fast if the pinned Factorio is not 2.1.16. This runs only at image BUILD
# Fail fast if the pinned Factorio is not 2.1.17. This runs only at image BUILD
# time, which no PR does (#183) - so it is the last line of defence, not the
# first. Keep it in step with the FROM tag above.
RUN /opt/factorio/bin/x64/factorio --version | grep -q "Version: 2.1.16"
RUN /opt/factorio/bin/x64/factorio --version | grep -q "Version: 2.1.17"

WORKDIR /app
COPY render.mjs server.mjs ./
Expand Down
4 changes: 2 additions & 2 deletions preview-service/worker/worker-configuration.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types` (hash: b7bebf05356e1de341cb5b68ffc140cf)
// Generated by Wrangler by running `wrangler types` (hash: 2bc045439fda175885fb82da314ab30d)
// Runtime types generated with workerd@1.20260815.1 2026-07-01 nodejs_compat
interface __BaseEnv_Env {
PREVIEW_CACHE: R2Bucket;
FACTORIO_VERSION: "2.1.16";
FACTORIO_VERSION: "2.1.17";
MONTHLY_RENDER_BUDGET: "5000";
ALLOWED_ORIGIN: "https://map.factorygamefan.com";
PREVIEW_CONTAINER: DurableObjectNamespace<import("./src/index").PreviewContainer>;
Expand Down
2 changes: 1 addition & 1 deletion preview-service/worker/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"compatibility_date": "2026-07-01",
"compatibility_flags": ["nodejs_compat"],
"vars": {
"FACTORIO_VERSION": "2.1.16",
"FACTORIO_VERSION": "2.1.17",
"MONTHLY_RENDER_BUDGET": "5000",
"ALLOWED_ORIGIN": "https://map.factorygamefan.com",
},
Expand Down