Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- postgresql, typescript
調査の方向性
Start with packages/core/src/storage/types.ts, runStorageConformance from @chatcops/core/testing, and CONTRIBUTING.md’s “Writing a store package” section; inspect the SQLite store and its tables in issue #247. Use Miniflare from a normal Node test and run conformance against D1 + KV + DO and D1 alone as specified. Done means the acceptance checks pass, including 50 exact Durable Object increments, README Wrangler configuration, a minor changeset, and the listed build, coverage, lint, and publint commands.
索引モデルが issue の本文から書いたものです。
説明
A ChatCops server on Cloudflare Workers keeps everything in memory today, and Workers isolates come and go all the time, so conversations and rate limits barely last. This package stores them in Cloudflare's own services.
This is a bigger one, for someone who has had a few PRs merged here and knows Workers. The interfaces and the tests it has to pass already exist: packages/core/src/storage/types.ts and runStorageConformance from @chatcops/core/testing. CONTRIBUTING.md has a "Writing a store package" section with the package layout.
What to do
Create packages/store-cloudflare:
import { cloudflareStorage, ChatCopsCounter } from '@chatcops/store-cloudflare';
export { ChatCopsCounter }; // the Durable Object class, exported from the Worker
storage: cloudflareStorage({ d1: env.DB, kv: env.CHATCOPS_KV, counters: env.CHATCOPS_COUNTERS })
d1is required:- It stores
conversations(withappend,updateMessage,removeMessage,list,purge) andevents(withquery). - Use the same tables as the SQLite store (see #247). D1 is SQLite, so the schema can be shared later.
- D1 has no interactive transactions, so make
appendatomic withdb.batch(). The version check has to be part of the statements themselves, for exampleUPDATE ... SET version = version + 1 WHERE id = ? AND version = ?, with the inserts conditional on it.
- It stores
counters: a Durable Object namespace when given. Durable Objects run one request at a time, so increments are exact; ship theChatCopsCounterclass. Without one, fall back to a D1UPSERT ... RETURNING. Never use KV for counters: it's eventually consistent.kv: Workers KV when given, otherwise a D1 table. Workers KV can't do an atomicsetIfAbsent, so only offersetIfAbsenton the D1 table.- Include a
wrangler.jsoncsnippet in the README with the D1 binding, the DO binding and its migration. "private": trueinpackage.json. A maintainer publishes it for the first time.
Testing
Use Miniflare from a normal Node test (new Miniflare({ ... d1Databases, kvNamespaces, durableObjects }) and its getD1Database() etc.) rather than the Workers vitest pool, which doesn't mix well with the root vitest projects here. Workers KV has a 60 second minimum TTL, so pass skip: ['kv-ttl'] for the KV-backed run, and run the suite a second time on the D1-only setup without skipping it.
Acceptance criteria
-
runStorageConformancepasses with D1 + KV + DO (skipping onlykv-ttl) and with D1 alone (nothing skipped) - 50 concurrent increments through the Durable Object land exactly
- README with the wrangler config
- Changeset for
@chatcops/store-cloudflare(minor) -
pnpm -r build,pnpm test:coverage(90% lines, 80% branches for store packages),pnpm lintandpnpm publintpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 4時間 11分
- マージ済み PR(30日)
- 122
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
enhancement hacktoberfest help wanted server
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Document the pre-chat form対応中かも @masyarakatai が 5 日前に担当しました。 オープンdocumentation good first issue hacktoberfest widget
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
codercops/chatcops#70 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Create @chatcops/store-redis for Upstash and other Redis clients対応中かも @bhushan4work が 1 日前に担当しました。 オープンenhancement hacktoberfest help wanted server
codercops/chatcops#248 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Create @chatcops/store-sqlite, a store for single-server setups対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement hacktoberfest help wanted server
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
core enhancement hacktoberfest help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
[BUG] rag: sentence content can cross the reported sentence boundaries対応中かも @LJK-ikun が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
platformatic/mcp#361 ·
メンテナーはふだん 1 日以内に返信
-
frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Push: sem service worker ou sem VAPID, o interruptor de Notificações fica ligado sem avisar nadaオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
melgarafael/DeskcommCRM#3164 ·
メンテナーはふだん 1 日以内に返信