Skip to content

fix: address CodeRabbit nitpicks from Release PR #171#172

Merged
sasagar merged 2 commits into
devfrom
fix/coderabbit-nitpicks-release-v2026.5.0
May 13, 2026
Merged

fix: address CodeRabbit nitpicks from Release PR #171#172
sasagar merged 2 commits into
devfrom
fix/coderabbit-nitpicks-release-v2026.5.0

Conversation

@sasagar
Copy link
Copy Markdown
Collaborator

@sasagar sasagar commented May 13, 2026

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

  • `bun run typecheck` (backend) — pass
  • `bun test src/tests/integration/sqlite-repositories.test.ts` — 28 pass / 0 fail

Release continuity

このPRを dev にマージ後、Release PR #171 を更新(dev → main)し、v2026.5.0 リリースを再開する。

sasagar added 2 commits May 14, 2026 02:50
- 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).
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

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

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 @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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c840a97c-8f0d-43ee-845b-158e325847e9

📥 Commits

Reviewing files that changed from the base of the PR and between 744cbd3 and 6464669.

📒 Files selected for processing (4)
  • .github/workflows/close-issues.yml
  • .github/workflows/sync-dev.yml
  • packages/backend/src/db/index.ts
  • packages/backend/src/tests/integration/sqlite-repositories.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/coderabbit-nitpicks-release-v2026.5.0

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.

@sasagar sasagar merged commit 0ef8813 into dev May 13, 2026
11 checks passed
@sasagar sasagar deleted the fix/coderabbit-nitpicks-release-v2026.5.0 branch May 13, 2026 17:56
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