T-15 활동 CRUD + 본문 정제 - #69
Open
ff1451 wants to merge 1 commit into
Open
Conversation
- Activity/ActivityImage 엔티티, 관리자 CRUD·페이징·필터(Specification), 순서 변경(월 단위 버킷), 사진 전체 교체 API 구현. - ActivityContentSanitizer: jsoup Safelist로 태그/속성 제한 + img 태그는 별도로 호스트 화이트리스트(image.bcsdlab.com, static.koreatech.in) 검사 후 제거(safelist만으로는 호스트 단위 제한이 안 됨). 저장 시점에만 정제한다(ADR-008). - ActivityImage는 BaseTimeEntity를 상속하지 않는다 — activity_image 테이블에는 updated_at이 없다(사진은 항상 전체 교체로만 다뤄 수정 시각이 필요 없음). - AdminActivityService.getActivities: Specification.where(null)이 새 Spring Data JPA 버전에서 PredicateSpecification 오버로드와 겹쳐 모호해서, null이 아닌 조건만 모아 Specification.allOf(List)로 대체. - AC-3.8: activity_category는 soft delete라 activity FK(RESTRICT)가 행을 막아주지 않는다(행이 물리적으로 남아 있어 위반이 안 남) — AdminActivityCategoryService에서 activityRepository.existsByCategory_Id로 직접 검사. - 같은 IntegrationTestSupport 컨테이너를 공유하는 테스트 정리 순서 버그 수정: activity가 soft delete(@SQLRestriction)라 deleteAll()이 삭제된 행을 못 찾아 물리적으로 남기고, 그 남은 행이 activity_category FK를 계속 참조해 다음 deleteAll()을 막는다. 이미 열려 있는 T-14 PR(#68)의 AdminActivityCategoryIntegrationTest도 T-15부터 같은 컨테이너에 activity 행이 생기면서 새로 취약해져 함께 수정(jdbcTemplate 물리 삭제로 대체). 검증: ./gradlew test 전체 통과 3회 연속.
Author
|
Refs #27 |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Open
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.
요약
img는 safelist만으로 호스트 제한이 안 돼, 정제 후 별도로 허용 호스트(image.bcsdlab.com,static.koreatech.in)가 아닌<img>를 제거한다(INV-10).activity_category는 soft delete라activityFK(RESTRICT)가 삭제를 막아주지 않는다(행이 물리적으로 남아 있어서 위반이 안 남) — 애플리케이션에서existsByCategory_Id로 직접 검사해 409로 막는다.05-api-spec.md 대비 의도적 차이
ActivityCreateRequest/ActivityUpdateRequest에isPublished,imageUrls를 넣지 않았다. 공개 여부는PATCH .../publish, 사진은PUT .../images전체 교체로만 다루는 기존 규약(트랙 페이지/커리큘럼과 동일)을 그대로 따른 것이다.다른 PR(T-14, #68)에 대한 수정
AdminActivityCategoryIntegrationTest가IntegrationTestSupport의 공유 컨테이너를 쓰는데,activity_category.deleteAll()이 soft-delete된(@SQLRestriction으로 걸러진)activity행을 못 지우고 물리적으로 남겨서, 그 행이 FK로 카테고리를 계속 참조해 다음 테스트의 정리(deleteAll)를 막는 문제가 있었다. T-15에서Activity가 같은 컨테이너에 처음 등장하면서 이 잠재 버그가 드러나 이 PR에서 함께 고쳤다(jdbcTemplate 물리 삭제로 대체). T-14 자체 코드는 건드리지 않았다.검증
./gradlew test전체 통과, 3회 연속 재실행으로 공유 컨테이너 순서 의존성 없음 확인.남은 항목
Refs #58 (프로젝트), 브랜치는
feat/t14-activity-category(#68) 위에 스택.머지하지 않습니다. 부원 리뷰 후 직접 머지 예정입니다.