Files
automaton/tasks/fix-install-update-flow/CODE_REVIEW.md
T

2.1 KiB

CODE_REVIEW: fix-install-update-flow

Reviewed Files

  1. scripts/install.sh -- complete restructure (git URL arg, venv fix, version check)
  2. scripts/update.sh -- hook copy fix
  3. scripts/upgrade.sh -- hook copy fix, symlink logic removed
  4. tests/test_install_update_flow.py -- 15 tests
  5. README.md -- updated install instructions
  6. CHANGELOG.md -- task 8 entry

Findings

1. install.sh restructure

The original if [ -d "$FRAMEWORK_DIR" ]; then ... else ... fi structure was restructured to early-exit (exit 0) for the already-installed case, then top-level code for the install case. This is cleaner and avoids the orphaned fi bug that was present in the original (the venv setup was outside the if/else/fi).

The git URL is now GIT_URL="${1:-}" with a clear usage message and irreversibility warning. The hardcoded private IP URL is gone.

Verdict: PASS

2. Venv fix

The venv is now created in $FRAMEWORK_DIR/.venv instead of CWD. The requirements.txt path is $FRAMEWORK_DIR/requirements.txt. Platform-aware Python detection handles both Unix (.venv/bin/python3) and Windows (.venv/Scripts/python.exe). Uses "$VENV_PY" -m pip for cross-platform pip.

Verdict: PASS

3. Hook consistency

All three scripts (install-hooks.sh, update.sh, upgrade.sh) now use cp + chmod +x for hooks. No more ln -sf. The upgrade.sh symlink-checking logic (readlink, -L) is removed, simplifying the code.

Verdict: PASS

4. Version check

status.py --version is called after all setup. The || echo "WARNING: ..." ensures the script continues even if the version check fails.

Verdict: PASS

5. Test coverage

15 tests cover all 5 requirements. Tests check script content (not execution) for the required patterns, which is appropriate for shell script testing in CI.

Verdict: PASS

6. Shell syntax

bash -n passes for all three scripts.

Verdict: PASS

Summary

All 6 review areas pass. The implementation fixes all 5 issues cleanly. 15 new tests. Full suite: 424 passed.

Overall verdict: APPROVED