diff --git a/AGENTS.md b/AGENTS.md index 6ced32c..01bfdc8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,10 +21,10 @@ Many features span both repos. The app's side of each route lives in the app rep - **Releases are batched, and the maintainer starts them.** - Pull requests don't change the version. Merged changes collect on `main`, which must stay releasable. - - When the maintainer decides to ship, a release PR bumps `plugin.yaml` and `PLUGIN_VERSION` and lists - everything since the last release. Its title leads with the version. Its description becomes the release - notes, and the app shows the first 1,500 characters on its update screen, so open with a short summary in - plain words for people who run hosts. Credit outside contributors. + - When the maintainer decides to ship, a release PR bumps `plugin.yaml`, `PLUGIN_VERSION` and + `dashboard/manifest.json` and lists everything since the last release. Its title leads with the version. Its + description becomes the release notes, and the app shows the first 1,500 characters on its update screen, so + open with a short summary in plain words for people who run hosts. Credit outside contributors. - After it merges, the maintainer runs the Release workflow (`gh workflow run release.yml`). It publishes the version from the release PR's merge; anything merged later waits for the next release. - The bighelp app offers the latest release to every host, and `hermes bighelp update` installs it. No app @@ -119,8 +119,10 @@ shared through one `sys.modules` entry (see `sys.modules.setdefault(...)` in `ma - Add it to `PROCESS_FEATURES` in `tests/test_native_startup_logging.py`. - Add unit tests for the module itself. 4. **Docs:** add `docs/.md` with the full route contract, and a row in the README feature table. -5. **Version:** leave it alone. The next release PR bumps `plugin.yaml` and `PLUGIN_VERSION` in - `loopdy_plugin/link_contracts.py` together; `tests/test_portability.py` checks that they match. +5. **Version:** leave it alone. The next release PR bumps `plugin.yaml`, `PLUGIN_VERSION` in + `loopdy_plugin/link_contracts.py` and `dashboard/manifest.json` together (the Hermes dashboard shows the + last one). `tests/test_portability.py` checks that they match, and the Release workflow refuses to publish if + they don't. 6. **After the release:** the app offers the new version to hosts. The app adds its side of the route in its own release. diff --git a/dashboard/manifest.json b/dashboard/manifest.json index 5e00df5..9464324 100644 --- a/dashboard/manifest.json +++ b/dashboard/manifest.json @@ -3,7 +3,7 @@ "label": "bighelp", "description": "The bighelp app's routes on this Hermes host: native features, notifications and approvals.", "icon": "MessageSquare", - "version": "2.8.0", + "version": "3.1.0", "tab": { "path": "/bighelp", "position": "end", diff --git a/scripts/publish_release.py b/scripts/publish_release.py index 3cb9243..b9ff737 100644 --- a/scripts/publish_release.py +++ b/scripts/publish_release.py @@ -30,6 +30,13 @@ def plugin_version(root: Path = ROOT) -> str: return manifest_version((root / "plugin.yaml").read_text(encoding="utf-8")) +def check_dashboard_version(version: str, root: Path = ROOT) -> None: + """Hermes' dashboard shows dashboard/manifest.json's version, so it must match plugin.yaml.""" + dashboard = json.loads((root / "dashboard" / "manifest.json").read_text(encoding="utf-8")).get("version") + if dashboard != version: + raise SystemExit(f"dashboard/manifest.json says {dashboard}, but plugin.yaml says {version}") + + def version_key(version: str) -> tuple[int, ...]: parts = [int(part) for part in version.split(".")] return tuple(parts + [0] * (4 - len(parts))) @@ -66,6 +73,7 @@ def _gh(*args: str, check: bool = True) -> subprocess.CompletedProcess: def main() -> int: repository = os.environ["GITHUB_REPOSITORY"] version = plugin_version() + check_dashboard_version(version) tag = f"v{version}" if _gh("release", "view", tag, "--repo", repository, check=False).returncode == 0: print(f"{tag} is already released; nothing to publish.") diff --git a/tests/test_portability.py b/tests/test_portability.py index 26edf2d..731a2e3 100644 --- a/tests/test_portability.py +++ b/tests/test_portability.py @@ -23,6 +23,17 @@ def test_manifest_explicitly_supports_all_hermes_desktop_operating_systems(self) self.assertEqual(manifest["version"], PLUGIN_VERSION) self.assertEqual(set(manifest["platforms"]), {"linux", "macos", "windows"}) + def test_dashboard_manifest_reports_the_plugin_version(self) -> None: + # Hermes' dashboard shows this file's version, not plugin.yaml's, so a release must bump both. + import json + + import yaml + + manifest = yaml.safe_load((PLUGIN_ROOT / "plugin.yaml").read_text(encoding="utf-8")) + dashboard = json.loads((PLUGIN_ROOT / "dashboard" / "manifest.json").read_text(encoding="utf-8")) + + self.assertEqual(dashboard["version"], manifest["version"]) + def test_link_runtime_coordinates_never_depend_on_posix_path_syntax(self) -> None: from loopdy_plugin import adapter diff --git a/tests/test_publish_release.py b/tests/test_publish_release.py index 3c11e80..cd449f3 100644 --- a/tests/test_publish_release.py +++ b/tests/test_publish_release.py @@ -22,6 +22,16 @@ def test_it_publishes_the_manifest_version(self): with self.assertRaises(SystemExit): publish_release.plugin_version(root) + def test_it_refuses_a_stale_dashboard_version(self): + publish_release.check_dashboard_version(PLUGIN_VERSION) + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / "dashboard").mkdir() + (root / "dashboard" / "manifest.json").write_text('{"version": "2.8.0"}', encoding="utf-8") + with self.assertRaises(SystemExit): + publish_release.check_dashboard_version("3.1.0", root) + publish_release.check_dashboard_version("2.8.0", root) + def test_notes_come_from_the_release_pull_request(self): notes = publish_release.release_notes({"title": "3.0.0: bighelp names", "body": "What changed."}, "commit") self.assertEqual(notes, "## 3.0.0: bighelp names\n\nWhat changed.")