🔀 :: [#825] - 볼륨 파일 업로드 API 추가 - #826
Conversation
|
Warning Review limit reached
Next review available in: 35 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Walkthrough볼륨 파일 업로드 기능이 추가되었습니다. 경로 검증, Docker 볼륨 경로 확인, 파일 기록, 인증된 HTTP 엔드포인트와 웹 어댑터 테스트가 포함됩니다. Changes볼륨 파일 업로드
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant SecurityConfig
participant VolumeWebAdapter
participant UploadVolumeFileUseCase
participant DockerVolumeFileStorageAdapter
participant FileOperationAdapter
Client->>SecurityConfig: POST /{workspaceId}/volume/{volumeId}/files
SecurityConfig->>VolumeWebAdapter: 인증된 멀티파트 요청 전달
VolumeWebAdapter->>UploadVolumeFileUseCase: execute(volumeId, path, file, createDirectory)
UploadVolumeFileUseCase->>DockerVolumeFileStorageAdapter: 대상 경로 확인
DockerVolumeFileStorageAdapter-->>UploadVolumeFileUseCase: Path 반환
UploadVolumeFileUseCase->>FileOperationAdapter: ByteArray 파일 기록
FileOperationAdapter-->>UploadVolumeFileUseCase: 기록 완료
UploadVolumeFileUseCase-->>VolumeWebAdapter: 업로드 완료
VolumeWebAdapter-->>Client: 200 OK
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/main/kotlin/com/dcd/server/infrastructure/domain/volume/adapter/DockerVolumeFileStorageAdapter.kt (1)
1-13: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win어댑터를 feature 경로로 이동해야 합니다.
현재 파일은
infrastructure/domain/volume/adapter/에 있습니다. 규칙은 feature 전용 어댑터를infrastructure/{feature}/adapter/에 두도록 요구합니다.infrastructure/volume/adapter/로 이동하고 패키지 참조를 갱신하세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/kotlin/com/dcd/server/infrastructure/domain/volume/adapter/DockerVolumeFileStorageAdapter.kt` around lines 1 - 13, Move DockerVolumeFileStorageAdapter from the domain-nested infrastructure package to the feature-specific infrastructure/volume/adapter location, update its package declaration accordingly, and adjust all imports or references to the adapter while preserving its existing implementation.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/kotlin/com/dcd/server/core/domain/volume/usecase/UploadVolumeFileUseCase.kt`:
- Around line 35-37: Update the early-return validation in
UploadVolumeFileUseCase so only a missing multipart file part is rejected, while
a present 0-byte file continues through directory creation and is persisted with
writeFileByBytes using an empty byte array. Preserve the existing successful
response behavior for valid files.
In
`@src/main/kotlin/com/dcd/server/infrastructure/domain/volume/adapter/DockerVolumeFileStorageAdapter.kt`:
- Around line 20-32: Update resolveTargetPath to prevent symlink-based volume
escapes, rather than only filtering "." and "..". Validate each existing path
component under resolveVolumeRootPath(volume) with NOFOLLOW_LINKS (or use an
equivalent directory-file-descriptor-based atomic write strategy), and reject
any path resolving outside rootPath before Files.write can follow an internal
symlink.
---
Nitpick comments:
In
`@src/main/kotlin/com/dcd/server/infrastructure/domain/volume/adapter/DockerVolumeFileStorageAdapter.kt`:
- Around line 1-13: Move DockerVolumeFileStorageAdapter from the domain-nested
infrastructure package to the feature-specific infrastructure/volume/adapter
location, update its package declaration accordingly, and adjust all imports or
references to the adapter while preserving its existing implementation.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 431ff6cf-6f33-4628-9d1c-4ad46da8e03e
📒 Files selected for processing (11)
src/main/kotlin/com/dcd/server/core/common/error/ErrorCode.ktsrc/main/kotlin/com/dcd/server/core/common/file/spi/FileOperationPort.ktsrc/main/kotlin/com/dcd/server/core/domain/volume/exception/InvalidVolumeFilePathException.ktsrc/main/kotlin/com/dcd/server/core/domain/volume/exception/VolumeUploadFailureException.ktsrc/main/kotlin/com/dcd/server/core/domain/volume/spi/VolumeFileStoragePort.ktsrc/main/kotlin/com/dcd/server/core/domain/volume/usecase/UploadVolumeFileUseCase.ktsrc/main/kotlin/com/dcd/server/infrastructure/domain/volume/adapter/DockerVolumeFileStorageAdapter.ktsrc/main/kotlin/com/dcd/server/infrastructure/global/adapter/FileOperationAdapter.ktsrc/main/kotlin/com/dcd/server/infrastructure/global/config/SecurityConfig.ktsrc/main/kotlin/com/dcd/server/presentation/domain/volume/VolumeWebAdapter.ktsrc/test/kotlin/com/dcd/server/presentation/domain/volume/VolumeWebAdapterTest.kt
개요
작업내용
체크리스트
Summary by CodeRabbit
새로운 기능
버그 수정