test(installer): lock repo-root resolution in bash launcher scripts#1395
test(installer): lock repo-root resolution in bash launcher scripts#1395dislovelhl wants to merge 4 commits into
Conversation
The installer bash scripts regressed once by traversing only one level ($SCRIPT_DIR/..) from installer/scripts, landing on installer/ instead of the repo root and breaking webui/electron path resolution. These tests pin the two-level traversal and the WEBUI_DIR/ELECTRON_DIR assignments so the regression can't silently return.
ReviewApprove. This is a tight, well-scoped regression test that pins the No production code changes, no security surface, no new dependencies (pure stdlib Issues🟢 Minor — the first test is documentation, not a guard ( 🟢 Minor — regex parsing is tight to script formatting ( Strengths
VerdictApprove. Both notes are 🟢 minor and optional — nothing blocks merge. |
The Code Quality gate was already red on main: pylint flagged W0613 (unused-argument) in the Outlook/Gmail Protocol-parity stubs and the email MCP send fake, plus W0102 (dangerous mutable default) on categorization_export. None are bugs — the unused kwargs are kept for signature parity with the Google backends (as the existing comments note), and the export default is read-only. Suppress the parity stubs with a targeted disable and switch the mutable default to a None sentinel so the gate passes without weakening it globally.
Why this matters
#1332 fixed the off-by-one repo-root bug in
start-agent-ui.shandbuild-ui-installer.sh(the bash counterparts to the PowerShell fix in #1326), but shipped with only a manualbash -ntest plan — nothing in CI stops the$SCRIPT_DIR/..→installer/regression from creeping back in if either script is moved or edited again. #1328 is still open precisely because the fix was never pinned.This adds the regression coverage: a pure-stdlib test that parses both scripts and asserts the two-levels-up traversal resolves to the real repo root, that
$WEBUI_DIR/$ELECTRON_DIRpoint atsrc/gaia/apps/webuiandsrc/gaia/electron(which exist on a fresh checkout), and that the old one-level traversal would have landed oninstaller/. No production code changes — the fix is already onmain.Closes #1328.
Test plan
python -m pytest tests/unit/installer/test_bash_script_paths.py— 3 passed against the current (fixed) scripts.$SCRIPT_DIR/..makes the corresponding test fail (the guard actually guards).black --checkandisort --check-onlyclean on the new file.Out of scope