85963dc320
REQ-043: install.sh pulls release binary from public Gitea URL. User-level default (~/.local/bin/orca), --system for system-level (/usr/local/bin/orca). Defaults to latest release; --version pins. Env-overridable GITEA_URL/OWNER/REPO for testability. REQ-044: in-place update detects existing binary, reads version via 'orca version --json', prints update message, overwrites binary, preserves namespace dir (config/db/certs). Idempotent re-install. REQ-016 (completion): README quickstart now documents the 1-liner install + --system variant + update-in-place pattern. Tests: 8/8 pass in scripts/install_test.sh (real public Gitea releases, no mock server; timeout-guarded to prevent hangs). Docs: docs/install.md covers user/system install, version pinning, in-place update, uninstall, troubleshooting. ---ci--- project: orca phase: 2 milestone: v0.5 status: verify ---/ci---
3.4 KiB
3.4 KiB
Phase 2 Verification: install.sh + In-Place Update (v0.5 P2)
Phase: 2 (install.sh + in-place update) Milestone: v0.5 Distribution Requirements covered: REQ-043, REQ-044, REQ-016 (completion) Date: 2026-08-03
Structural Layer
gofmt -l .→ clean.go vet ./...→ clean.go build ./...→ succeeds.- New files:
scripts/install.sh,scripts/install_test.sh,docs/install.md. - Modified files:
README.md. install.shis executable (chmod +x).
Behavioral Layer
install_test.sh — 8/8 tests pass
Run via timeout 120 bash scripts/install_test.sh:
- Test 1: user-level install (v0.4.1) ✓
- Binary at
~/.local/bin/orca✓ orca version --jsonreturnsv0.4.1✓
- Binary at
- Test 2: in-place update (v0.4.1 → v0.4.2) preserves namespace ✓
- "updated orca from v0.4.1 to v0.4.2" message printed ✓
~/.orca/orca.dbcontent preserved ("preserve-me") ✓- Binary version updated to
v0.4.2✓
- Test 3: idempotent re-install (v0.4.2 → v0.4.2) ✓
- "reinstalled orca v0.4.2" message printed ✓
- Test 4: --system install (root) ✓
- Binary at
/usr/local/bin/orca✓ - Reports
namespace root: /root/.orca✓
- Binary at
- Test 5: --system without root — SKIP (running as root)
Manual e2e (real Gitea releases)
curl -fsSL ... | bashdownloads v0.4.2 tarball, extracts, installs ✓- Re-run updates binary; namespace dir untouched ✓
--version v0.4.1pins to v0.4.1 ✓
Regression — Go tests
internal/cli/✓ (cached, no regressions from P1)internal/store/✓internal/doctor/✓
Security Layer
install.shdoes notevalremote content — it downloads a tarball and extracts it withtar -xzf.- No secrets in the script.
GITEA_TOKENis not required (public repo, anonymous download per REQ-045). .envis not referenced by install.sh.- The script uses
set -euo pipefailfor fail-fast safety. curl -fsSLfails on HTTP errors (no silent 404 downloads).
Quality Layer
- 1-liner install:
curl -fsSL <url> | bashworks (verified). - --system flag: installs to
/usr/local/bin, namespace/root/.orca, requires root (errors otherwise). - --version pinning:
--version vX.Y.Zqueries the specific release tag. - In-place update (REQ-044): detects existing binary, reads version via
orca version --json, prints update message, overwrites binary, preserves namespace dir. Idempotent. - Env-overridable:
GITEA_URL,GITEA_OWNER,GITEA_REPOhonor pre-set env vars (${VAR:-default}) for testability. - Timeout-guarded: test harness uses
timeout 30per test +timeout 120overall +trap 'kill 0' EXITto prevent orphaned processes. - Documentation:
docs/install.mdcovers user/system install, version pinning, in-place update, uninstall, and troubleshooting. README quickstart updated with the 1-liner (REQ-016 completion).
Must-Haves Checklist
bash scripts/install_test.shpasses (8/8).curl -fsSL <url> | bashworks on a fresh system.curl -fsSL <url> | bash -s -- --systeminstalls to/usr/local/bin(as root).- Re-running updates the binary;
~/.orca/orca.dbpreserved. - README quickstart documents the 1-liner +
--systemvariant.
Verdict
PASS — all 4 verification layers pass. REQ-043, REQ-044, and REQ-016
(completion) are satisfied. Ready to ship as v0.4.3.