One release number for the basketball site, the stream and every game
The front page, the season page, the blog and every post now end with a line like release 26.09.30.32 · engine version 76. The same
release number is on the live stream's badge, on the card it shows when it updates, and in the facts the commentators
are handed. Before, the site and the stream each said when they were built, and the engine had its own version, so
two screens could show different numbers for the same thing, and a change to the site with no change to the games
looked like nothing had shipped at all.
A date and a count
The release is YY.MM.DD.N: the day the build's source was last changed, in UTC, and how many changes
had landed that day, up to and including it. Nobody types it in. It is read from the project's own history when the
site is built:
def release(repo: Path) -> str:
day = version_stamp(repo)[:10]
counted = subprocess.run(["git", "rev-list", "--first-parent", "--count",
f"--since={day}T00:00:00Z", "HEAD"], ...)
return f"{day[2:4]}.{day[5:7]}.{day[8:10]}.{counted.stdout.strip()}"
Because it is derived, the same source always gets the same release, and a later change never alters an earlier release's number. The count starts again at midnight UTC, so the number also says roughly how busy that day was.
Two numbers, two jobs
The engine version stays beside it, because it answers a different question. The release changes whenever anything ships: a new page, a fix to the replay, a new line on the stream. The engine version changes only when the simulation itself behaves differently, when the same seed would now play out as a different game. Every game on the site regenerates exactly from its seed under the engine version it names, so that is the number that says whether two games were played by the same rules.
Checked when it ships
After every deploy, the live site is read back and its footer compared with the build that was just sent. A page still showing an older release, or no release at all, fails the deploy instead of passing it: a number that could not be read is never taken to mean the new version is live.