Skip to content

refactor: 영상 분석 파이프라인에서 S3 업로드 분리 (#63)#79

Merged
Boyeon-Shin merged 1 commit into
mainfrom
refactor/decouple-s3-from-completion
May 13, 2026
Merged

refactor: 영상 분석 파이프라인에서 S3 업로드 분리 (#63)#79
Boyeon-Shin merged 1 commit into
mainfrom
refactor/decouple-s3-from-completion

Conversation

@Boyeon-Shin
Copy link
Copy Markdown
Collaborator

📌 관련 이슈 (Related Issue)

📝 작업 내용 (Description)

  • S3 업로드를 분석 완료 조건에서 제외 → STT+VIDEO만 완료되면 종합평가 즉시 시작
  • 파일 I/O 책임을 external.storage 패키지에 일원화
  • S3 일시 오류 대응 위해 @Retryable 추가

🔄 변경 유형 (Type of Change)

  • ✨ 새로운 기능 (feat)
  • 🐛 버그 수정 (fix)
  • 📝 문서 수정 (docs)
  • 💄 스타일 (style)
  • ♻️ 리팩토링 (refactor)
  • ✅ 테스트 (test)
  • 🔧 기타 (chore)

✅ 체크리스트 (Checklist)

  • 코드가 정상적으로 동작하는지 확인했습니다
  • 기존 테스트가 통과합니다
  • 필요한 경우 새로운 테스트를 추가했습니다

@Boyeon-Shin Boyeon-Shin self-assigned this May 13, 2026
@Boyeon-Shin Boyeon-Shin merged commit 228b4ac into main May 13, 2026
2 checks passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the file storage and processing logic by introducing a dedicated 'LocalFileStorage' component and a 'FileExtensions' utility, while also updating 'S3FileStorage' to include retry logic for S3 operations. The 'AnalysisCompletionTracker' has been improved to better manage task states and cleanup, and 'VideoAnswerProcessor' has been updated to use the new storage components. I have provided feedback suggesting more specific exception handling in 'LocalFileStorage' and the use of 'String.format' for better readability when constructing S3 keys.

Comment on lines +22 to +25
} catch (Exception e) {
log.error("[로컬파일] 저장 실패 - filename: {}", file.getOriginalFilename(), e);
throw new BusinessException(ErrorCode.INTERNAL_ERROR);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

포괄적인 Exception 대신 더 구체적인 IOException을 catch하는 것이 좋습니다. file.transferTo()Files.createTempFile()은 주로 IOException을 발생시키며, 이는 예측 가능한 I/O 오류입니다. IllegalStateException과 같은 다른 런타임 예외는 애플리케이션의 전역 예외 처리기에서 처리되도록 두는 것이 더 나은 설계일 수 있습니다. 이렇게 하면 예외 처리 로직이 더 명확해지고 의도치 않은 예외를 숨기는 것을 방지할 수 있습니다.

Suggested change
} catch (Exception e) {
log.error("[로컬파일] 저장 실패 - filename: {}", file.getOriginalFilename(), e);
throw new BusinessException(ErrorCode.INTERNAL_ERROR);
}
} catch (IOException e) {
log.error("[로컬파일] 저장 실패 - filename: {}", file.getOriginalFilename(), e);
throw new BusinessException(ErrorCode.INTERNAL_ERROR);
}

)
public String save(Path videoPath, String contentType, String email) {
String extension = FileExtensions.extract(videoPath.getFileName().toString());
String key = "interview-video/" + email + "/" + LocalDate.now() + "/" + UUID.randomUUID() + extension;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

여러 문자열을 + 연산자로 연결하는 것보다 String.format()을 사용하면 코드가 더 읽기 쉽고 유지보수하기 좋아집니다. 특히 S3 키와 같이 구조가 정해진 문자열을 만들 때 가독성 향상에 도움이 됩니다.

Suggested change
String key = "interview-video/" + email + "/" + LocalDate.now() + "/" + UUID.randomUUID() + extension;
String key = String.format("interview-video/%s/%s/%s%s", email, LocalDate.now(), UUID.randomUUID(), extension);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: 영상 분석 파이프라인에서 S3 업로드를 완료 조건에서 분리하여 종합평가 지연 개선

1 participant