Skip to content

Conversation

@sjk4618
Copy link
Member

@sjk4618 sjk4618 commented Dec 8, 2025

🔥Pull requests

⛳️ 작업한 브랜치

👷 작업한 내용

🚨 참고 사항

@coderabbitai
Copy link

coderabbitai bot commented Dec 8, 2025

📝 Walkthrough

Summary by CodeRabbit

릴리스 노트

  • Bug Fixes
    • 사전 검증 단계를 제거하여 처리 효율성을 개선했습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

S3Service.getS3PreSignedUrls 메서드에서 이벤트 존재 여부를 확인하는 validateExistEvent(eventId) 호출을 주석 처리하였으며, 나머지 미디어 정보 매핑 및 응답 생성 로직은 변경 없이 유지됩니다.

Changes

패턴 / 파일 변경 요약
S3 Pre-signed URL 검증 로직 변경
src/main/java/com/permitseoul/permitserver/domain/admin/util/aws/S3Service.java
validateExistEvent(eventId) 호출을 주석 처리하여 URL 생성 시 이벤트 존재 여부 사전 검증 단계 비활성화

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3분

  • 단일 파일의 단순 주석 처리 변경
  • 제어 흐름 또는 기능적 변화 없음

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive PR 설명에는 관련 이슈 #185에 대한 참조가 있으나 구체적인 변경 내용이 작성되지 않았습니다. PR 본문의 '작업한 내용' 섹션을 채워 변경 사항의 목적과 이유를 구체적으로 설명해주세요.
Linked Issues check ❓ Inconclusive 연결된 이슈 #185는 매우 최소한의 정보만 제공하고 있으며, 구체적인 요구사항이 명확하지 않아 준수 여부를 판단하기 어렵습니다. 이슈 #185에 구체적인 기술 요구사항과 수락 기준을 추가하여 PR이 요구사항을 충족하는지 명확히 검증할 수 있도록 해주세요.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 S3 프리사인드 URL 조회 API의 eventId 검증 변경을 명확하게 설명하고 있으며, 변경사항과 직접적으로 관련이 있습니다.
Out of Scope Changes check ✅ Passed S3Service의 validateExistEvent 호출 주석 처리는 제목의 'eventId 검증 변경'과 관련되어 있으며 범위 내 변경으로 보입니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#185

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/main/java/com/permitseoul/permitserver/domain/admin/util/aws/S3Service.java (2)

47-48: 도달할 수 없는 예외 처리 블록입니다.

AdminEventNotFoundExceptionvalidateExistEvent 메서드에서만 발생하는데, 해당 메서드 호출이 주석 처리되어 이 예외가 더 이상 발생하지 않습니다. 따라서 이 catch 블록은 실행될 수 없는 코드입니다.

검증 로직을 복원하지 않는다면, 이 예외 처리 블록도 함께 제거해야 합니다.


54-56: Remove unused validateExistEvent method and AdminEventRetriever dependency.

The validateExistEvent method is dead code—its only call at line 36 is commented out and it's not invoked anywhere else in the codebase. Since this private method is the sole reason for injecting AdminEventRetriever in S3Service, both the method and the dependency should be removed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 853d2e7 and 2d5bb9c.

📒 Files selected for processing (1)
  • src/main/java/com/permitseoul/permitserver/domain/admin/util/aws/S3Service.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: sjk4618
Repo: PERMIT-SEOUL/permit-server PR: 48
File: src/main/java/com/permitseoul/permitserver/domain/guest/core/domain/entity/GuestEntity.java:31-37
Timestamp: 2025-07-15T09:37:32.765Z
Learning: sjk4618 prefers to implement factory methods or public constructors for entities when they are actually needed, rather than creating them proactively.

final List<S3PreSignedUrlRequest.MediaInfoRequest> mediaInfoRequests) {
try {
validateExistEvent(eventId);
// validateExistEvent(eventId);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the file exists and get relevant sections
wc -l src/main/java/com/permitseoul/permitserver/domain/admin/util/aws/S3Service.java

Repository: PERMIT-SEOUL/permit-server

Length of output: 152


🏁 Script executed:

cat -n src/main/java/com/permitseoul/permitserver/domain/admin/util/aws/S3Service.java

Repository: PERMIT-SEOUL/permit-server

Length of output: 4642


🏁 Script executed:

# Check the controller or API layer that calls this service
echo "=== Admin API or Controller layer ==="
fd -e java -path "*/admin/*api*" -o -path "*/admin/*controller*"

Repository: PERMIT-SEOUL/permit-server

Length of output: 293


🏁 Script executed:

# Search more broadly for where S3Service is used
rg -n 'S3Service|getS3PreSignedUrls' --type java

Repository: PERMIT-SEOUL/permit-server

Length of output: 874


🏁 Script executed:

# Search for eventId validation in the admin domain
rg -n 'validateEventExist|validateExist.*event|eventId.*valid' --type java -B 3 -A 3 | head -100

Repository: PERMIT-SEOUL/permit-server

Length of output: 5017


🏁 Script executed:

# Also check if there's an aspect or interceptor that validates eventId
echo "=== Search for Aspect or Interceptor related to admin eventId ==="
rg -n '@Aspect|@Component|Interceptor' --type java src/main/java/com/permitseoul/permitserver/domain/admin/ -A 5 | head -80

Repository: PERMIT-SEOUL/permit-server

Length of output: 11789


🏁 Script executed:

head -60 src/main/java/com/permitseoul/permitserver/domain/admin/base/api/controller/AdminController.java

Repository: PERMIT-SEOUL/permit-server

Length of output: 1904


Remove commented-out eventId validation or provide clear justification for its removal.

Commenting out validateExistEvent(eventId) on line 36 creates critical issues:

  • Pre-signed URLs are generated for non-existent events, leading to orphaned S3 objects disconnected from the database
  • Arbitrary eventId values can be used to upload files without validation
  • Data integrity between the database and S3 is compromised
  • The validateExistEvent method (lines 54-56) becomes unused dead code
  • The AdminEventNotFoundException catch block (line 47) becomes unreachable

If validation has been moved elsewhere in the call chain (controller, aspect, or interceptor), explicitly document that. Otherwise, restore the validation call. The PR title indicates "검증 변경" (validation change) rather than removal—please clarify the intent.

🤖 Prompt for AI Agents
In
src/main/java/com/permitseoul/permitserver/domain/admin/util/aws/S3Service.java
around line 36, the call to validateExistEvent(eventId) has been commented out
causing missing event existence validation and dead code/unreachable exception
handling; restore the validateExistEvent(eventId) call at that location to
re-enable event existence checks (and remove or repurpose the now-unnecessary
AdminEventNotFoundException catch if it becomes redundant), or if validation was
intentionally moved elsewhere, add a clear comment and Javadoc noting where and
why validation occurs (including a link to the controller/aspect/interceptor)
and remove the unused validateExistEvent method and unreachable catch block to
keep code clean.

@sjk4618 sjk4618 merged commit e8b7604 into dev Dec 8, 2025
2 checks passed
@sjk4618 sjk4618 deleted the feat/#185 branch December 8, 2025 12:24
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.

fix: s3 프리사인드 조회 api eventId 관련 수정

2 participants