Skip to content

test: IssueStore Durable Object tests via runInDurableObject (test-leg slice 3)#170

Merged
liplus-lin-lay merged 1 commit into
mainfrom
165-test-leg-slice3-do
Jun 21, 2026
Merged

test: IssueStore Durable Object tests via runInDurableObject (test-leg slice 3)#170
liplus-lin-lay merged 1 commit into
mainfrom
165-test-leg-slice3-do

Conversation

@liplus-lin-lay

Copy link
Copy Markdown
Member

概要

#165(テスト脚の復元)スライス3。IssueStore Durable Object(DO 内蔵 SQLite の構造化ストア)を workerd 内で runInDurableObject を使って検証。IssueStore はコンストラクタでスキーマを自己初期化(idempotent CREATE TABLE IF NOT EXISTS)するため migration 不要。

構成

  • 最小エントリ src/test-do-entry.ts が IssueStore のみ re-export → pool が SQLite DO としてバインド。full worker graph(mcp/oauth/pipeline + Vectorize/AI、ローカル emulation 無し)をロードせずに済む。
  • 既存の workers 設定に DO バインディングを追加(D1 と併存)。両 *.workers.test.ts が同一 pool を共有。
  • テストごとにユニーク名の DO インスタンス(idFromName)で storage を分離。

カバレッジ(DO 統合 6 件)

  • issue upsert/get 往復(label/assignee 配列の (de)serialization 含む)
  • ON CONFLICT (repo, number) 冪等 upsert(update、重複行無し)
  • listIssuesByRepo の state フィルタ / updated_at DESC 順 / limit
  • getWatermark/setWatermark 往復 + 空 etag→undefined 正規化(ポーリング watermark の正しさ)

影響範囲

  • src/ の Worker 本体コードは無変更。差分はテスト + 最小エントリ + 設定のみ。挙動変更なし → patch 相当。本 PR では release しない。

残(#165

  • oauth フロー全体 / webhook ルーティング(SELF 統合スタイル)。
  • Vectorize / Workers AI 依存パス(ローカル emulation 不在、remote/コスト要、Master 判断)。

Refs #165

…t-leg slice 3)

Third slice of the CI test leg (#165): the IssueStore Durable Object (DO-embedded
SQLite structured store), tested inside workerd with runInDurableObject. IssueStore
self-initializes its schema in the constructor, so no migration step is needed.

A minimal entry (src/test-do-entry.ts) re-exports only IssueStore so the pool can
bind it as a SQLite DO without loading the full worker graph (mcp/oauth/pipeline +
Vectorize/AI, which have no local emulation). The existing workers config gains the
DO binding alongside the D1 one; both *.workers.test.ts files share the pool.

Covers:
- issue upsert/get round-trip (incl label/assignee array (de)serialization)
- ON CONFLICT (repo, number) idempotent upsert (update, no duplicate)
- listIssuesByRepo state filter / updated_at DESC ordering / limit
- getWatermark/setWatermark round-trip + empty-etag -> undefined normalization

IssueStore(DO 内蔵 SQLite の構造化ストア)を runInDurableObject で実機寄りに検証。
ポーリング watermark の往復も pin した。Vectorize/AI 依存面は引き続き #165 に残置。

Refs #165
@liplus-lin-lay liplus-lin-lay self-assigned this Jun 21, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
github-rag-mcp ade18ff Jun 21 2026, 02:10 AM

@liplus-lin-lay liplus-lin-lay left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AI セルフレビュー (auto mode)

  • ✅ CI 全 green: test ジョブで node 42 + workers 15(D1 9 + DO 6、workerd/miniflare の実 SQLite)+ tsc --noEmit + wrangler dry-run / Workers Builds。ローカルでも反復で安定確認。
  • src/ Worker 本体コードは無変更。差分はテスト + 最小エントリ(test-do-entry.ts)+ 設定のみ。
  • ✅ IssueStore の構造化ストア(issue CRUD 冪等性 + listIssuesByRepo フィルタ/順序 + ポーリング watermark 往復)を実 DO(runInDurableObject)で pin。テストごとユニーク DO インスタンスで分離。
  • リリース種別: 本体無変更で patch 相当。テスト基盤のため本 PR では release しない。

self-review pass。auto mode のため squash merge。#165 は残スコープ(oauth フロー全体 / Vectorize・AI)のため open 継続。

@liplus-lin-lay liplus-lin-lay merged commit 372464f into main Jun 21, 2026
3 checks passed
@liplus-lin-lay liplus-lin-lay deleted the 165-test-leg-slice3-do branch June 21, 2026 02:12
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