Skip to content

hotfix: 영양사 페이지 이미지 다운로드 실패 수정 (main)#2287

Merged
kongwoojin merged 3 commits into
mainfrom
fix/2286-check-image-url-is-s3
Jun 10, 2026
Merged

hotfix: 영양사 페이지 이미지 다운로드 실패 수정 (main)#2287
kongwoojin merged 3 commits into
mainfrom
fix/2286-check-image-url-is-s3

Conversation

@kongwoojin

@kongwoojin kongwoojin commented Jun 10, 2026

Copy link
Copy Markdown
Member

🔍 개요

  • 영양사 페이지 식단 이미지 다운로드 실패를 수정했습니다.

🚀 주요 변경 내용

  • 영양사 페이지에서 이미지 다운로드 시, image_url 에 저장된 이미지 주소 (https://static.koreatech.in/upload/COOP/연/월/일/이미지_경로.jpg) 를 가져와 extractS3KeyFrom()를 호출해 key 값을 가져오게 됩니다. 이 경우 key 값은 upload/COOP/연/월/일/이미지_경로.jpg가 됩니다.
  • 하지만, 천원의 아침 대표 이미지의 경우, image_urlhttps://static.koreatech.in/dining/천원의아침.png기 때문에, extractS3KeyFrom()를 호출 할 경우 dining/천원의아침.png를 key 값으로 파싱하게 되고, 이는 S3 상에 없는 key이기 때문에 Error Code: NoSuchKey;가 발생하게 됩니다.
  • 한글 인코딩 문제가 더 맞는 것 같습니다. 다른 경로에 업로드 되어 있었네요.
  • https://static.koreatech.in/dining/천원의아침.png에서 key 추출 후 dining/천원의아침.png가 아닌 dining/%EC%B2%9C%EC%9B%90%EC%9D%98%EC%95%84%EC%B9%A8.png를 반환하던 것이 문제 같습니다.

💬 참고 사항

  • 로컬 환경 구축 방법을 몰라서 테스트까지는 못했습니다. 나중에 알려주신다면 감사하겠습니다.

✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • Bug Fixes
    • Improved dining image handling by refining the validation criteria used to filter image sources, ensuring only properly designated images are processed and downloaded.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR tightens the S3 image URL filtering condition in the dining ZIP generation method. Previously, any URL starting with the S3 domain prefix was accepted; now only URLs matching the full prefix including the /upload/ path segment are processed, ensuring images are only downloaded from the intended S3 directory.

Changes

Dining Image Download Fix

Layer / File(s) Summary
S3 image URL filter tightening
src/main/java/in/koreatech/koin/domain/coop/service/CoopService.java
The image URL inclusion check in generateZipFileOf is adjusted to require URLs starting with domainUrlPrefix + "upload/" instead of only the domain prefix, restricting downloads to the designated S3 upload directory.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A single line tweak, precise and lean,
Filters the uploads, keeps paths clean,
S3 uploads now properly screened,
Dining images as intended! 🥗✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code changes directly address issue #2286 by fixing the image download failure by adding the 'upload/' path condition to prevent S3 key extraction for non-S3 URLs.
Out of Scope Changes check ✅ Passed The single-line change (tightening the filter for S3 image URL validation) is directly scoped to the linked issue and does not introduce unrelated modifications.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: fixing image download failures on the nutritionist page by tightening the S3 URL filter to require the /upload/ path prefix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/2286-check-image-url-is-s3

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.

@github-actions github-actions Bot added the 버그 정상적으로 동작하지 않는 문제상황입니다. label Jun 10, 2026
@github-actions github-actions Bot requested a review from JanooGwan June 10, 2026 07:25
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Unit Test Results

671 tests   668 ✔️  1m 23s ⏱️
168 suites      3 💤
168 files        0

Results for commit f6364d1.

♻️ This comment has been updated with latest results.

@kongwoojin kongwoojin force-pushed the fix/2286-check-image-url-is-s3 branch from b4baf59 to 94e6e71 Compare June 10, 2026 07:43
@kongwoojin kongwoojin force-pushed the fix/2286-check-image-url-is-s3 branch from 5ac6a00 to 07e1836 Compare June 10, 2026 07:53
@kongwoojin kongwoojin changed the base branch from develop to main June 10, 2026 07:53
@kongwoojin kongwoojin changed the title fix: 영양사 페이지 이미지 다운로드 실패 수정 hotfix: 영양사 페이지 이미지 다운로드 실패 수정 (main) Jun 10, 2026
@kongwoojin kongwoojin merged commit b2c5549 into main Jun 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 정상적으로 동작하지 않는 문제상황입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[공통] 영양사 페이지 이미지 다운로드 실패 수정

3 participants