fix: 실패율 초과 FAILED 이력에 신규/변경/누락/실패 건수가 기록되지 않음 - #219
Merged
Conversation
PolicyBatchHistory.fail(String)이 카운트를 건드리지 않아 실패율 초과로 FAILED 처리된 회차가 관리자 배치 로그 화면에 항상 0/0/0/0으로 보였다. 카운트를 함께 받는 fail(...) 오버로드를 추가하고, PolicySyncService의 실패율 초과 분기에서 실제 집계값을 넘기도록 수정한다. Closes #205
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by step-3.7-flash · Input: 49.3K · Output: 5.3K · Cached: 199.6K |
3 tasks
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.
변경 내용
PolicyBatchHistory에 카운트를 함께 기록하는fail(String message, int newCount, int updatedCount, int unchangedCount, int missingCount, int errorCount)오버로드를 추가했다. 기존fail(String message)는 원인 불명 조기 실패용(예: API fetch 자체 실패)으로 그대로 유지한다.PolicySyncService.doRunFullSync()의 실패율(10%) 초과 분기에서 이미 계산되어 있던writeResult.newCount()/updatedCount()/errorCount(),plan.unchangedCount(),missingMarked를 새fail(...)오버로드로 넘기도록 수정했다. 실패율 초과로 FAILED 처리돼도 실제 처리 건수가 더 이상 버려지지 않는다.truncate(...)private 헬퍼로 추출했다.검증
export JAVA_HOME="$HOME/.sdkman/candidates/java/21.0.10-tem"설정 후 실행./gradlew test --tests "com.bop.youthpick.sync.*"— 통과 (PolicyBatchHistoryTest 7개, PolicySyncServiceTest 10개, 모두 성공)./gradlew test— 전체 테스트 BUILD SUCCESSFUL./gradlew spotlessApply실행 후./gradlew spotlessCheck— BUILD SUCCESSFUL추가한 테스트
PolicyBatchHistoryTest카운트를_포함한_fail은_FAILED_상태와_함께_신규_변경_유지_누락_실패_건수를_기록한다카운트를_포함한_fail도_실패_메시지가_컬럼_한도를_넘으면_잘라서_기록한다PolicySyncServiceTest실패율이_10퍼센트를_넘으면_크래시_없이_실패_사유를_기록한다에 신규/변경/유지/누락/실패 카운트 검증 추가 (기존 8건 성공 + 2건 실패 시나리오)실패율_초과로_전량_실패해도_실패_건수가_이력에_그대로_기록된다— 이슈에서 언급된 "12건 모두 저장 실패" 케이스를 그대로 재현해errorCount == 12, 나머지 카운트는 0으로 정확히 기록되는지 검증연결 이슈
Closes #205