diff --git a/docs/release-flow.md b/docs/release-flow.md index f494bf538..f1015a31f 100644 --- a/docs/release-flow.md +++ b/docs/release-flow.md @@ -143,7 +143,7 @@ runs the game: GitHub's runners have neither a GPU worth the name nor the game f `tools/release_train.py notes` writes them from the same pull requests: -- the title, `Horizon 2026.10.15.1: `, features first, newest first; +- the title, `Horizon 2026.10.15.01: ` (a day's later releases count .01, .02…, two digits so GitHub's releases page, which sorts them as text, keeps them in order), features first, newest first; - `### New` (label `feature`) and `### Fixed` (the rest), one line per pull request: its title, its number, the issues it closes; - `### Known issues`: the bullets of [docs/known-issues.md](known-issues.md); @@ -177,7 +177,7 @@ While paused, runs still decide and say why in their summary; `force=true` still A bad release is withdrawn by turning it back into a draft: ```sh -gh release edit v2026.10.15.1 --draft +gh release edit v2026.10.15.01 --draft ``` Launchers list only published releases: the previous version becomes the newest one again, launchers that diff --git a/tests/test_release_train.py b/tests/test_release_train.py index fef887f3c..1240334b0 100644 --- a/tests/test_release_train.py +++ b/tests/test_release_train.py @@ -39,8 +39,13 @@ class ReleaseTrainTests(unittest.TestCase): def test_game_tags_count_up_within_a_day(self): today = dt.date(2026, 10, 15) self.assertEqual(train.next_game_tag(["v2026.10.14", "launcher-v0.1.4"], today), "v2026.10.15") - self.assertEqual(train.next_game_tag(["v2026.10.15"], today), "v2026.10.15.1") - self.assertEqual(train.next_game_tag(["v2026.10.15", "v2026.10.15.1", "v2026.10.15.2"], today), "v2026.10.15.3") + self.assertEqual(train.next_game_tag(["v2026.10.15"], today), "v2026.10.15.01") + self.assertEqual(train.next_game_tag(["v2026.10.15", "v2026.10.15.01", "v2026.10.15.02"], today), "v2026.10.15.03") + # Unpadded tags from before the change still count, and the next one sorts after them as text too. + self.assertEqual(train.next_game_tag(["v2026.10.15", "v2026.10.15.9", "v2026.10.15.20"], today), "v2026.10.15.21") + self.assertEqual(train.next_game_tag(["v2026.10.15", "v2026.10.15.08"], today), "v2026.10.15.09") + tags = ["v2026.10.15.09", "v2026.10.15.10", "v2026.10.15"] + self.assertEqual(sorted(tags), sorted(tags, key=train.tag_key)) def test_launcher_tags_bump_the_patch_or_the_minor(self): tags = ["launcher-v0.1.3", "launcher-v0.1.10", "v2026.10.15", "launcher-v0.1.4"] diff --git a/tools/release_train.py b/tools/release_train.py index c74b46b76..a1af28449 100644 --- a/tools/release_train.py +++ b/tools/release_train.py @@ -11,7 +11,7 @@ of merges becomes one release), or the oldest at least MAX_WAIT ago (merges that of those pull requests is labelled release-now. Pull requests labelled skip-release (work players don't see) don't count towards a release and aren't listed in the notes. RELEASES_PAUSED=1 (a repository variable) stops automatic releases. -Game releases are tagged vYYYY.MM.DD, then .1, .2 the same UTC day; launcher releases launcher-vX.Y.Z, the +Game releases are tagged vYYYY.MM.DD, then .01, .02 the same UTC day; launcher releases launcher-vX.Y.Z, the patch after the last launcher tag, or the next minor when a merged pull request is labelled feature. Notes: "### New" lists the pull requests labelled feature, "### Fixed" the others, "### Known issues" the bullets of docs/known-issues.md. See docs/release-flow.md. @@ -92,12 +92,15 @@ def tag_key(tag): def next_game_tag(tags, today): - """vYYYY.MM.DD, or .1, .2... when that day already has a tag (drafts and rolled-back releases included).""" + """vYYYY.MM.DD, or .01, .02... when that day already has a tag (drafts and rolled-back releases included). + + The counter has two digits because GitHub's releases page sorts a day's tags as text: .9 went above .18. + Every reader compares the numbers as integers, so the unpadded tags from before still order correctly.""" day = f"v{today:%Y.%m.%d}" taken = [tag for tag in tags if tag == day or tag.startswith(day + ".")] if not taken: return day - return f"{day}.{max(int(tag.split('.')[3]) if tag.count('.') == 3 else 0 for tag in taken) + 1}" + return f"{day}.{max(int(tag.split('.')[3]) if tag.count('.') == 3 else 0 for tag in taken) + 1:02d}" def next_launcher_tag(tags, minor):