fix: PR 코드 리뷰 개선 사항 반영 (issues #27, #30, #37)#43
Merged
Conversation
ppzxc
commented
Mar 24, 2026
ppzxc
left a comment
Owner
Author
There was a problem hiding this comment.
코드 리뷰 결과: APPROVE (자기 PR 승인 불가 → 코멘트로 대체)
전반적으로 이슈 의도에 충실하고 Tidy First 원칙(structural → behavioral 분리)이 잘 적용되었습니다.
#30 — sender.go
DefaultTransport.(*http.Transport).Clone() 패턴은 올바른 관용적 표현입니다. DefaultTransport가 외부에서 교체된 환경에서는 type assertion 패닉이 가능하나, 프로덕션 코드에서는 극히 드문 케이스이므로 허용 범위 내입니다.
#27 — middleware.go / middleware_internal_test.go
ok/!ok 패턴 + 명시적 메시지, 정확한 구현입니다. package http 내부 테스트로 unexported 함수를 직접 검증한 방식이 깔끔합니다.
#37 — main.go / main_test.go
시그니처 변경 및 호출부 에러 처리 모두 정확합니다. def := DefaultRelayWorkerConfig() 제거는 DefaultRetryCount가 원래도 직접 할당이었고 withDefaults()에서 0값 처리를 하므로 문제없습니다. 테스트 3종(ValidDurations / InvalidRetryDelay / InvalidPollBackoff)이 단일 동작을 명확하게 검증합니다.
비블로커 관찰사항
DefaultRetryCount=0케이스 테스트는 없으나withDefaults()와 Viper 기본값이 보장하므로 생략 수준 판단은 적절합니다.
LGTM ✅
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
inputTypeFromContextunguarded type assertion에 명시적 패닉 메시지 추가 (fix(http): inputTypeFromContext — unguarded type assertion에 명시적 패닉 메시지 추가 #27)webhook.SenderTransport를http.DefaultTransport.Clone()기반으로 교체 (fix(webhook): Sender Transport를 DefaultTransport 기반으로 교체 #30)buildRelayWorkerConfig잘못된 duration 입력 시 fail-fast 에러 반환 (fix(config): buildRelayWorkerConfig — 잘못된 duration 문자열 시 fail-fast 처리 #37)Motivation
PR #26, #29, #36 코드 리뷰에서 발견된 3가지 개선 사항을 반영한다.
Changes
internal/adapter/input/http/middleware.go: ok/not-ok 패턴으로 type assertion 변경, 명시적 패닉 메시지 추가internal/adapter/output/webhook/sender.go:&http.Transport{}→http.DefaultTransport.(*http.Transport).Clone()cmd/server/main.go:buildRelayWorkerConfig반환 타입을(RelayWorkerConfig, error)로 변경, 호출부에서 에러 처리Tidy First
Test plan
go build ./cmd/server/)go test -race ./... -timeout 60s)go vet ./...)TestInputTypeFromContext_PanicsWithMessage— 명시적 패닉 메시지 검증TestBuildRelayWorkerConfig_InvalidRetryDelay— 잘못된 duration fail-fast 검증TestBuildRelayWorkerConfig_InvalidPollBackoff— 잘못된 duration fail-fast 검증Closes #27
Closes #30
Closes #37