Skip to content

[FEATURE] 워터마크 처리 추상화 및 프로파일 스위칭 도입#127

Merged
Jong0128 merged 2 commits into
devfrom
feat/#125-watermark-abstraction
Jul 18, 2026
Merged

[FEATURE] 워터마크 처리 추상화 및 프로파일 스위칭 도입#127
Jong0128 merged 2 commits into
devfrom
feat/#125-watermark-abstraction

Conversation

@Jong0128

@Jong0128 Jong0128 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

🚀 Related issue

Closes #126

#️⃣ Summary

🔧 Changes

  • WatermarkProcessor 인터페이스 도입
  • 기존 처리 로직(S3 다운로드 → 변환 → 업로드 → 전이)을 LocalWatermarkProcessor로 이동
  • 워터마크 출력 키(wm/ 경로) 파생 로직을 WatermarkKeyResolver로 분리

📸 Test Evidence

💬 Reviewer Notes

Summary by CodeRabbit

  • 새 기능

    • 로컬 워터마크 처리 기능을 추가했습니다.
    • 원본 이미지에 워터마크를 적용하고 결과 파일을 저장합니다.
    • 처리 완료 및 실패 상태를 자동으로 반영합니다.
    • 재처리 요청도 동일한 워터마크 처리 흐름을 사용합니다.
  • 개선

    • 여러 파일 처리 중 일부 파일에서 오류가 발생해도 나머지 처리를 계속합니다.
    • 워터마크 결과 파일은 일관된 경로와 PNG 형식으로 저장됩니다.
  • 테스트

    • 파일별 위임 처리, 재처리, 오류 발생 시 후속 처리 동작을 검증했습니다.

@Jong0128 Jong0128 self-assigned this Jul 16, 2026
@Jong0128
Jong0128 requested a review from fervovita as a code owner July 16, 2026 02:42
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: fd415cb0-6f1d-4d02-a3f8-bf40056095fb

📥 Commits

Reviewing files that changed from the base of the PR and between bcfbf0c and 48bdfc3.

📒 Files selected for processing (6)
  • src/main/java/ditda/backend/domain/commission/draft/processor/LocalWatermarkProcessor.java
  • src/main/java/ditda/backend/domain/commission/draft/service/DraftWatermarkService.java
  • src/main/resources/application-local.yaml
  • src/main/resources/application-prod.yaml
  • src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java
  • src/test/resources/application-test.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/java/ditda/backend/domain/commission/draft/processor/LocalWatermarkProcessor.java
  • src/main/java/ditda/backend/domain/commission/draft/service/DraftWatermarkService.java
  • src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java

📝 Walkthrough

Walkthrough

워터마크 처리 계약과 키 해석기를 추가하고, 로컬 S3 워터마크 처리를 LocalWatermarkProcessor로 분리했습니다. DraftWatermarkService는 처리를 위임하며, 로컬 프로파일 설정과 위임 중심 테스트가 추가되었습니다.

Changes

워터마크 처리 추상화

Layer / File(s) Summary
프로세서 계약과 출력 키 생성
src/main/java/ditda/backend/domain/commission/draft/processor/WatermarkProcessor.java, src/main/java/ditda/backend/domain/commission/draft/processor/WatermarkKeyResolver.java
WatermarkProcessor 계약과 {dir}/wm/{baseName}.png 형식의 출력 키 생성 로직을 추가했습니다.
로컬 워터마크 처리
src/main/java/ditda/backend/domain/commission/draft/processor/LocalWatermarkProcessor.java
원본 S3 파일 다운로드, PNG 생성·업로드, 완료 및 실패 상태 전이를 비동기 로컬 프로세서에서 수행합니다.
서비스 위임과 검증
src/main/java/ditda/backend/domain/commission/draft/service/DraftWatermarkService.java, src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java, src/main/resources/application-*.yaml, src/test/resources/application-test.yaml
서비스가 WatermarkProcessor로 처리를 위임하도록 변경하고, 파일별 위임·재처리·예외 지속 처리와 watermark.mode: local 설정을 반영했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

  • Ditda-Official/Ditda-Backend 이슈 125: WatermarkProcessor 추상화와 로컬 구현을 기반으로 Lambda 워터마크 프로세서를 분리하는 상위 작업과 직접 연결됩니다.

Possibly related PRs

Suggested labels: ✨ Feature

Suggested reviewers: fervovita

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning 워터마크 변경과 무관한 swagger 서버 설명 추가가 포함되어 있어 이슈 범위를 벗어난 변경이 보입니다. swagger 설정 변경은 별도 PR로 분리하거나 제거하고, 워터마크 관련 변경만 유지하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 워터마크 처리 추상화와 프로파일 기반 스위칭이라는 핵심 변경을 간결하게 잘 요약합니다.
Linked Issues check ✅ Passed 인터페이스 추출, LocalWatermarkProcessor/KeyResolver 분리, watermark.mode 기반 주입 구조와 기본값 설정이 반영되었습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#125-watermark-abstraction

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from feat/#116-watermark-scheduler to dev July 16, 2026 05:22

@fervovita fervovita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨습니다!!!
아래 코멘트 확인 부탁드립니다🙏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java (1)

36-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

이관된 처리 로직의 회귀 테스트도 함께 옮겨 주세요.

현재 테스트는 위임만 검증합니다. 제거된 성공 전이, 업로드, 일반 실패, 영구 실패 검증을 LocalWatermarkProcessorTest로 옮기고 WatermarkKeyResolver의 키 변환 및 잘못된 키도 테스트해 주세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java`
around lines 36 - 82, Extend LocalWatermarkProcessorTest with regression tests
for the migrated processing flow: successful transition, upload, ordinary
failure, and permanent failure. Add WatermarkKeyResolver tests covering valid
key conversion and invalid keys, while keeping DraftWatermarkServiceTest focused
on delegation behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/ditda/backend/domain/commission/draft/processor/LocalWatermarkProcessor.java`:
- Around line 40-45: Update the exception handling in LocalWatermarkProcessor so
IllegalArgumentException raised by WatermarkKeyResolver.resolve() is represented
by a dedicated permanent-failure exception and routed to
draftWatermarkTransitionService.failPermanently(). Keep transient exceptions on
the existing fail() path and preserve the current image-processing failure
handling.

---

Nitpick comments:
In
`@src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java`:
- Around line 36-82: Extend LocalWatermarkProcessorTest with regression tests
for the migrated processing flow: successful transition, upload, ordinary
failure, and permanent failure. Add WatermarkKeyResolver tests covering valid
key conversion and invalid keys, while keeping DraftWatermarkServiceTest focused
on delegation behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 782365f2-4b9e-40ee-89c4-f40154717974

📥 Commits

Reviewing files that changed from the base of the PR and between 311a683 and bcfbf0c.

📒 Files selected for processing (5)
  • src/main/java/ditda/backend/domain/commission/draft/processor/LocalWatermarkProcessor.java
  • src/main/java/ditda/backend/domain/commission/draft/processor/WatermarkKeyResolver.java
  • src/main/java/ditda/backend/domain/commission/draft/processor/WatermarkProcessor.java
  • src/main/java/ditda/backend/domain/commission/draft/service/DraftWatermarkService.java
  • src/test/java/ditda/backend/domain/commission/draft/service/DraftWatermarkServiceTest.java

@fervovita
fervovita self-requested a review July 17, 2026 15:48

@fervovita fervovita left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

수고하셨습니다🚀
merge하셔도 될 것 같아요!!

@Jong0128
Jong0128 merged commit e9dea27 into dev Jul 18, 2026
2 checks passed
@Jong0128
Jong0128 deleted the feat/#125-watermark-abstraction branch July 18, 2026 04:02
@fervovita fervovita mentioned this pull request Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 워터마크 처리 추상화 및 프로파일 스위칭 도입

2 participants