eadd28fac0
P01 — release/install pipeline fix (REQ-097, REQ-098; gate C-21).
release.sh (REQ-097):
- Cross-build linux-amd64 regardless of host arch (GOOS=linux GOARCH=amd64
go build, CGO_ENABLED=0). D-193: the host-arch build produced the wrong
tarball when cut from arm64 — root cause of the v0.8.x asset-less
releases.
- Hardcode tarball name to orca-${VERSION}-linux-amd64.tar.gz (not
host-arch-dependent).
- Post-create asset verification (C-21): after tea releases create, query
the Gitea API and assert the tarball appears in attachments. Retry once
via tea release edit if missing. Fail loudly if still missing. This
catches the tea CLI bug where create exits 0 without attaching the asset.
install.sh (REQ-098):
- Asset fallback walk: if the resolved release (latest or --version) lacks
the matching tarball, query /releases?limit=50, extract all
browser_download_urls from the list response (assets are inline), find
the newest release with a matching orca-*-linux-amd64.tar.gz asset, print
a WARNING, and use that release. Fixes the v0.4.5 install incident where
v0.8.15 had no asset and install.sh errored out with no fallback.
- --check dry-run mode (D-194): prints version + asset URL + install path
+ current version without writing anything.
Tests (scripts/tests/):
- install_test.bash: 5 tests (--help, --check happy path, --check fallback
walk, unknown arg rejection, --system root check).
- release_test.bash: 5 tests (script exists, syntax valid, cross-build
command present, amd64 tarball name hardcoded, asset verification present).
All 30 bats tests pass. make lint clean (no new warnings).
---ci---
project: orca
phase: 1
milestone: v0.10
status: execute
---/ci---
Bash Testing Policy (grill C-15)
Every bash script under scripts/ MUST have at least one bats test covering
the happy path and one covering the failure path. This is the compensating
control for bash being exempt from the Go coverage gate (D-186).
Framework
- bats —
bats scripts/tests/*.bashruns all bash tests. - shellcheck —
shellcheck scripts/*.sh scripts/lib/*.sh scripts/tests/*.bashstatic analysis. - shfmt —
shfmt -d scripts/formatting check (optional; skip if not installed).
Install (if missing)
# bats
npm install -g bats # or: git clone https://github.com/bats-core/bats-core.git && ./bats-core/install.sh /usr/local
# shellcheck
apt-get install -y shellcheck
# shfmt (optional)
mvdan.cc/sh (go install mvdan.cc/sh/v3/cmd/shfmt@latest)
Running
make test-bash # runs bats (skips gracefully if bats missing)
make lint-bash # runs shellcheck + shfmt (skips gracefully if missing)
make test # runs both Go + bash tests
make lint # runs both Go + bash lint
Test file convention
- Test files live in
scripts/tests/<script-name>_test.bash. - Source
load test_helperat the top of every test file. - Happy path:
@test "<script> happy path" { ... } - Failure path:
@test "<script> failure path" { ... } - Use
run <command>+assert_status/assert_contains/assert_not_containsfrom test_helper.