chore: bump version to 0.13.0#110
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (18)
📝 WalkthroughWalkthroughターミナル状態のラン削除機能を追加。新オプション Changes
Sequence Diagram(s)sequenceDiagram
participant Worker
participant Durably
participant Store
participant DB
Worker->>Durably: processOne()
Durably->>Store: claimNext(workerId, now, leaseMs)
alt run claimed
Store-->>Durably: Run
Durably->>Worker: execute run
else no run available
Durably->>Store: purgeRuns({ olderThan, limit? })
Store->>DB: select terminal runs olderThan
DB-->>Store: list of run ids
Store->>DB: delete steps/logs/labels then runs (cascadeDeleteRuns)
Store-->>Durably: numberDeleted
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 (2)
packages/durably/docs/llms.md (1)
233-246: purge が関連データも削除することを明記したいです。実装側の
packages/durably/src/storage.tsLine 366 から Line 377 のcascadeDeleteRuns()は、run 本体だけでなく steps・logs・labels も削除します。preserveSteps: trueを使う読者向けに、その挙動をこの節に 1 文入れておくと API 説明が実装と揃います。📝 追記例
Batch-delete terminal runs (completed, failed, cancelled) older than a cutoff date. Pending and leased runs are never deleted. +Purging a run also removes its associated steps, logs, and labels.As per coding guidelines, "Update
packages/durably/docs/llms.mdto keep API documentation in sync when API changes are made".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/durably/docs/llms.md` around lines 233 - 246, The docs for purgeRuns should note that the implementation uses cascadeDeleteRuns which removes not only run records but also associated steps, logs, and labels; update the Purge Old Runs section to add a sentence after the example stating that purgeRuns cascades deletion of related steps, logs, and labels and that callers can pass preserveSteps: true to retain step records (while logs/labels remain deleted) to match the behavior of cascadeDeleteRuns and the purgeRuns API.packages/durably/tests/shared/purge.shared.ts (1)
94-105: テスト名が実際の検証内容より広いです。ここでは worker を起動していないので
pendingしか作れておらず、leasedが purge 対象外であることは未検証です。ケース名をpendingに絞るか、別テストで実際に lease 済み run を作って確認したいです。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/durably/tests/shared/purge.shared.ts` around lines 94 - 105, The test name is too broad—since no worker is started this only creates a pending run, not a leased run; either change the it() description to "does NOT delete pending runs" or add a separate test that actually creates a leased run by starting a worker, claiming/starting the run (using durably.register / d.jobs.testJob.trigger and a worker process) and then calling d.purgeRuns({ olderThan }) to assert the leased run is not deleted; ensure the references to d.purgeRuns, d.getRun, and the run created by d.jobs.testJob.trigger are used in the new/updated test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/durably/tests/shared/purge.shared.ts`:
- Around line 237-271: The test is flaky because the first idle purge may run
before you backdate completed_at; to fix, ensure the run is backdated before the
next purge window or force the purge timer to be eligible immediately: after
creating/migrating the Durably instance (createDurably -> d) but before waiting
for auto-purge, set the instance's purge timestamp so a purge can run
immediately (e.g. set d.lastPurgeAt to Date.now() - PURGE_INTERVAL_MS or
expose/use a hook to set lastPurgeAt/clock), or alternatively move the DB update
that backdates completed_at to occur before calling d.start() so the initial
purge will consider the run expired.
In `@website/api/create-durably.md`:
- Around line 153-164: Update the purgeRuns() docs to clarify the differing
defaults: state that the purgeRuns(options) API has a default limit of 1000 when
called manually, but the automatic purge triggered by the retainRuns option uses
a hard-coded limit of 100 (see the auto-purge call in durably.ts that invokes
purgeRuns with limit: 100); mention both behaviors and recommend explicitly
passing a limit when calling purgeRuns() if callers want parity with the
automatic retention behavior.
---
Nitpick comments:
In `@packages/durably/docs/llms.md`:
- Around line 233-246: The docs for purgeRuns should note that the
implementation uses cascadeDeleteRuns which removes not only run records but
also associated steps, logs, and labels; update the Purge Old Runs section to
add a sentence after the example stating that purgeRuns cascades deletion of
related steps, logs, and labels and that callers can pass preserveSteps: true to
retain step records (while logs/labels remain deleted) to match the behavior of
cascadeDeleteRuns and the purgeRuns API.
In `@packages/durably/tests/shared/purge.shared.ts`:
- Around line 94-105: The test name is too broad—since no worker is started this
only creates a pending run, not a leased run; either change the it() description
to "does NOT delete pending runs" or add a separate test that actually creates a
leased run by starting a worker, claiming/starting the run (using
durably.register / d.jobs.testJob.trigger and a worker process) and then calling
d.purgeRuns({ olderThan }) to assert the leased run is not deleted; ensure the
references to d.purgeRuns, d.getRun, and the run created by
d.jobs.testJob.trigger are used in the new/updated test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9bf4ceb4-f219-4a52-85e4-6f22c497ada0
📒 Files selected for processing (15)
CHANGELOG.mdCLAUDE.mdpackages/durably-react/package.jsonpackages/durably/docs/llms.mdpackages/durably/package.jsonpackages/durably/src/durably.tspackages/durably/src/migrations.tspackages/durably/src/storage.tspackages/durably/tests/node/migration-consolidated.test.tspackages/durably/tests/node/purge.test.tspackages/durably/tests/shared/purge.shared.tspackages/durably/tests/shared/storage.shared.tswebsite/api/create-durably.mdwebsite/api/index.mdwebsite/public/llms.txt
💤 Files with no reviewable changes (1)
- packages/durably/tests/shared/storage.shared.ts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- vite 7→8, @vitejs/plugin-react 5→6 (Rolldown-based) - jsdom 28→29 - vitest 4.0→4.1, better-sqlite3 12.6→12.8, kysely 0.28.11→0.28.12 - biome, turbo, lefthook, @types/node and other patch bumps - Replace vite-tsconfig-paths plugin with native resolve.tsconfigPaths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Emit worker:error event on auto-purge failure instead of swallowing - Lower purgeRuns default limit from 1000 to 500 to stay within SQLite's SQLITE_MAX_VARIABLE_NUMBER (999) on older builds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix "see Quick Start" → "see Core Concepts" cross-reference in llms.md - Add empty array guard in cascadeDeleteRuns for defensive safety Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace timing-dependent polling loop with direct processOne() calls to eliminate race between idle purge and completed_at backdate - Clarify that auto-purge uses batch size of 100 vs manual default of 500 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4b14dd1 to
5fd9684
Compare
Summary
@coji/durablyand@coji/durably-reactfrom 0.12.0 → 0.13.0Changes since v0.12.0
purgeRunsAPI +retainRunsoption (feat: add purgeRuns API and retainRuns auto-cleanup option #109)getRunsfrom polling hot path (feat: add purgeRuns API and retainRuns auto-cleanup option #109)Test plan
pnpm validatepasses (25/25 tasks)pnpm publish🤖 Generated with Claude Code
Summary by CodeRabbit
v0.13.0 リリースノート
新機能
パフォーマンス
ドキュメント