Skip to content

chore: bump version to 0.13.0#110

Merged
coji merged 5 commits into
mainfrom
chore/bump-v0.13.0
Mar 16, 2026
Merged

chore: bump version to 0.13.0#110
coji merged 5 commits into
mainfrom
chore/bump-v0.13.0

Conversation

@coji
Copy link
Copy Markdown
Owner

@coji coji commented Mar 16, 2026

Summary

  • Bump @coji/durably and @coji/durably-react from 0.12.0 → 0.13.0
  • Add CHANGELOG entry covering all changes since v0.12.0

Changes since v0.12.0

Test plan

  • pnpm validate passes (25/25 tasks)
  • Merge → create GitHub release → pnpm publish

🤖 Generated with Claude Code

Summary by CodeRabbit

v0.13.0 リリースノート

  • 新機能

    • 古いターミナルランの自動クリーンアップを設定する retainRuns オプションを追加
    • ターミナルランを一括削除する purgeRuns API を追加
    • 個別ランと関連データを削除する deleteRun API を追加
  • パフォーマンス

    • ラン照会の高速化のためのデータベースインデックスを追加
  • ドキュメント

    • 新しい実行管理オプションと API の使用方法をドキュメントに追加

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
durably-demo Ready Ready Preview Mar 16, 2026 8:30am
durably-demo-vercel-turso Ready Ready Preview Mar 16, 2026 8:30am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 16, 2026

Warning

Rate limit exceeded

@coji has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bee8d4ca-1f86-45ef-922b-cb9e6d9e80b2

📥 Commits

Reviewing files that changed from the base of the PR and between aceebf8 and 5fd9684.

⛔ Files ignored due to path filters (2)
  • packages/durably-react/.vitest-attachments/b3830b0f82286f4a00c903c5c00844704da370a7.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • CHANGELOG.md
  • examples/fullstack-react-router/package.json
  • examples/fullstack-react-router/vite.config.ts
  • examples/fullstack-vercel-turso/package.json
  • examples/fullstack-vercel-turso/vite.config.ts
  • examples/server-node/package.json
  • examples/spa-react-router/package.json
  • examples/spa-react-router/vite.config.ts
  • examples/spa-vite-react/package.json
  • package.json
  • packages/durably-react/package.json
  • packages/durably/docs/llms.md
  • packages/durably/package.json
  • packages/durably/src/durably.ts
  • packages/durably/src/storage.ts
  • packages/durably/tests/shared/purge.shared.ts
  • website/api/create-durably.md
  • website/public/llms.txt
📝 Walkthrough

Walkthrough

ターミナル状態のラン削除機能を追加。新オプション retainRuns による自動パージと公開メソッド purgeRuns を実装し、ストレージ層の cascade 削除、マイグレーションのインデックス追加、関連テストとドキュメントを追加または更新した。

Changes

Cohort / File(s) Summary
バージョンとChangelog
CHANGELOG.md, packages/durably/package.json, packages/durably-react/package.json
バージョンを 0.12.0 → 0.13.0 に更新。0.13.0 の Unreleased エントリを追加(Breaking/Added/Fixed 等)。
ドキュメント
CLAUDE.md, packages/durably/docs/llms.md, website/api/create-durably.md, website/api/index.md, website/public/llms.txt
retainRuns オプションと purgeRuns メソッドの仕様・例を追加。API サーフェスと説明を更新。
コアランタイム
packages/durably/src/durably.ts
retainRuns?: string を DurablyOptions に追加。期間解析 parseDuration、自動パージ間隔制御、公開メソッド purgeRuns(...) とワーカーのアイドル経路での自動パージ呼び出しを実装。
ストレージ層
packages/durably/src/storage.ts
TERMINAL_STATUSEScascadeDeleteRuns を追加し、ランと関連データ(steps/logs/labels)の連鎖削除を実装。Store インターフェースに purgeRuns(...) を追加。ClaimOptions を削除し claimNext のシグネチャを簡素化。
マイグレーション
packages/durably/src/migrations.ts
durably_runs(status, completed_at) 用インデックス idx_durably_runs_status_completed を追加。
テスト
packages/durably/tests/shared/purge.shared.ts, packages/durably/tests/node/purge.test.ts, packages/durably/tests/node/migration-consolidated.test.ts, packages/durably/tests/shared/storage.shared.ts
purge のユニット/統合テストを追加(手動パージ・自動パージ・limit・関連データ削除等)。concurrencyKey 関連の一部テストを削除。マイグレーションインデックスの存在確認を追加。
例および依存更新
examples/.../package.json, examples/.../vite.config.ts, package.json
複数サンプルとルートの devDependencies を一部更新。vite-tsconfig-paths の除去と resolve.tsconfigPaths: true への移行。

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Poem

🐰 古いラン、そっとさよならを言う、
retainで待ち、purgeで掃く、
ステップもログも連鎖して消え、
DBは軽く、心はぴょんぴょん、
0.13 の野原へ跳ね上がる。 ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title "chore: bump version to 0.13.0" is accurate but only partially describes the changeset. While the version bump is performed, the PR includes substantial feature additions (purgeRuns API, retainRuns option), bug fixes (SSE timing), performance improvements, and documentation updates. The title focuses on the maintenance aspect rather than the primary technical changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/bump-v0.13.0
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/durably/docs/llms.md (1)

233-246: purge が関連データも削除することを明記したいです。

実装側の packages/durably/src/storage.ts Line 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.md to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 22e3faf and 070a5b1.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • CLAUDE.md
  • packages/durably-react/package.json
  • packages/durably/docs/llms.md
  • packages/durably/package.json
  • packages/durably/src/durably.ts
  • packages/durably/src/migrations.ts
  • packages/durably/src/storage.ts
  • packages/durably/tests/node/migration-consolidated.test.ts
  • packages/durably/tests/node/purge.test.ts
  • packages/durably/tests/shared/purge.shared.ts
  • packages/durably/tests/shared/storage.shared.ts
  • website/api/create-durably.md
  • website/api/index.md
  • website/public/llms.txt
💤 Files with no reviewable changes (1)
  • packages/durably/tests/shared/storage.shared.ts

Comment thread packages/durably/tests/shared/purge.shared.ts Outdated
Comment thread website/api/create-durably.md Outdated
coji and others added 5 commits March 16, 2026 17:29
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>
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