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
14 changes: 8 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/<FEATURE>.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.

Expand Down
2 changes: 1 addition & 1 deletion dashboard/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions scripts/publish_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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.")
Expand Down
11 changes: 11 additions & 0 deletions tests/test_portability.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions tests/test_publish_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down
Loading