v1.1.0 리뷰 반영: 봇 전환 중 늦은 연결 결과 무시, win-ci 토큰 자동 정리, smoke 에 봇 ready 확인

- DiscordTab: 연결 테스트에 요청 번호를 두어 봇을 바꾼 뒤 도착한 이전 응답(성공·서버 목록·오류·진행 표시)을 버린다
- 다른 봇으로 바꿨는데 토큰이 아직 없으면 오류 대신 안내 문구를 보인다
- mock-gvr: testBotToken 이 부를 때의 모드로 토큰을 고르게 (실제 IPC 와 같게)
- win-ci: run.sh 가 토큰 형식 검사 후 systemd 사용자 유닛으로 자동 복원(restore.sh --wait)을 띄운다
- gvr.ps1: 토큰 환경변수 제거를 finally 로, 끝나면 게스트의 stage2 사본과 빌드 산출물을 지운다
- smoke: 봇 로그인이 끝나길 최대 30초 기다리고, 기본 봇이 든 빌드는 ready 여야 통과

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-15 05:30:58 +09:00
parent 165fc3a710
commit 4d31cfc16a
6 changed files with 89 additions and 21 deletions

View File

@@ -8,6 +8,8 @@
# ==================================================================
$TargetRev = '__REV__'
$Phase = '__PHASE__'
# 겜녹이 기본 봇 토큰 (run.sh 가 full 빌드에만 박는다. 빈 값이면 기본 봇 없는 빌드). 끝나면 finally 에서 이 스크립트 사본째 지운다
$BuiltinBot = '__BUILTIN_BOT__'
$Repo = 'C:\win-ci\gvr'
$OutDir = 'C:\win-ci\gvr-out'
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
@@ -131,11 +133,13 @@ try {
Push-Location (Join-Path $Repo 'app')
& npm.cmd ci --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { Pop-Location; throw "npm ci exit $LASTEXITCODE" }
# 겜녹이 기본 봇 토큰 (run.sh 가 이번 실행에만 박는다. 빈 값이면 기본 봇 없는 빌드)
$env:GVR_BUILTIN_BOT_TOKEN = '__BUILTIN_BOT__'
& npm.cmd run dist:win
$c = $LASTEXITCODE
Remove-Item Env:GVR_BUILTIN_BOT_TOKEN -ErrorAction SilentlyContinue
try {
$env:GVR_BUILTIN_BOT_TOKEN = $BuiltinBot
& npm.cmd run dist:win
$c = $LASTEXITCODE
} finally {
Remove-Item Env:GVR_BUILTIN_BOT_TOKEN -ErrorAction SilentlyContinue
}
Pop-Location
if ($c -ne 0) { throw "electron-builder exit $c" }
Get-ChildItem app\release -File | ForEach-Object { "$($_.Name) $([math]::Round($_.Length / 1MB, 1)) MB" }
@@ -164,6 +168,14 @@ try {
} catch {
Log "gvr 검증 준비 실패: $($_.Exception.Message)"
try { Pop-Location } catch {}
} finally {
if ($BuiltinBot) {
# 성공·실패와 상관없이 게스트에 토큰을 남기지 않는다: 이 스크립트 사본(평문), 빌드 산출물(감춘 값. exe 는 이미 호스트로 보냄)
Remove-Item Env:GVR_BUILTIN_BOT_TOKEN -ErrorAction SilentlyContinue
Remove-Item (Join-Path $Repo 'app\dist'), (Join-Path $Repo 'app\release') -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $PSCommandPath -Force -ErrorAction SilentlyContinue
Log "기본 봇 토큰 정리: stage2 사본 삭제=$(-not (Test-Path $PSCommandPath)), 빌드 산출물 삭제=$(-not (Test-Path (Join-Path $Repo 'app\release')))"
}
}
Log "=== gvr 끝 ==="
exit 0