feat: Phase 6 — 클라이언트 사이드 Validation, --from 자동선택, 빌드 인프라#2
Merged
Palbahngmiyine merged 2 commits intomainfrom Apr 8, 2026
Merged
feat: Phase 6 — 클라이언트 사이드 Validation, --from 자동선택, 빌드 인프라#2Palbahngmiyine merged 2 commits intomainfrom
Palbahngmiyine merged 2 commits intomainfrom
Conversation
PRD 2.3.7에 명시된 클라이언트 사이드 메시지 Validation과 추가 기능을 구현합니다.
주요 변경사항:
**pkg/validation/ 신규 패키지 (21개 파일)**
- 텍스트 길이 함수: GetTextLength (EUC-KR), GetRealTextLength (유니코드), GetJSStringLength (UTF-16)
- 전화번호 정규화/검증: NormalizePhone, ParsePhone (+82 한국 국가코드 지원)
- Auto-Type Detection: SMS/LMS/MMS/ATA/BMS/RCS 자동 감지
- 타입별 Validator: SMS(≤90B), LMS(≤2000B), MMS(imageId 필수), ATA(≤1000자),
BMS 8개 타입, RCS 4개 서브타입
- 통합 진입점: ValidateMessages() + --skip-validation/--strict 플래그
- 경계값/fuzz/동시성 테스트 포함
**--from 자동 선택 (PRD 2.4.4)**
- resolveFrom(): senderid API 조회 → 0개 에러, 1개 자동선택, 2+ 목록 표시
- SMS/LMS/MMS/RCS 서브커맨드에 적용, flag 검증 후 호출
**추가 기능**
- User-Agent HTTP 헤더: solactl/{version} ({os}/{arch})
- CSV 배치 진행 카운터: [1/10] 100건 발송 중...
- LMS/MMS 메시지에 Type 필드 명시 설정
- context 만료 시 retry 즉시 탈출
**빌드 인프라**
- .goreleaser.yaml: darwin/linux/windows × amd64/arm64
- Makefile: build, test, test-race, lint, fuzz, clean
**테스트 품질 보강**
- t.Cleanup 추가 (types, apierror, version, semver 테스트)
- partial success+failure 배치 테스트
- resetSendFlags에 skip-validation/strict 추가
- 5라운드 반복 코드 리뷰 → 19건 이슈 발견/수정 → 0건 잔여
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive client-side validation for the solactl CLI, covering phone normalization, message type auto-detection, and specific constraints for SMS, LMS, MMS, AlimTalk, BMS, and RCS. Key enhancements include automatic sender ID resolution, User-Agent header integration, and the addition of a Makefile and GoReleaser configuration. Feedback focuses on improving the robustness of phone normalization against leading whitespace, ensuring informational messages are sent to stderr to avoid corrupting stdout JSON streams, using 1-based indexing for user-facing error messages, and correcting a logic discrepancy in BMS button type validation.
- stdout/stderr 분리: 정보성 메시지(검증 오류, 배치 진행, 발신번호 자동선택)를 errOut()으로 라우팅하여 --json 출력 오염 방지 - errWriter 추상화 도입 (outWriter 패턴과 동일) 및 테스트 인프라 구축 - NormalizePhone: i==0 → b.Len()==0 수정으로 "(+82)" 등 선행 문자 뒤 '+' 보존 - 사용자 노출 인덱스 0-based → 1-based 통일 (send.go, common.go, errors.go) - BMS_COMMERCE 빈 buttonType 허용 제거 - extractCountryCode doc comment 오류 수정 - configure_show.go 경고 메시지 stderr 전환 - stderr 캡처 테스트, 메시지 내용 검증 테스트, stdout 음성 검증 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/validation/신규 패키지, 21개 파일)--skip-validation,--strict플래그, 검증 에러 테이블 출력--from자동 선택:resolveFrom()— senderid API 조회 → 0/1/2+ 분기solactl/{version} ({os}/{arch})[1/10] 100건 발송 중....goreleaser.yaml(6 platform),MakefileTest plan
go test ./... -race -count=1— 전체 858개 테스트 통과go test ./pkg/validation/... -race -count=1— validation 패키지 단독 통과🤖 Generated with Claude Code