Skip to content

fix(storage): fail closed on unknown artifact-store modes - #388

Open
seonghobae wants to merge 7 commits into
mainfrom
fix/artifact-store-mode-fail-closed-20260811
Open

fix(storage): fail closed on unknown artifact-store modes#388
seonghobae wants to merge 7 commits into
mainfrom
fix/artifact-store-mode-fail-closed-20260811

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Objective

Reject unsupported clearfolio.artifact-store.mode values instead of silently treating every non-in-memory token as filesystem storage. Protected main currently retains arbitrary values such as cloud; ArtifactStoreConfig then falls through to the filesystem implementation. A typo or unsupported external-store configuration can therefore boot successfully while persisting artifacts somewhere materially different from the operator's stated intent.

Test-first state

Protected main was independently resolved at exact 55d7ae8647208e301f282350f076eeddaba61d11. This Draft starts intentionally RED at exact test-only head aadf4889535e74dec22f4bf7c1ea80591fd06640, directly based on that baseline.

ArtifactStorePropertiesTest.setModeRejectsUnknownStorageModes requires an unsupported normalized mode to throw a controlled IllegalArgumentException and leave the secure filesystem default unchanged. Protected main currently accepts cloud, so the focused regression is expected to fail before the production repair.

Scope

Only artifact-store mode validation and focused regression coverage. It does not change artifact bytes, filesystem write/rollback logic owned by active PR #355, tenant authority, signed links, deletion lifecycle, or external credential/identity work.

Acceptance

Observe exact-head RED -> smallest production validation -> exact-head mvn -B --no-transfer-progress verify with zero failures/errors/skips, exact owned-production coverage and strict Javadocs -> CI/Security Scan/SAST/fuzz -> current reviews/threads/live-base refetch. Keep Draft until the unchanged exact implementation head is GREEN. Qualifying independent non-author approval remains a separate protected-merge gate.

Summary by CodeRabbit

  • 버그 수정
    • 아티팩트 저장소 모드 입력을 자동으로 정규화합니다.
    • 지원되지 않는 모드나 NUL 문자가 포함된 입력은 오류로 처리합니다.
    • 빈 모드 입력은 기본값인 파일 시스템 저장소로 설정됩니다.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e4aa4345-5cb3-4593-a3a3-fcfe31054775

📥 Commits

Reviewing files that changed from the base of the PR and between 2e76ab8 and 7efb30f.

📒 Files selected for processing (1)
  • src/main/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java
📝 Walkthrough

Walkthrough

Artifact store 모드 설정이 입력을 정규화하고 허용된 모드만 저장하도록 변경되었습니다. NUL 문자와 알 수 없는 모드는 IllegalArgumentException을 발생시키며, 관련 테스트가 추가되었습니다.

Changes

Artifact store 모드 검증

Layer / File(s) Summary
모드 정규화와 예외 검증
src/main/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java, src/test/java/com/clearfolio/viewer/config/ArtifactStorePropertiesTest.java
setMode는 입력을 정규화합니다. 빈 값과 null에는 filesystem을 적용합니다. filesystemin-memory 외의 값 및 NUL 문자는 IllegalArgumentException을 발생시킵니다. 테스트는 명시적 FILESYSTEM 설정과 예외 동작을 검증합니다.

Estimated code review effort: 2 (Simple) | ~10분

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 지원되지 않는 artifact-store 모드를 거부하는 주요 변경 사항을 명확하고 간결하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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/artifact-store-mode-fail-closed-20260811

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.

@seonghobae
seonghobae marked this pull request as ready for review August 11, 2026 15:07
@seonghobae
seonghobae enabled auto-merge (squash) August 11, 2026 19:30

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java`:
- Around line 59-60: Update the validation in ArtifactStoreProperties to throw
the unsupported-mode exception with only the generic message "unsupported
artifact store mode"; do not concatenate sanitized or any user-provided value,
preserving the existing validation behavior.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fd6c340-d75c-4b5f-90ea-3cee00cdb481

📥 Commits

Reviewing files that changed from the base of the PR and between 55d7ae8 and 2e76ab8.

📒 Files selected for processing (2)
  • src/main/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java
  • src/test/java/com/clearfolio/viewer/config/ArtifactStorePropertiesTest.java

Comment thread src/main/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java Outdated
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.

1 participant