Skip to content

[RELEASE] 2026-08-11 / v1.0.2 - #160

Merged
taerimiiii merged 11 commits into
mainfrom
develop
Aug 11, 2026
Merged

[RELEASE] 2026-08-11 / v1.0.2#160
taerimiiii merged 11 commits into
mainfrom
develop

Conversation

@taerimiiii

@taerimiiii taerimiiii commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🔗 이슈 번호

📝 작업 내용

  • v1.0.2 배포

📸 스크린샷 (선택)

  • 변경 사항

    • 버전을 v1.0.2로 릴리스합니다.
    • EventPreviewRequestEventPreviewResponsetemp_event_iddraft_revision을 추가했습니다.
    • 임시 이벤트 ID를 생성하고 미리보기 응답에 전달합니다.
    • RevisionGuardService를 추가했습니다. Valkey의 최신 일정 revision을 확인합니다.
    • 추천 파이프라인의 각 처리 단계 전후에 revision을 검증합니다.
    • 최신 revision보다 오래된 요청은 STALE_DRAFT_REVISION_409 오류로 중단합니다.
  • 변경 이유

    • 최신 일정 입력이 존재할 때 이전 추천 요청이 실행되지 않도록 방지합니다.
    • 미리보기와 추천 요청 간의 일정 revision을 추적합니다.
  • 호환성

    • EventPreviewResponsetemp_event_iddraft_revision 필드가 추가되었습니다.
    • RecommendationServiceget_recommendation_service의 생성자 및 의존성 인자가 변경되었습니다.
    • 기존 호출부는 새 필드와 의존성에 맞게 수정해야 합니다.
  • 테스트

    • 임시 이벤트 ID 생성 및 재사용을 검증했습니다.
    • revision 값의 정상, 0, 음수 입력을 검증했습니다.
    • 추천 처리 전후의 오래된 revision 차단을 검증했습니다.

@taerimiiii taerimiiii self-assigned this Aug 10, 2026
@taerimiiii taerimiiii added the release 배포 label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

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 @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: d1d502c1-183c-407b-a581-8d05ef8651df

📥 Commits

Reviewing files that changed from the base of the PR and between d206126 and 9b83fc0.

📒 Files selected for processing (4)
  • app/services/event_preview_service.py
  • app/services/parser_service.py
  • tests/test_event_preview_service.py
  • tests/test_parser_service.py
📝 Walkthrough

Walkthrough

The 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.

Changes

Draft revision freshness

Layer / File(s) Summary
Preview metadata propagation
app/schemas/event_preview.py, app/services/event_preview_service.py, tests/test_event_preview_service.py
Preview requests accept temp_event_id and draft_revision. Responses return both fields. The service reuses valid IDs or generates tmp_-prefixed UUIDs.
Valkey revision guard
app/core/error_code.py, app/services/recommendation/revision_guard_service.py
RevisionGuardService reads the latest revision from Valkey and raises STALE_DRAFT_REVISION_409 when the request is outdated.
Recommendation pipeline integration
app/core/deps.py, app/services/recommendation/recommendation_service.py, tests/test_recommendation_service.py
FastAPI wiring injects RevisionGuardService. RecommendationService checks revision freshness before processing and after each pipeline stage. Tests cover initial and mid-pipeline staleness.

Possibly related PRs

  • tryna-team/brain#149: Directly overlaps with the revision-guarded recommendation pipeline and conflict handling.
  • tryna-team/brain#155: Introduces the same draftRevision propagation extended by this change.
  • tryna-team/brain#158: Introduces the same temporary event ID handling extended by this change.

Suggested reviewers: taehyeon1998

🚥 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 The title clearly identifies the v1.0.2 release and matches the linked release objective.
Linked Issues check ✅ Passed The pull request title and stated objective match issue #159, which requests deployment of v1.0.2.
Out of Scope Changes check ✅ Passed The changes are presented as part of the v1.0.2 release, and no unrelated changes are identifiable from the provided context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 develop

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.

@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

🧹 Nitpick comments (1)
app/services/recommendation/revision_guard_service.py (1)

24-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add direct tests for RevisionGuardService.

The supplied recommendation tests replace the guard with Mock. They do not test key lookup, invalid stored values, Valkey errors, or STALE_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

📥 Commits

Reviewing files that changed from the base of the PR and between ed3aef4 and d206126.

📒 Files selected for processing (8)
  • app/core/deps.py
  • app/core/error_code.py
  • app/schemas/event_preview.py
  • app/services/event_preview_service.py
  • app/services/recommendation/recommendation_service.py
  • app/services/recommendation/revision_guard_service.py
  • tests/test_event_preview_service.py
  • tests/test_recommendation_service.py

Comment on lines +30 to +33
stored_revision = client.get(self.build_key(temp_event_id))
if stored_revision is None:
return
latest_revision = int(stored_revision)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ 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*\(' app

Repository: 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 tests

Repository: 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/services

Repository: 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.

@taerimiiii
taerimiiii merged commit 29502a3 into main Aug 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release 배포

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants