Skip to content

Gate CursorStoreStats behind cfg(test) (DSK-131)#172

Merged
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-131-cursor-store-stats-cfg-test
Jul 5, 2026
Merged

Gate CursorStoreStats behind cfg(test) (DSK-131)#172
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-131-cursor-store-stats-cfg-test

Conversation

@daisuke8000

@daisuke8000 daisuke8000 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move CursorStoreStats, new_with_stats, and stats field/branches behind #[cfg(test)].

Test plan

  • cargo build --workspace --locked (no warnings)
  • cargo test -p rustern-core --lib runtime::cursor_store
  • Local CodeRabbit review (0 findings)

Made with Cursor

Summary by CodeRabbit

  • テスト
    • 統計情報の収集と参照がテスト実行時のみ有効になるようになりました。
    • 非テスト環境では不要な内部カウンターが含まれず、挙動がより明確になりました。

Compile test-only cursor store instrumentation out of production builds.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 062ac0b4-0633-4d94-878f-872d9563c88b

📥 Commits

Reviewing files that changed from the base of the PR and between a142ed4 and 178685a.

📒 Files selected for processing (1)
  • crates/rustern-core/src/runtime/cursor_store.rs

📝 Walkthrough

Walkthrough

CursorStoreStats 構造体の可視性属性が #[cfg_attr(not(test), allow(dead_code))] から #[cfg(test)] に変更され、テストビルド時のみコンパイル対象となりました。これに伴い ReconnectCursorStorestats フィールド、new() での初期化、および get()/record() 内の統計カウント処理(cursor_updates/cursor_gets の増分)も cfg(test) 配下に限定されました。

Changes

変更カテゴリ 詳細
属性変更 CursorStoreStatscfg_attr(not(test), allow(dead_code)) から cfg(test) に変更
フィールド限定化 ReconnectCursorStore.stats をテストビルド限定に
初期化限定化 new()stats: None をテストビルド限定に
カウント処理限定化 get()/record()fetch_add 呼び出しをテストビルド限定に

関連コード行数: +8/−3

Possibly related issues

  • DSK-131: crates/rustern-core/src/runtime/cursor_store.rs における CursorStoreStats のテスト限定化(フィールド・アクセサ含む)が同一の変更内容を扱っている。

重大度メモ: 本変更はビルド構成(cfg(test))の調整のみで、非同期処理・K8s・セキュリティへの影響はなし。ただし非テストビルドで統計情報が完全に取得不可となる点は仕様上の意図確認が必要(Info/Low)。

🚥 Pre-merge checks | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning 重大: Conventional Commits の prefix がなく、必須の書式要件を満たしていません。 重大: refactor: などの Conventional Commits prefix を付け、72文字以内で変更内容を具体化してください。
Description check ⚠️ Warning 重大: 必須の「概要」「変更理由」セクションがなく、テンプレートに沿っていません。 重大: ## 概要## 変更理由 を追加し、各項目を変更内容と理由で埋めてください。

Comment @coderabbitai help to get the list of available commands.

@daisuke8000
daisuke8000 merged commit 27f6afc into main Jul 5, 2026
3 checks passed
@daisuke8000
daisuke8000 deleted the fix/dsk-131-cursor-store-stats-cfg-test branch July 5, 2026 09:00
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