mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd91b49054 | |||
| 7c96a0777d |
@@ -2,6 +2,13 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## v0.20.2 (2026-03-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix auto-update Homebrew detection: `brew outdated` exits 1 when a formula is outdated, not on error
|
||||
- Previously treated exit code 1 as a failure, causing "Automatic update check failed" instead of detecting the available update
|
||||
|
||||
## v0.20.1 (2026-03-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
+2
-2
@@ -6,12 +6,12 @@
|
||||
"url": "https://github.com/basicmachines-co/basic-memory.git",
|
||||
"source": "github"
|
||||
},
|
||||
"version": "0.20.1",
|
||||
"version": "0.20.2",
|
||||
"packages": [
|
||||
{
|
||||
"registryType": "pypi",
|
||||
"identifier": "basic-memory",
|
||||
"version": "0.20.1",
|
||||
"version": "0.20.2",
|
||||
"runtimeHint": "uvx",
|
||||
"runtimeArguments": [
|
||||
{"type": "positional", "value": "basic-memory"},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""basic-memory - Local-first knowledge management combining Zettelkasten with knowledge graphs"""
|
||||
|
||||
# Package version - updated by release automation
|
||||
__version__ = "0.20.1"
|
||||
__version__ = "0.20.2"
|
||||
|
||||
# API version for FastAPI - independent of package version
|
||||
__api_version__ = "v0"
|
||||
|
||||
@@ -134,13 +134,11 @@ def _check_homebrew_update_available(silent: bool) -> tuple[bool, str | None]:
|
||||
silent=silent,
|
||||
capture_output=True,
|
||||
)
|
||||
if result.returncode != 0:
|
||||
stderr = (result.stderr or "").strip()
|
||||
stdout = (result.stdout or "").strip()
|
||||
detail = stderr or stdout or "brew outdated failed"
|
||||
raise RuntimeError(detail)
|
||||
|
||||
is_outdated = bool((result.stdout or "").strip())
|
||||
# Trigger: brew outdated exits 1 when the formula IS outdated (with name on stdout).
|
||||
# Why: non-zero exit here means "outdated", not "error".
|
||||
# Outcome: check stdout for the package name to determine outdated status.
|
||||
stdout = (result.stdout or "").strip()
|
||||
is_outdated = PACKAGE_NAME in stdout
|
||||
return is_outdated, None
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ from basic_memory.cli.auto_update import (
|
||||
AutoUpdateResult,
|
||||
AutoUpdateStatus,
|
||||
InstallSource,
|
||||
_check_homebrew_update_available,
|
||||
_is_interactive_session,
|
||||
detect_install_source,
|
||||
maybe_run_periodic_auto_update,
|
||||
@@ -129,6 +130,30 @@ def test_force_bypasses_auto_update_disabled(monkeypatch, tmp_path):
|
||||
assert manager.save_calls == 1
|
||||
|
||||
|
||||
def test_check_homebrew_update_available_exit_code_1_means_outdated(monkeypatch):
|
||||
"""brew outdated exits 1 when the formula is outdated, not on error."""
|
||||
|
||||
def _fake_run(command, **kwargs):
|
||||
return subprocess.CompletedProcess(
|
||||
command, 1, stdout="basicmachines-co/basic-memory/basic-memory\n", stderr=""
|
||||
)
|
||||
|
||||
monkeypatch.setattr("basic_memory.cli.auto_update._run_subprocess", _fake_run)
|
||||
is_outdated, _ = _check_homebrew_update_available(silent=False)
|
||||
assert is_outdated is True
|
||||
|
||||
|
||||
def test_check_homebrew_update_available_exit_code_0_means_up_to_date(monkeypatch):
|
||||
"""brew outdated exits 0 when the formula is up to date."""
|
||||
|
||||
def _fake_run(command, **kwargs):
|
||||
return subprocess.CompletedProcess(command, 0, stdout="", stderr="")
|
||||
|
||||
monkeypatch.setattr("basic_memory.cli.auto_update._run_subprocess", _fake_run)
|
||||
is_outdated, _ = _check_homebrew_update_available(silent=False)
|
||||
assert is_outdated is False
|
||||
|
||||
|
||||
def test_homebrew_outdated_triggers_upgrade(monkeypatch, tmp_path):
|
||||
config = _base_config(tmp_path)
|
||||
manager = StubConfigManager(config)
|
||||
|
||||
Reference in New Issue
Block a user