fix: address CodeRabbit nitpicks from Release PR #171#172
Conversation
- close-issues.yml: skip pull requests when auto-closing references. The `Closes #N` pattern can match PR numbers; since PRs are issues in GitHub's data model, the previous code would close a PR if its number was referenced. Now we issues.get first and skip when target.data.pull_request is set. - sqlite-repositories.test.ts: delete all notes in beforeEach cleanup. The previous WHERE clause kept testUserId rows, which leaked between tests. Drop the predicate so each test starts from a clean state.
- db/index.ts: fix D1DatabaseInstance type mismatch. The type was declared as BunSQLiteDatabase<typeof sqliteSchema> (bun:sqlite driver) but createD1Database actually returns the drizzle-orm/d1 driver. Drop the explicit return type and derive D1DatabaseInstance via ReturnType<typeof createD1Database> so the public type follows what the function really produces. - sync-dev.yml: add concurrency group to prevent races on consecutive pushes to main (older runs cancel-in-progress so the latest sync wins).
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Release PR #171 のレビューで CodeRabbit が指摘した 4 件のうち、修正に値する 4 件を対応。
Changes
🟠 Major (real bugs)
.github/workflows/close-issues.yml— auto-close PR 誤動作の可能性`Closes #N` パターンで PR 番号が混入した場合、PR がクローズされてしまう恐れ。`issues.get` で対象が PR か事前判定し、その場合は skip するように変更。
packages/backend/src/db/index.ts— D1 型契約の不一致`D1DatabaseInstance` を `BunSQLiteDatabase` として宣言していたが、実際に `createD1Database` が返すのは `drizzle-orm/d1` driver。型契約がズレており D1 経路で型安全性が失われていた。`ReturnType` で実装に追従させる。
🟡 Minor / Quick win
packages/backend/src/tests/integration/sqlite-repositories.test.ts— テスト間汚染`beforeEach` の `DELETE FROM notes WHERE user_id != '${testUserId}'` は testUserId の note を残してしまい、テスト間でデータがリークしていた。全削除に変更。
.github/workflows/sync-dev.yml— race condition 対策main への連続 push で sync ジョブが競合する可能性。`concurrency: cancel-in-progress` を追加し、最新の同期だけ走るようにする。
Test plan
Release continuity
このPRを dev にマージ後、Release PR #171 を更新(dev → main)し、v2026.5.0 リリースを再開する。