Skip to content

[FEAT] s3 삭제 건너뛰기 구현#368

Merged
taerimiiii merged 4 commits into
developfrom
feat/297-s3
Jun 17, 2026
Merged

[FEAT] s3 삭제 건너뛰기 구현#368
taerimiiii merged 4 commits into
developfrom
feat/297-s3

Conversation

@taerimiiii

@taerimiiii taerimiiii commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🔗 Related Issue

✨ 작업 개요

작업 내용을 간략하게 작성해주세요.

  • S3Utils.java -> RESERVED_PREFIXES = {"festival", "contest"} 상수 + 두 메서드 추가
  • isReservedKey(String key) — key의 첫 번째 경로 세그먼트가 reserved인지 확인
  • deleteIfNotReserved(String key) — reserved면 debug 로그 후 스킵, 아니면 deleteFile() 호출 (실패 시 warn 로그만 남기고 예외 전파 안 함)

Reserved key 동작

  • festival/banner.jpg → 스킵 (debug 로그)
  • contest/2024/img.png → 스킵 (debug 로그)
  • pins/uuid-photo.jpg → 정상 삭제
  • solver-photos/uuid.jpg → 정상 삭제

체크리스트

  • Reviewers, Assignees, Labels를 모두 등록했나요?
  • .gitignore 설정을 하였나요?
  • PR 머지 전 반드시 CI가 정상적으로 작동하는지 확인해주세요!

📷 이미지 첨부 (선택)

  • 작업 결과를 확인할 수 있는 이미지나 GIF를 첨부해주세요.
  • UI 변경, API 응답 샘플, 테스트 결과 등이 포함되면 좋아요!

🧐 집중 리뷰 요청

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요.

@taerimiiii taerimiiii requested a review from yaaan7 June 17, 2026 13:25
@taerimiiii taerimiiii self-assigned this Jun 17, 2026
@taerimiiii taerimiiii added the ⭐ feat 새로운 기능 label Jun 17, 2026

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

Copy link
Copy Markdown
Contributor

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 introduces automatic S3 object cleanup when deleting pins, communities, problem solvers, or users. Before deleting database records, S3 keys are collected and subsequently deleted using a new S3Utils.deleteIfNotReserved utility, which skips reserved system assets. The review feedback highlights a critical improvement opportunity: S3 deletions currently run within active database transactions, which can cause data inconsistency if a transaction rolls back. To resolve this, it is recommended to defer S3 deletions until after a successful commit using TransactionSynchronizationManager. Additionally, feedback suggests refining the reserved key detection in S3Utils to handle leading slashes or spaces safely, and renaming a repository method to maintain consistent naming conventions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/main/java/issueissyu/backend/utils/S3/S3Utils.java
Comment thread src/main/java/issueissyu/backend/domain/user/service/UserSignOutCleaner.java Outdated
@taerimiiii taerimiiii merged commit 120e86d into develop Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⭐ feat 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] S3 삭제 건너뛰기 추가

1 participant