mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-08-27 14:17:10 -04:00
fix: make proxy upgrades version-aware
Derive source-tree versions from release history so headroom --version no longer reports stale project metadata. Restart stale idle proxies after an upgrade, but leave active sessions running to avoid interrupting ongoing conversations. Remove _version.py from version-sync ownership and make version verification catch package/plugin manifest drift.
This commit is contained in:
parent
4a88c698ad
commit
ea1f608e79
7 changed files with 399 additions and 36 deletions
|
|
@ -34,7 +34,7 @@ def temp_project(tmp_path: Path) -> dict[str, Path]:
|
|||
pyproject = root / "pyproject.toml"
|
||||
pyproject.write_text('[project]\nversion = "0.5.25"\n')
|
||||
|
||||
# headroom/_version.py
|
||||
# headroom/_version.py is runtime-derived and must not be rewritten by version-sync.
|
||||
version_py = headroom / "_version.py"
|
||||
version_py.write_text('"""Package version metadata."""\n\n__version__ = "0.5.25"\n')
|
||||
|
||||
|
|
@ -102,9 +102,9 @@ def test_version_sync_explicit_version(temp_project: dict[str, Path]) -> None:
|
|||
pyproject_content = temp_project["pyproject"].read_text()
|
||||
assert 'version = "0.7.0"' in pyproject_content
|
||||
|
||||
# Verify headroom/_version.py
|
||||
# Verify headroom/_version.py is not a synced manifest.
|
||||
version_py_content = temp_project["version_py"].read_text()
|
||||
assert '__version__ = "0.7.0"' in version_py_content
|
||||
assert '__version__ = "0.5.25"' in version_py_content
|
||||
|
||||
# Verify plugins/openclaw/package.json
|
||||
openclaw_pkg = json.loads(temp_project["openclaw_pkg"].read_text())
|
||||
|
|
@ -157,7 +157,7 @@ def test_bump_patch(temp_project: dict[str, Path]) -> None:
|
|||
assert 'version = "0.5.26"' in pyproject_content
|
||||
|
||||
version_py_content = temp_project["version_py"].read_text()
|
||||
assert '__version__ = "0.5.26"' in version_py_content
|
||||
assert '__version__ = "0.5.25"' in version_py_content
|
||||
|
||||
openclaw_pkg = json.loads(temp_project["openclaw_pkg"].read_text())
|
||||
assert openclaw_pkg["version"] == "0.5.26"
|
||||
|
|
@ -187,7 +187,7 @@ def test_bump_minor(temp_project: dict[str, Path]) -> None:
|
|||
assert 'version = "0.6.0"' in pyproject_content
|
||||
|
||||
version_py_content = temp_project["version_py"].read_text()
|
||||
assert '__version__ = "0.6.0"' in version_py_content
|
||||
assert '__version__ = "0.5.25"' in version_py_content
|
||||
|
||||
openclaw_pkg = json.loads(temp_project["openclaw_pkg"].read_text())
|
||||
assert openclaw_pkg["version"] == "0.6.0"
|
||||
|
|
@ -217,7 +217,7 @@ def test_bump_major(temp_project: dict[str, Path]) -> None:
|
|||
assert 'version = "1.0.0"' in pyproject_content
|
||||
|
||||
version_py_content = temp_project["version_py"].read_text()
|
||||
assert '__version__ = "1.0.0"' in version_py_content
|
||||
assert '__version__ = "0.5.25"' in version_py_content
|
||||
|
||||
openclaw_pkg = json.loads(temp_project["openclaw_pkg"].read_text())
|
||||
assert openclaw_pkg["version"] == "1.0.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue