From 65a717abb01951eaf6c0579f5061522c4ece3257 Mon Sep 17 00:00:00 2001 From: Gavin Ying Date: Thu, 12 Nov 2026 12:22:56 +0800 Subject: [PATCH] fix: expect the snapshot replay job in the release guard and release 2.0.0a8 (SIM-05) The preview guard compared main.yml jobs with a fixed set that lacked the new "modpoll snapshot replay" job, so v2.0.0a7 failed before publishing. Tags and versions are immutable, so the same changes ship as 2.0.0a8; the preview notes say v2.0.0a7 was never published. The guard test now restores the removed job instead of assuming tox (3.14) is last. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/preview-release.py | 7 ++++++- docs/preview-notes.md | 9 ++++++--- modsim/__init__.py | 2 +- pyproject.toml | 2 +- tests/test_preview_guard.py | 12 +++++++++--- uv.lock | 2 +- 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/scripts/preview-release.py b/.github/scripts/preview-release.py index b83cfb1..98ea441 100644 --- a/.github/scripts/preview-release.py +++ b/.github/scripts/preview-release.py @@ -37,7 +37,12 @@ def guard(tag): sha = subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip() subprocess.run(["git", "merge-base", "--is-ancestor", sha, "origin/v2"], check=True) repo = os.environ["GITHUB_REPOSITORY"] - require_ci(repo, sha, "main.yml", {"quality", "docs", "tox (3.10)", "tox (3.14)"}) + require_ci( + repo, + sha, + "main.yml", + {"quality", "docs", "tox (3.10)", "tox (3.14)", "modpoll snapshot replay"}, + ) require_ci( repo, sha, diff --git a/docs/preview-notes.md b/docs/preview-notes.md index 0f78e74..8e39c7a 100644 --- a/docs/preview-notes.md +++ b/docs/preview-notes.md @@ -1,6 +1,6 @@ -# Modsim 2.0.0a7 preview +# Modsim 2.0.0a8 preview -Modsim 2.0.0a7 loads [simulation data](https://github.com/top-maker/modpoll-wot/blob/main/profile.md#simulation-data) +Modsim 2.0.0a8 loads [simulation data](https://github.com/top-maker/modpoll-wot/blob/main/profile.md#simulation-data) with `--data` and pins modpoll-wot 0.4.0a1. This preview breaks the previous command line: @@ -15,7 +15,7 @@ command line: ```sh uvx --prerelease allow modpoll==2.0.0a6 --config device.tm.json --tcp 192.168.1.10 --once --export snapshot.json -uvx --prerelease allow modsim==2.0.0a7 --config device.tm.json --data snapshot.json +uvx --prerelease allow modsim==2.0.0a8 --config device.tm.json --data snapshot.json ``` Scaled values that modpoll exports, such as `230.10000000000002` for a raw @@ -23,6 +23,9 @@ Scaled values that modpoll exports, such as `230.10000000000002` for a raw could not read keep their defaults and are listed at startup. Snapshots hold readings of a real device: keep them on your computer. +The `v2.0.0a7` tag points at the same changes but was never published: its +release guard did not yet expect the new snapshot replay CI job. + ### Previous preview #### Modsim 2.0.0a6 diff --git a/modsim/__init__.py b/modsim/__init__.py index 8fd977a..f6d4bb4 100644 --- a/modsim/__init__.py +++ b/modsim/__init__.py @@ -1 +1 @@ -__version__ = "2.0.0a7" +__version__ = "2.0.0a8" diff --git a/pyproject.toml b/pyproject.toml index 57540e6..7440539 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "modsim" -version = "2.0.0a7" +version = "2.0.0a8" description = "A Simple Modbus TCP Device Simulator used for modpoll tool" authors = [{ name = "Ying Shaodong", email = "helloysd@gmail.com" }] readme = "README.md" diff --git a/tests/test_preview_guard.py b/tests/test_preview_guard.py index c7249c1..9c48614 100644 --- a/tests/test_preview_guard.py +++ b/tests/test_preview_guard.py @@ -19,7 +19,13 @@ def test_guard_requires_all_current_ci_jobs(monkeypatch): monkeypatch.setattr(release.subprocess, "run", lambda *a, **kw: None) jobs = [ {"name": name, "conclusion": "success"} - for name in ("quality", "docs", "tox (3.10)", "tox (3.14)") + for name in ( + "quality", + "docs", + "tox (3.10)", + "tox (3.14)", + "modpoll snapshot replay", + ) ] platform_jobs = [ @@ -54,10 +60,10 @@ def output(args, **kwargs): monkeypatch.setattr(release.subprocess, "check_output", output) release.guard("v" + __import__("modsim").__version__) - jobs.pop() + removed = jobs.pop() with pytest.raises(ValueError, match="expected CI jobs"): release.guard("v" + __import__("modsim").__version__) - jobs.append({"name": "tox (3.14)", "conclusion": "failure"}) + jobs.append({**removed, "conclusion": "failure"}) with pytest.raises(ValueError, match="expected CI jobs"): release.guard("v" + __import__("modsim").__version__) diff --git a/uv.lock b/uv.lock index 36affca..af86577 100644 --- a/uv.lock +++ b/uv.lock @@ -842,7 +842,7 @@ wheels = [ [[package]] name = "modsim" -version = "2.0.0a7" +version = "2.0.0a8" source = { editable = "." } dependencies = [ { name = "jsonschema", marker = "python_full_version < '3.15'" },