fix(cli): use English setup gh auth remediation#417
Conversation
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
ebe0206 to
0f1d60b
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the interactive gh-symphony setup command to reuse the shared English formatGhAuthRemediation output for GhAuthError, aligning setup’s onboarding UX with the existing repo start behavior. Layer classification: Integration Layer (GitHub/gh auth integration surfaced through CLI UX).
Changes:
- Route interactive setup gh-auth preflight failures through
formatGhAuthRemediation(...)instead of hardcoded Korean strings. - Add a clack-specific
displayGhAuthErrorhelper for consistent@clack/promptserror output. - Add parameterized tests covering all five
GhAuthErrorcodes and asserting no Korean output.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/cli/src/commands/setup.ts |
Introduces displayGhAuthError and uses shared English remediation formatting for interactive setup auth failures. |
packages/cli/src/commands/setup.test.ts |
Adds it.each coverage for all GhAuthError codes and validates English remediation output + exit behavior. |
.changeset/english-setup-gh-auth.md |
Patch changeset for @gh-symphony/cli documenting the user-visible remediation message change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hojinzs
left a comment
There was a problem hiding this comment.
✅ Approve — PR #417 완성도 검증 완료
원본 이슈 #397의 요구 사항과 수용 조건이 빠짐없이 반영되었으며, 스모크 테스트와 코드 품질 검사를 통과하여 승인합니다.
1. 이슈 요구사항 충족 (#397)
-
setup.tsrunInteractive의 한국어 전용 에러 문자열(3건) 제거 → 공유 영문formatGhAuthRemediation경로로 통합 -
formatGhAuthRemediation(error, { retryCommand: "gh-symphony setup" })라우팅 —repo start와 동일한 메시지 재사용 -
@clack/prompts의p.log.error로title/message/hint를 매핑 (start.ts의 stderr 방식 그대로 복사하지 않음) - 보너스 커버리지 갭 해소 — 기존 핸들러는 5개 코드 중 3개만 분기(
invalid_token/token_failed는 rawerror.message로 누락)했으나, 이제 5개 코드 전부 일관된 영문 remediation으로 처리 - 이미 존재하던 import 라인에
formatGhAuthRemediation만 추가 — 신규 모듈 배선 없음 -
.changeset/english-setup-gh-auth.mdpatch 체인지셋 포함
2. Smoke Test (로컬 검증)
Preview 환경이 없어 로컬에서 빌드 후 실제 CLI 바이너리로 검증:
node packages/cli/dist/index.js setup(gh 미설치 환경) → 영문 remediation 정상 출력, 한국어 없음, exit code 1 확인x GitHub authentication is not available: gh CLI is not installed. ... x Install gh CLI from https://cli.github.com or set GITHUB_GRAPHQL_TOKEN.vitest run packages/cli/src/commands/setup.test.ts→ 13 passed (신규 5개 파라미터화 테스트 포함, 5개 코드 전부 커버 + 한국어 부재 +process.exitCode === 1+listUserProjects미호출 검증)pnpm --filter @gh-symphony/cli lint→ passtsc --noEmit(cli) → pass- CI: Test ✅ / Container Smoke ✅ (green)
3. Code Review
- 변경 범위가 좁고 책임이 명확하며(메시지 표현 경로 한정), 런타임 상태/디스패치/워커/트래커 동작에 영향 없음
- 테스트 품질 우수 —
it.each로 5개 코드를 전수 검증 - 인라인 코멘트 1건:
not_installed케이스의 메시지/힌트 중복 출력 (공유 헬퍼의 기존 동작이며repo start와 동일, 본 PR 범위 밖의 선택적 후속 개선 사항)
리스크 낮음, 회귀 없음. Approve.
Generated by Claude Code
| }); | ||
|
|
||
| p.log.error(`${remediation.title}: ${remediation.message}`); | ||
| p.log.error(remediation.hint); |
There was a problem hiding this comment.
Nit (non-blocking, no change requested for this PR): in the not_installed case, smoke-testing shows the install instruction prints twice — remediation.message is the GhAuthError message ("gh CLI is not installed. Install it from https://cli.github.com or set GITHUB_GRAPHQL_TOKEN.") and remediation.hint repeats nearly the same ("Install gh CLI from https://cli.github.com or set GITHUB_GRAPHQL_TOKEN."). This is pre-existing behavior of the shared formatGhAuthRemediation helper and is identical to what gh-symphony repo start already produces, so it's out of scope here — flagging only as a future cleanup opportunity in the shared helper, not a blocker for this change.
Generated by Claude Code
0f1d60b to
9525476
Compare
fffec5c to
e3252da
Compare
TL;DR
Interactive
gh-symphony setupnow uses the shared EnglishformatGhAuthRemediationpath forGhAuthErrorfailures instead of hardcoded Korean strings.변경 지점 다이어그램
setup.tsinteractive auth preflight →GhAuthError→formatGhAuthRemediation(error, { retryCommand: "gh-symphony setup" })→ clackp.log.erroroutput여기부터 보세요
packages/cli/src/commands/setup.ts— adds the clack-specific auth remediation display helper and routes interactive setup auth failures through it.packages/cli/src/commands/setup.test.ts— covers all fiveGhAuthErrorcodes, includinginvalid_tokenandtoken_failed..changeset/english-setup-gh-auth.md— patch changeset for@gh-symphony/cli.위험 & 롤백
Risk is low: this only changes the interactive setup auth failure presentation path. Roll back by reverting the setup helper/test changes and the changeset.
변경 파일
.changeset/english-setup-gh-auth.mdpackages/cli/src/commands/setup.tspackages/cli/src/commands/setup.test.tsEvidence
pnpm exec vitest run packages/cli/src/commands/setup.test.ts— passedrg -n '[가-힣]' packages/cli/src --glob '*.ts' --glob '!*.test.ts'— no matchespnpm lint— passedpnpm test— passedpnpm typecheck— passedpnpm build— passedIssues — Closed #397
Closes #397
머지 후/사람 확인
gh-symphony setupshows readable English remediation whenghis missing, unauthenticated, or missing scopes.