[ai-assisted] feat(thumbnail): 문서 썸네일 renderer 확장#374
Merged
Conversation
da74c3a to
486e95f
Compare
Issue: #371 AI-Assisted: Yes PPTX 썸네일은 LibreOffice 외부 프로세스 대신 Apache POI slide renderer를 사용하도록 정리했다. DOCX/HWP/HWPX는 새 별도 renderer를 core에 두지 않고 thumbnail starter에서 textract `FileContentExtractionService` 기반 preview renderer로 등록한다. `studio.thumbnail.libre-office.*`와 `pptx.timeout` 설정/metadata/docs를 제거하고, 앱 예시는 POI/textract preview 기준으로 갱신했다. Async thumbnail follow-up: - 저장된 썸네일이 없으면 `/thumbnail`은 `X-Thumbnail-Status: pending` placeholder 이미지를 즉시 반환하고 starter background executor에서 생성한다. - queue reject 시 실제 작업이 없는데 pending을 반환하지 않고 unavailable 경로로 빠지도록 했다. - deterministic failure/unsupported 결과는 source 단위 bounded TTL 캐시에 memoize하고, 동일 source 동시 요청은 하나의 background job으로 합친다. - attachment 삭제와 queued generation 완료 사이 race에서 stale thumbnail이 다시 저장되지 않도록 deletion marker와 striped lock을 적용했다. - 204 응답에는 `X-Thumbnail-Status: unavailable`과 `Cache-Control: no-store`를 내려준다. Review follow-up: - format marker interface를 추가해 사용자가 직접 등록한 DOCX/HWP/HWPX renderer가 기본 preview renderer를 type 기준으로 대체할 수 있게 했다. - PPTX package를 POI 파싱 전에 ZIP entry/aggregate byte budget으로 pre-scan한다. - HWP/HWPX parser에 entry 및 aggregate extraction budget을 적용했다. - DOCX parser도 POI 파싱 전 ZIP entry/aggregate byte budget으로 pre-scan한다. - attachment starter README의 optional dependency 안내를 PDF/PPTX/DOCX-HWP-HWPX 기준으로 분리했다. Subagent usage: - code-reviewer: renderer replacement, dependency docs, async queue reject, stale thumbnail race findings. - security-auditor: PPTX package bound, HWP aggregate budget, deterministic failure memoization findings. Validation: - ./gradlew :studio-platform-textract:test --tests 'studio.one.platform.textract.extractor.impl.DocxFileParserTest' :studio-application-modules:attachment-service:test --tests 'studio.one.application.attachment.thumbnail.ThumbnailServiceImplTest' --tests 'studio.one.application.web.controller.AttachmentControllerTest' :starter:studio-application-starter-attachment:test => BUILD SUCCESSFUL - ./gradlew :studio-platform-textract:test :studio-platform-thumbnail:test :starter:studio-platform-thumbnail-starter:test :studio-application-modules:attachment-service:test :starter:studio-application-starter-attachment:test => BUILD SUCCESSFUL - ./gradlew test => BUILD SUCCESSFUL - git diff --check => passed - /Users/donghyuck.son/git/studio-one/studio-one-api-server ./gradlew compileJava => BUILD SUCCESSFUL - /Users/donghyuck.son/git/studio-one/studio-one-api-server git diff --check => passed
486e95f to
094aba9
Compare
24 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.
Why
studio-platform-thumbnail경로에 추가합니다.What
PptxThumbnailRenderer를 Apache POIXMLSlideShow기반 slide renderer로 구현했습니다.studio-platform-thumbnailcore renderer가 아니라studio-platform-thumbnail-starter의 textract preview renderer로 등록합니다.studio.thumbnail.libre-office.*및studio.thumbnail.renderers.pptx.timeout설정/metadata/docs를 제거하고,studio.thumbnail.renderers.<format>.enabled기준으로 문서를 갱신했습니다.X-Thumbnail-Status: pendingplaceholder 이미지를 반환하고 background executor에서 생성/저장합니다.X-Thumbnail-Status: unavailable204 경로로 빠지게 했습니다.studio-one-api-server설정에서 LibreOffice 설정을 제거하고 POI/textract preview 기준으로 맞췄습니다.Related Issues
Validation
./gradlew :studio-platform-textract:test --tests 'studio.one.platform.textract.extractor.impl.DocxFileParserTest' :studio-application-modules:attachment-service:test --tests 'studio.one.application.attachment.thumbnail.ThumbnailServiceImplTest' --tests 'studio.one.application.web.controller.AttachmentControllerTest' :starter:studio-application-starter-attachment:testBUILD SUCCESSFUL./gradlew :studio-platform-textract:test :studio-platform-thumbnail:test :starter:studio-platform-thumbnail-starter:test :studio-application-modules:attachment-service:test :starter:studio-application-starter-attachment:testBUILD SUCCESSFUL./gradlew testBUILD SUCCESSFULgit diff --check/Users/donghyuck.son/git/studio-one/studio-one-api-server ./gradlew compileJavaBUILD SUCCESSFUL/Users/donghyuck.son/git/studio-one/studio-one-api-server git diff --checkReview Follow-up
Risk / Rollback
/thumbnail은 pending 대신 204/unavailable을 반환합니다. 클라이언트는 이후 재시도할 수 있습니다.studio.textract.max-extract-size와studio.thumbnail.max-source-size를 보수적으로 유지해야 합니다.studio.thumbnail.renderers.<format>.enabled=false로 문서 renderer를 비활성화하면 기존 image/PDF 중심 동작으로 되돌릴 수 있습니다.AI / Subagent Usage
./gradlew test,git diff --check, 외부 app compile을 재실행했습니다.Checklist
AI-Assistedvalue is correct