Skip to content

ci: every nginx upstream must be a container the production web role runs - #3333

Merged
colinmegill merged 4 commits into
edgefrom
ci-nginx-upstreams
Nov 4, 2026
Merged

colinmegill merged 4 commits into
edgefrom
ci-nginx-upstreams

Conversation

@colinmegill

Copy link
Copy Markdown
Member

Observable change: none in the product. A new local check, make check-nginx-upstreams, and a hosted workflow that calls it verbatim. No schema change, no nginx behaviour change, no route change; the deploy hook is read, not changed.

Why: the 2.43.0 deploy answered 502 for every static asset at the origin because nginx sent those paths to a file-server container that production web boxes never start (fixed by #3325, which sent them back through Node). Nothing would catch the same mistake again.

What it checks: every upstream host in the nginx templates and the rendered Rust route locations must be a service the production web role starts (read from the deploy hook's container-start lines and the Compose service names), or be on an explicit, commented exception list, which is empty. A failure names the upstream, the config file and the hook line.

Evidence: 23 tests; the 2.43.0 shape (the static proxy from #3302) fails naming file-server and its template; edge passes; 17 topology mutations behave as expected (pool member, direct proxy, rendered Rust map target, removed startup line, removed Compose service, and more); ordinary hook edits (a continued line, a multi-line string, a one-line helper, extra flags on the migration line) pass. Two independent review rounds; the reader's limits (includes of files that are not .conf/.template; shell constructs it cannot follow) are stated in the README and the source.

🤖 Generated with Claude Code

colinmegill and others added 4 commits November 3, 2026 18:44
…runs

The 2.43.0 deploy answered 502 for every static asset at the origin because
nginx sent those paths to a file-server container that production web boxes
never start; the hotfix sent them back through Node. Nothing would have
caught the same mistake again.

A new check, `make check-nginx-upstreams` (also called verbatim by a hosted
workflow), parses every upstream host from the nginx templates and the
rendered Rust route locations, reads the services the web role starts from
the deploy hook and the Compose file, and fails naming the upstream, the
config file and the hook line when an upstream names a service the web role
does not run. An empty, commented exception list is the only way around it.
The 2.43.0 shape fails it; edge passes. The hook reader joins continued
lines, tokenizes only the container-start lines, finishes one-line helpers,
and names a line in every error. The README states what it does not read:
includes of files that are not .conf or .template, and shell constructs it
cannot follow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…continued lines and one-line helpers

The reader matched compose only as a bare docker-compose or docker compose
followed by config, so the hook's own /usr/local/bin/docker-compose start
was neither refused nor counted, while plugin-style forms (a COMPOSE array,
a hook moved to docker compose, command -v) were refused. It now matches the
executable's basename, skips the global options before the subcommand, and
accepts config or no subcommand. It also stops a comment's trailing
backslash from swallowing the next line, closes one-line helper functions
(including those ending in "& }"), refuses direct docker compose starts,
reviews docker by absolute path, parses spaced and function-keyword
declarations, and names the line in every error, including the ROLE_IMAGES
one. Six fixture groups cover these; the 2.43.0 shape still fails naming
file-server and its template.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The only conflict was the Makefile: edge added five local check targets at
the same place this branch adds check-nginx-upstreams; both sets are kept.
The only conflict was the Makefile again: edge added check-client-errors at
the place this branch adds check-nginx-upstreams; both are kept.
@colinmegill
colinmegill merged commit ee47730 into edge Nov 4, 2026
58 of 61 checks passed
@colinmegill
colinmegill deleted the ci-nginx-upstreams branch November 4, 2026 23:55
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