[RELEASE] 2026-08-11 / v1.0.2 - #160
Conversation
…sion [FEAT] 일정 미리보기 draftRevision 필드 추가
…sion-guard [REFACTOR] draftRevision 기반 추천 파이프라인 중단 처리
…p-id [FEAT] 일정 미리보기 tempEnventId 유지 처리
|
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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe change adds temporary event ID and draft revision metadata to event previews. It introduces Valkey-backed revision checks and applies them throughout the recommendation pipeline. Dependency wiring, conflict handling, and tests are updated. ChangesDraft revision freshness
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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: 1
🧹 Nitpick comments (1)
app/services/recommendation/revision_guard_service.py (1)
24-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd direct tests for
RevisionGuardService.The supplied recommendation tests replace the guard with
Mock. They do not test key lookup, invalid stored values, Valkey errors, orSTALE_DRAFT_REVISION_409. Add focused tests for these cases.🤖 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 `@app/services/recommendation/revision_guard_service.py` around lines 24 - 51, Add focused tests for RevisionGuardService.ensure_current covering missing keys, valid current revisions, stale draft revisions raising STALE_DRAFT_REVISION_409, invalid stored values, Valkey errors, and a missing client. Assert the expected return, exception, and logging/continuation behavior without replacing the guard with a Mock.
🤖 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 `@app/services/recommendation/revision_guard_service.py`:
- Around line 30-33: Update RevisionGuardService.ensure_current around build_key
and the stored_revision lookup to persist each incoming revision when it is
newer than the stored value, using an atomic monotonic compare-and-update
operation. Ensure the key tryna:recommendation:latest-revision:<temp_event_id>
is initialized for missing values and never decreases, while preserving the
existing stale-request guard behavior.
---
Nitpick comments:
In `@app/services/recommendation/revision_guard_service.py`:
- Around line 24-51: Add focused tests for RevisionGuardService.ensure_current
covering missing keys, valid current revisions, stale draft revisions raising
STALE_DRAFT_REVISION_409, invalid stored values, Valkey errors, and a missing
client. Assert the expected return, exception, and logging/continuation behavior
without replacing the guard with a Mock.
🪄 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: 6a27cbfd-9b2b-4184-ba2b-54f01db373f4
📒 Files selected for processing (8)
app/core/deps.pyapp/core/error_code.pyapp/schemas/event_preview.pyapp/services/event_preview_service.pyapp/services/recommendation/recommendation_service.pyapp/services/recommendation/revision_guard_service.pytests/test_event_preview_service.pytests/test_recommendation_service.py
| stored_revision = client.get(self.build_key(temp_event_id)) | ||
| if stored_revision is None: | ||
| return | ||
| latest_revision = int(stored_revision) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
# Map the relevant service definitions before inspecting call sites.
ast-grep outline app/services --items all --type class,function --match 'Revision|Preview|Event'
# Find all uses of the revision-key namespace and key builder.
rg -n -C 5 'LATEST_REVISION_KEY_PREFIX|tryna:recommendation:latest-revision|build_key\s*\(' app tests
# Find likely Valkey writes in application code.
rg -n -P -C 5 '\b\w+\.(set|setex|psetex|mset|incr|incrby)\s*\(' appRepository: tryna-team/brain
Length of output: 2907
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '--- revision guard ---'
cat -n app/services/recommendation/revision_guard_service.py
printf '%s\n' '--- preview service ---'
cat -n app/services/event_preview_service.py
printf '%s\n' '--- revision-related identifiers ---'
rg -n -i -C 4 'revision|temp_event_id|draft' app testsRepository: tryna-team/brain
Length of output: 50372
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
files = [Path(p) for p in __import__("subprocess").check_output(
["git", "ls-files"], text=True
).splitlines()]
key_hits = []
write_hits = []
revision_hits = []
for path in files:
try:
text = path.read_text()
except (UnicodeDecodeError, OSError):
continue
if "latest-revision" in text or "LATEST_REVISION_KEY_PREFIX" in text:
key_hits.append((str(path), [
f"{i}: {line}" for i, line in enumerate(text.splitlines(), 1)
if "latest-revision" in line or "LATEST_REVISION_KEY_PREFIX" in line
]))
for i, line in enumerate(text.splitlines(), 1):
if re.search(r"\.(?:set|setex|psetex|mset|incr|incrby)\s*\(", line):
write_hits.append((str(path), i, line.strip()))
if re.search(r"\b(?:draft_revision|temp_event_id|revision)\b", line, re.I):
revision_hits.append((str(path), i, line.strip()))
print("KEY REFERENCES")
for path, hits in key_hits:
print(path)
print("\n".join(hits))
print("\nVALKEY-LIKE WRITE CALLS")
for item in write_hits:
print(":".join(map(str, item)))
print("\nREVISION/TEMP-ID WRITE-CONTEXT CANDIDATES")
for path, line, text in revision_hits:
if re.search(r"\b(?:set|write|save|update|persist|incr|revision)\b", text, re.I):
print(f"{path}:{line}: {text}")
PY
printf '%s\n' '--- route wiring ---'
rg -n -C 3 'preview_event|run_pipeline|event_preview|recommendations' app/api app/core app/servicesRepository: tryna-team/brain
Length of output: 6531
Persist each newer draft revision before recommendation requests.
No application path writes tryna:recommendation:latest-revision:<temp_event_id>. Therefore, ensure_current bypasses stale requests because the key is absent. Add an atomic monotonic update for each newer revision.
🤖 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 `@app/services/recommendation/revision_guard_service.py` around lines 30 - 33,
Update RevisionGuardService.ensure_current around build_key and the
stored_revision lookup to persist each incoming revision when it is newer than
the stored value, using an atomic monotonic compare-and-update operation. Ensure
the key tryna:recommendation:latest-revision:<temp_event_id> is initialized for
missing values and never decreases, while preserving the existing stale-request
guard behavior.
🔗 이슈 번호
📝 작업 내용
📸 스크린샷 (선택)
변경 사항
v1.0.2로 릴리스합니다.EventPreviewRequest와EventPreviewResponse에temp_event_id와draft_revision을 추가했습니다.RevisionGuardService를 추가했습니다. Valkey의 최신 일정 revision을 확인합니다.STALE_DRAFT_REVISION_409오류로 중단합니다.변경 이유
호환성
EventPreviewResponse에temp_event_id와draft_revision필드가 추가되었습니다.RecommendationService와get_recommendation_service의 생성자 및 의존성 인자가 변경되었습니다.테스트