Files
f1-circuits/merge-check.sh
T
jschoubben 82a0efabbc Fail the merge check on a point trace for a current race
Madring's point trace reached the 2026 poster unnoticed: nothing held that a layout a race draws
has a traced line. tests/test_traces.py takes every layout the service picks for a season from
2020 to next season (find_layout_slug_for_year over circuits.json, the data the posters draw
from) and fails each whose trace is not a LineString of more than ten points. On master it fails
on spain/madrid/madring/2026- alone; here it passes for all 35.

Builds: docs/posters.md at 8834df45e6 (Layers: no current race draws a layout without a traced line)

Claude-Session: https://claude.ai/code/session_01JG73KFhbaNj3tyJ8tKmE3W
2026-11-30 10:20:48 +01:00

31 lines
1.9 KiB
Bash

#!/bin/sh
# mesh-check-toolchain: go
#
# f1-circuits' own check (novox/hq ADR 0237): the second layer of a pull request's merge check,
# `mesh/repo-check`, run by the build seat in the mesh's Go toolchain, which carries Python for the merge
# checks that need it. The gate — the manifest through the controller the mesh runs, every machine
# composed with it — is the build seat's first layer (`mesh/merge-gate`), run because the mesh's module
# graph builds f1-circuits from this branch.
#
# What the image ships, compiled before the merge: every Python file the service's image copies, and the
# models it imports. Then the tests in tests/, which need the standard library only: every circuit in
# circuits/circuits.json carries one unique ergastId, and a race's circuit resolves by that id, never by
# its name; every layout a race from 2020 on draws has a traced line, never a point; a failed Jolpica
# fetch is never kept, a season that is over is read from disk, a throttled request is asked again; a poster's options, keys, cache headers and store cap, its satellite source, credits and
# licence (poster_options.py and poster_sources.py, standard library only).
#
# **Said, never passed silently**: the service's dependencies (service/requirements.txt) are the image's to
# install, so the service is not started.
set -eu
# Parsed, not compiled to files: a check leaves the tree as it found it.
find cdn-api.py access_log.py app_info.py circuits_service.py ergast_service.py posters_service.py poster_options.py \
poster_sources.py models -name '*.py' -print0 |
xargs -0 python3 -c 'import ast, sys
for f in sys.argv[1:]:
ast.parse(open(f, encoding="utf-8").read(), f)
print(len(sys.argv) - 1, "Python file(s) parse")'
# -B: no bytecode written, the tree stays as it was found.
python3 -B -m unittest discover -s tests -t .
echo "NOT RUN HERE: the service (its dependencies are the image's to install)"