Skip to content

Commit f925aaa

Browse files
committed
feat: add public release gate runner
1 parent eafffb0 commit f925aaa

4 files changed

Lines changed: 82 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ ralphctl --project-dir "$PWD" status
112112
- [telegram-public-smoke-runbook.md](docs/telegram-public-smoke-runbook.md)
113113
- [public-troubleshooting.md](docs/public-troubleshooting.md)
114114
- [public-release-checklist.md](docs/public-release-checklist.md)
115+
- `bash scripts/run-public-release-gate.sh "$PWD"`
115116
- `bash scripts/collect-fresh-machine-smoke-record.sh`
116117
- `bash scripts/collect-telegram-smoke-record.sh`
117118

docs/public-release-checklist.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ public launch 전체 기준과 ship blocker는 [public-launch-readiness.md](publ
99
아래 명령이 모두 통과해야 합니다.
1010

1111
```bash
12+
bash scripts/run-public-release-gate.sh "$PWD"
1213
env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go test ./internal/ralph -count=1
1314
env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go test ./cmd/ralphctl/... -count=1
1415
ralphctl --project-dir "$PWD" eval
1516
ralphctl --project-dir "$PWD" cp intent-eval
1617
ralphctl --project-dir "$PWD" cp competitive-eval
1718
```
1819

20+
권장:
21+
22+
- 먼저 `bash scripts/run-public-release-gate.sh "$PWD"`를 실행해 내부 release gate를 한 번에 수집
23+
- 외부 smoke는 runbook으로 별도 실행
24+
- 필요하면 `RALPH_RELEASE_GATE_OUTDIR=/tmp/ralph-release-gate bash scripts/run-public-release-gate.sh "$PWD"`처럼 출력 경로를 분리할 수 있음
25+
1926
확인 기준:
2027

2128
- `go test` 두 스위트가 모두 통과

docs/public-ship-audit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
2. 필요하면 아래 helper script로 기록 블록을 생성한다.
99
- `bash scripts/collect-fresh-machine-smoke-record.sh "$PWD"`
1010
- `bash scripts/collect-telegram-smoke-record.sh "<telegram-channel-or-chat>"`
11+
- `bash scripts/run-public-release-gate.sh "$PWD"`
1112
3. 아래 `Execution Record` 블록에 실제 실행 환경과 결과를 붙여넣는다.
1213
4. `Ship Blockers`를 다시 체크한다.
1314
5. `Decision``Ship` 또는 `No-Ship`으로 최종 갱신한다.

scripts/run-public-release-gate.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
repo_root="$(cd "${script_dir}/.." && pwd)"
7+
project_dir="${1:-${repo_root}}"
8+
timestamp="$(date +%Y-%m-%dT%H-%M-%S)"
9+
report_root="${RALPH_RELEASE_GATE_OUTDIR:-${project_dir}/.ralph-runtime/reports/release-gate}"
10+
report_dir="${report_root}/${timestamp}"
11+
latest_dir="${report_root}/latest"
12+
13+
mkdir -p "${report_dir}"
14+
rm -rf "${latest_dir}"
15+
mkdir -p "${latest_dir}"
16+
17+
run_step() {
18+
local name="$1"
19+
shift
20+
local logfile="${report_dir}/${name}.log"
21+
echo "==> ${name}" | tee -a "${report_dir}/summary.log"
22+
if "$@" >"${logfile}" 2>&1; then
23+
echo "status: pass" | tee -a "${report_dir}/summary.log"
24+
echo "${name}=pass" >>"${report_dir}/results.env"
25+
else
26+
echo "status: fail" | tee -a "${report_dir}/summary.log"
27+
echo "${name}=fail" >>"${report_dir}/results.env"
28+
return 1
29+
fi
30+
}
31+
32+
pushd "${repo_root}" >/dev/null
33+
34+
run_step internal_tests env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go test ./internal/ralph -count=1
35+
run_step cli_tests env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go test ./cmd/ralphctl/... -count=1
36+
run_step eval env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go run ./cmd/ralphctl --project-dir "${project_dir}" eval
37+
run_step intent_eval env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go run ./cmd/ralphctl --project-dir "${project_dir}" cp intent-eval
38+
run_step competitive_eval env GOCACHE=/tmp/ralph-gocache CGO_ENABLED=0 go run ./cmd/ralphctl --project-dir "${project_dir}" cp competitive-eval
39+
40+
popd >/dev/null
41+
42+
cat >"${report_dir}/summary.md" <<EOF
43+
# Public Release Gate Summary
44+
45+
- date: \`${timestamp}\`
46+
- repo_root: \`${repo_root}\`
47+
- project_dir: \`${project_dir}\`
48+
49+
## Results
50+
51+
\`\`\`text
52+
$(cat "${report_dir}/results.env")
53+
\`\`\`
54+
55+
## Attachments
56+
57+
- \`internal_tests.log\`
58+
- \`cli_tests.log\`
59+
- \`eval.log\`
60+
- \`intent_eval.log\`
61+
- \`competitive_eval.log\`
62+
EOF
63+
64+
cp "${report_dir}/summary.md" "${latest_dir}/summary.md"
65+
cp "${report_dir}/summary.log" "${latest_dir}/summary.log"
66+
cp "${report_dir}/results.env" "${latest_dir}/results.env"
67+
cp "${report_dir}"/*.log "${latest_dir}/"
68+
69+
cat <<EOF
70+
release_gate_report_dir=${report_dir}
71+
release_gate_latest_dir=${latest_dir}
72+
release_gate_summary=${latest_dir}/summary.md
73+
EOF

0 commit comments

Comments
 (0)