fix(install): update installs a checkout without upstream as it is; the startup report no longer asks for a Claude token

This commit is contained in:
2026-10-23 23:40:20 +01:00
parent 3d0c034394
commit afba02899d
3 changed files with 9 additions and 6 deletions
-2
View File
@@ -77,8 +77,6 @@ func banner(w io.Writer, s startup) {
}
if s.ClaudeToken {
row("Claude", "service token present")
} else {
row("Claude", "no service token; as a background service run `claude setup-token` and save it to ~/.config/pipelines/claude-token (chmod 600)")
}
if s.HarnessErr != nil {
row("Harnesses", "unreadable: "+s.HarnessErr.Error())
+8 -3
View File
@@ -338,9 +338,14 @@ def update(config):
if active:
raise RuntimeError(f"{len(active)} run(s) are still executing; update after they finish")
if (source / ".git").exists():
pulled = subprocess.run(["git", "-C", str(source), "pull", "--ff-only"], text=True)
if pulled.returncode:
raise RuntimeError("git pull --ff-only failed; resolve the checkout, then rerun `pipelines update`")
upstream = subprocess.run(["git", "-C", str(source), "rev-parse", "--abbrev-ref", "@{u}"],
capture_output=True, text=True)
if upstream.returncode:
print("The checkout tracks no upstream branch; installing it as it is.")
else:
pulled = subprocess.run(["git", "-C", str(source), "pull", "--ff-only"], text=True)
if pulled.returncode:
raise RuntimeError("git pull --ff-only failed; resolve the checkout, then rerun `pipelines update`")
installed = subprocess.run(["sh", str(source / "install.sh"), *config.get("install_args", [])])
if installed.returncode:
raise RuntimeError("The installer failed; the previous version keeps running")
+1 -1
View File
@@ -194,7 +194,7 @@ class ManageNativeTests(unittest.TestCase):
patch.object(manage, "stop") as stop, patch.object(manage, "start") as start, \
patch.object(manage, "report") as report:
manage.update(config)
self.assertEqual(calls, [["sh", str(source / "install.sh"), "--port", "18180"]])
self.assertEqual(calls[-1], ["sh", str(source / "install.sh"), "--port", "18180"])
stop.assert_called_once()
start.assert_called_once()
report.assert_called_once()