feat: Protobuf 生成の単一エントリ化と Elixir/Rust の生成コード運用#280
Conversation
…to generated modules
…rost-build generated types
… names) Made-with: Cursor
There was a problem hiding this comment.
Code Review
This pull request completes the transition from MessagePack and Erlang Term Format (ETF) to Protocol Buffers for all network communication and frame injection. It introduces a new automated protobuf generation task, updates the UDP protocol to support compressed protobuf payloads, and removes legacy serialization dependencies. Rust components were refactored to use generated types. Review feedback recommends increasing the logging severity for NIF call failures to ensure better visibility of potential issues.
I am having trouble creating individual review comments. Click here to see my feedback.
apps/contents/lib/events/game.ex (804)
NIF呼び出しの失敗はゲームプレイに影響を与える可能性があるため、Logger.debug ではなく Logger.warn または Logger.error を使用して、より目立つようにログを記録することを検討してください。これにより、問題発生時に迅速な検出と対応が可能になります。
Logger.warn("[Events.Game] set_player_input failed: #{inspect(reason)}")
apps/contents/lib/events/game.ex (846)
NIF呼び出しの失敗はゲームプレイに影響を与える可能性があるため、Logger.debug ではなく Logger.warn または Logger.error を使用して、より目立つようにログを記録することを検討してください。これにより、問題発生時に迅速な検出と対応が可能になります。
Logger.warn("[Events.Game] set_weapon_slots failed: #{inspect(reason)}")
proto/*.proto を単一の真実として、Elixir(protoc-gen-elixir)と Rust(prost-build)の
生成・ビルド手順を mix alchemy.gen.proto に集約した。
Elixir 側は手書き protobuf モジュールを廃止し、apps/network/lib/network/proto/generated/
へ生成物を配置。network / nif クレートは prost で型生成し、Zenoh・UDP・NIF の
シリアライズ経路を生成型ベースに統一した。
CI では protoc・protoc-gen-elixir を用意し、mix alchemy.gen.proto 実行後に
生成ディレクトリの git diff で鮮度を検証。手順書は workspace/7_done へ移動。
レビュー対応: cargo build で network と nif の両方をビルド、失敗時は Mix.raise で
一時ディレクトリを after で確実に削除、Rust build.rs は proto ディレクトリを列挙、
デコードフォールバック時は debug ログ、E2E ゴールデン手順の注記を更新。