Skip to content

fix(installer): resolve repo root correctly in bash scripts under installer/ - #1332

Merged
kovtcharov-amd merged 1 commit into
mainfrom
fix/installer-bash-repo-root
Jun 1, 2026
Merged

kovtcharov-amd merged 1 commit into
mainfrom
fix/installer-bash-repo-root

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Why this matters

On a fresh Linux/macOS checkout, start-agent-ui.sh --frontend-only and build-ui-installer.sh were running npm/electron-forge against the non-existent installer/src/gaia/apps/webui instead of the real src/gaia/apps/webui, silently producing a broken installer or failing prerequisite checks. These are the bash counterparts to the two PowerShell scripts fixed in #1326 — flagged in that PR's review as having the identical off-by-one bug, deliberately deferred to this follow-up. Both scripts live at installer/scripts/, so the correct traversal is $SCRIPT_DIR/../.. (two levels up to repo root), not $SCRIPT_DIR/.. (one level, stopping at installer/).

Follow-up to #1326.

Test plan

  • bash -n parses both scripts with no errors.
  • Path resolution: cd "$SCRIPT_DIR/../.." from installer/scripts/ resolves to repo root, and src/gaia/apps/webui/package.json is found there.
  • git diff is scope-clean: only the two .sh files, 2 insertions / 2 deletions.
  • Manual (Linux reviewer, optional): ./installer/scripts/start-agent-ui.sh --frontend-only runs npm in the correct directory; ./installer/scripts/build-ui-installer.sh --browser builds against the real src/gaia/apps/webui.

…taller/

The bash counterparts to the PowerShell scripts fixed in #1326 had the
identical off-by-one bug: both climbed one parent directory too few from
installer/scripts/, so $REPO_ROOT / $PROJECT_ROOT pointed at installer/
instead of the repo root. Downstream $WEBUI_DIR / $ELECTRON_DIR then
resolved to the non-existent installer/src/gaia/apps/webui, breaking
start-agent-ui.sh --frontend-only and build-ui-installer.sh on Linux/macOS.

Both scripts live at installer/scripts/, so the correct traversal is
$SCRIPT_DIR/../.. (two levels up to repo root).
@github-actions github-actions Bot added the installer Installer changes label Jun 1, 2026
@kovtcharov-amd kovtcharov-amd self-assigned this Jun 1, 2026
@kovtcharov-amd
kovtcharov-amd requested a review from itomek-amd June 1, 2026 19:21
@kovtcharov-amd
kovtcharov-amd enabled auto-merge June 1, 2026 19:21
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Both bash scripts had the identical off-by-one path bug that was fixed in the PowerShell counterparts in #1326 — this PR applies the same fix correctly. The change is minimal, surgical, and verified by the directory structure (installer/scripts/ is two levels below repo root, not one).


Summary

Scripts at installer/scripts/ used $SCRIPT_DIR/.. to reach the repo root, which resolves to installer/ — causing npm/electron-forge to look for installer/src/gaia/apps/webui (which doesn't exist). The fix of $SCRIPT_DIR/../.. matches the PowerShell equivalents already corrected in #1326. No other files are touched; the change is exactly scoped to the two path strings.


Issues Found

None.


Strengths

  • Exact parallel to fix(installer): resolve repo root correctly in scripts under installer/ #1326: build-ui-installer.ps1 already uses Resolve-Path "$PSScriptRoot\..\.."; the bash scripts now match — pattern consistency across the installer family is restored.
  • Scope-clean: 2 insertions, 2 deletions, zero drive-by changes. Passes the CLAUDE.md bulletproof commit bar.
  • Clear PR description: the before/after behaviour (installer/src/gaia/apps/webui vs. src/gaia/apps/webui) is stated explicitly, making the reviewer's job trivial.

Verdict

Approve — correct fix, minimal diff, no side effects. The manual end-to-end step (running start-agent-ui.sh --frontend-only on Linux) is marked optional in the test plan, which is reasonable for a two-character path change that is structurally identical to the already-merged #1326 fix.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Jun 1, 2026
Merged via the queue into main with commit e8c501b Jun 1, 2026
33 of 34 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the fix/installer-bash-repo-root branch June 1, 2026 19:23
@kovtcharov-amd kovtcharov-amd mentioned this pull request Jun 1, 2026
5 of 6 tasks
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Jun 9, 2026
…md#1395)

## Why this matters

amd#1332 fixed the off-by-one repo-root bug in `start-agent-ui.sh` and
`build-ui-installer.sh` (the bash counterparts to the PowerShell fix in
amd#1326), but shipped with only a manual `bash -n` test plan — nothing in
CI stops the `$SCRIPT_DIR/..` → `installer/` regression from creeping
back in if either script is moved or edited again. amd#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_DIR` point at
`src/gaia/apps/webui` and `src/gaia/electron` (which exist on a fresh
checkout), and that the old one-level traversal would have landed on
`installer/`. No production code changes — the fix is already on `main`.

Closes amd#1328.

## Test plan
- [x] `python -m pytest tests/unit/installer/test_bash_script_paths.py`
— 3 passed against the current (fixed) scripts.
- [x] Sanity: temporarily reverting either script to `$SCRIPT_DIR/..`
makes the corresponding test fail (the guard actually guards).
- [x] `black --check` and `isort --check-only` clean on the new file.

## Out of scope
- The script fix itself (already merged in amd#1332).
- PowerShell counterparts (amd#1326).

---------

Co-authored-by: martin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

installer Installer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants