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: 10 additions & 2 deletions .github/maven-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@ Start a new run with the recorded CurseForge file ID so it verifies that upload
without submitting the jar again. The release workflow sets Java 8 through
Minecraft 1.16.5, Java 16 for Minecraft 1.17.1, and Java 17 for Minecraft 1.18.2
through 1.20.1, Java 21 for Minecraft 1.20.6, 1.21.1 and 1.21.11, and Java 25
for Minecraft 26.1.2 and 26.2. The pure target helper in verify.py uses an
explicit whitelist; unqualified targets, including 26.3, are rejected.
for Minecraft 26.1.2, 26.2 and 26.3. The pure target helper in verify.py uses an
explicit whitelist; unqualified or malformed targets, including 26.4 and
26.3.0, are rejected.

The dispatcher runs its offline tests before staging an artifact. Release
records still require the actual merged source, successful version-branch CI
run, artifact ID and checksums. A prepared route is not an approved release
record and does not publish anything.

The 26.3 route is prepared locally after manual acceptance of the exact
candidate. It adds no approved 26.3 release entry. Wait for verified public
Power and companion pins, the exact upstream merge, every required check
including CodeQL, the matching tag and sealed CI artifact before recording
the release. Run check-only first; live publication also requires the
coordinator's explicit Steam gate. Resume an accepted CurseForge file ID.

The GitHub release targets the exact version-branch source recorded in
`releases.json`, not the publication workflow's default branch.

Expand Down
34 changes: 32 additions & 2 deletions .github/maven-release/test_verify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import contextlib
import inspect
import io
import json
from pathlib import Path
import re
import unittest
Expand All @@ -16,19 +17,38 @@ def test_released_minecraft_lines_keep_their_runtime(self):
16: ("1.17.1",),
17: ("1.18.2", "1.19.4", "1.20.1"),
21: ("1.20.6", "1.21.1", "1.21.11"),
25: ("26.1.2", "26.2"),
25: ("26.1.2", "26.2", "26.3"),
}.items():
for version in versions:
with self.subTest(version=version):
self.assertEqual((version, f"Java {java}"), verify.release_target(f"master-{version}"))

def test_unqualified_or_malformed_targets_are_rejected(self):
for branch in ("master-26.3", "master-26.2.0", "master-26.1.1", "master-26.1.3",
for branch in ("master-26.4", "master-26.3.0", "master-26.2.0", "master-26.1.1", "master-26.1.3",
"master-1.21.12", "master-26.1.2-extra", "feature/26.1.2",
"26.1.2", "master-main", "master-26.1.2\n"):
with self.subTest(branch=branch), self.assertRaises(ValueError):
verify.release_target(branch)

def test_263_route_does_not_approve_an_unlisted_release(self):
with patch.object(verify.sys, "argv", ["verify.py", "target", "0.0.0.2603001", "unused"]), \
self.assertRaisesRegex(ValueError, "Version is not approved"):
verify.main()

def test_263_target_cli_has_no_network_or_publication_side_effects(self):
output = io.StringIO()
manifest = {"releases": {"2.2.19.2603001": {"branch": "master-26.3"}}}
with patch.object(verify.sys, "argv", ["verify.py", "target", "2.2.19.2603001", "unused"]), \
patch.object(verify, "MANIFEST") as source, \
patch.object(verify, "github") as github, patch.object(verify, "read_url") as read_url, \
patch.object(verify, "stage") as stage, contextlib.redirect_stdout(output):
source.read_text.return_value = json.dumps(manifest)
verify.main()
self.assertEqual("minecraft=26.3\njava=Java 25\n", output.getvalue())
github.assert_not_called()
read_url.assert_not_called()
stage.assert_not_called()

def test_missing_java25_entry_is_rejected(self):
source = inspect.getsource(verify.release_target)
marker = '"26.1.2": 25'
Expand All @@ -39,6 +59,16 @@ def test_missing_java25_entry_is_rejected(self):
with self.assertRaisesRegex(ValueError, "Unsupported Minecraft version"):
namespace["release_target"]("master-26.1.2")

def test_missing_263_entry_does_not_fall_back_to_an_older_runtime(self):
source = inspect.getsource(verify.release_target)
marker = '"26.3": 25,'
self.assertIn(marker, source)
namespace = {"require": verify.require}
exec(compile(source.replace(marker, ""), "<missing-263-control>", "exec"), namespace)
with self.assertRaisesRegex(ValueError, "Unsupported Minecraft version"):
namespace["release_target"]("master-26.3")
self.assertEqual(("26.2", "Java 25"), namespace["release_target"]("master-26.2"))

def test_target_cli_has_no_publication_side_effects(self):
output = io.StringIO()
with patch.object(verify.sys, "argv", ["verify.py", "target", "2.2.16.121111", "unused"]), \
Expand Down
2 changes: 1 addition & 1 deletion .github/maven-release/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def release_target(branch):
"1.10.2": 8, "1.12.2": 8, "1.13.2": 8, "1.14.4": 8,
"1.15.2": 8, "1.16.5": 8, "1.17.1": 16, "1.18.2": 17,
"1.19.4": 17, "1.20.1": 17, "1.20.6": 21, "1.21.1": 21,
"1.21.11": 21, "26.1.2": 25, "26.2": 25,
"1.21.11": 21, "26.1.2": 25, "26.2": 25, "26.3": 25,
}
require(minecraft in java_versions, f"Unsupported Minecraft version: {minecraft}")
return minecraft, f"Java {java_versions[minecraft]}"
Expand Down
Loading