Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

GetTrainRoute RPC追加: A→B走行シミュレーション用クエリ - #25

Merged
TinyKitten merged 2 commits into
mainfrom
feature/get-train-route
Jun 29, 2026
Merged

TinyKitten merged 2 commits into
mainfrom
feature/get-train-route

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A→B間の走行シミュレーションに必要なメタ情報を1回のリクエストで取得する GetTrainRoute RPCを新設
  • GetTrainRouteRequest: from_station_group_id, to_station_group_id, line_group_id(optional)を指定
  • TrainRouteSegment: 既存Stationを内包し、停車/通過(stops)、前駅からの距離(distance_from_previous)、速度プロファイル(max_speed, max_acceleration, max_deceleration)を付与
  • line_group_idは列車種別が未設定の路線にも対応できるようoptionalに設定

Closes TrainLCD/StationAPI#1564

Test plan

  • StationAPI側でGetTrainRouteハンドラを実装後、grpcurlで疎通確認
  • 通過駅がstops=false、停車駅がstops=trueで返ることを検証
  • line_group_id省略時のフォールバック動作を確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 新機能
    • 列車ルートを取得する新しいAPIが追加されました。
    • 出発駅・到着駅に加え、任意で系統条件を指定してルートを取得できます。
    • ルート結果として、各区間の駅情報、停車有無、区間距離、速度・加減速に関する情報を返せるようになりました。

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 90cb802d-6694-43c6-aaf3-2122756c002d

📥 Commits

Reviewing files that changed from the base of the PR and between 02d47f6 and ae63d81.

📒 Files selected for processing (1)
  • stationapi.proto
🚧 Files skipped from review as they are similar to previous changes (1)
  • stationapi.proto

📝 Walkthrough

ウォークスルー

stationapi.proto に GetTrainRoute RPC を追加し、GetTrainRouteRequest、TrainRouteSegment、TrainRouteResponse のメッセージ定義を新規追加しました。

変更内容

GetTrainRoute RPC 追加

Layer / File(s) Summary
RPC 宣言とメッセージ定義
stationapi.proto
StationAPI サービスに GetTrainRoute(GetTrainRouteRequest) returns (TrainRouteResponse) を追加し、GetTrainRouteRequest、TrainRouteSegment、TrainRouteResponse を定義。

推定コードレビュー工数

🎯 2 (Simple) | ⏱️ ~10 minutes

関連する可能性のある Issue

詩

🐇 ぴょんとひらいた新しい路、
駅から駅へと線をつなぐ。
GetTrainRoute で旅の道しるべ、
区間も速度もプロトにぽんっ。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning proto 追加は合っていますが、要求されたハンドラ実装やテストが見当たらず、issue の主要要件を満たしていません。 gRPC ハンドラ、use case、テストまで実装するか、もし proto のみなら issue スコープをそれに合わせて明確化してください。
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは GetTrainRoute RPC の追加と A→B 走行シミュレーション向けクエリを簡潔に示しており、変更内容と一致しています。
Out of Scope Changes check ✅ Passed 変更は GetTrainRoute 関連の proto 定義に限定され、明らかなスコープ外変更はありません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/get-train-route

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


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

@TinyKitten TinyKitten self-assigned this Jun 29, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@stationapi.proto`:
- Around line 397-400: The numeric fields in the station path message are
missing contract-level units and sign rules, so add proto comments on the
message containing distance_from_previous, max_speed, max_acceleration, and
max_deceleration to define the unit system and the expected sign convention.
Clarify in particular how distance_from_previous is interpreted for the first
segment and whether max_deceleration is stored as a positive magnitude or
negative value, using the existing field names in stationapi.proto to make the
contract unambiguous for client-side simulation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee867263-ca2b-41a1-85ca-5b5eaeb90908

📥 Commits

Reviewing files that changed from the base of the PR and between 85a2b77 and 02d47f6.

📒 Files selected for processing (1)
  • stationapi.proto

Comment thread stationapi.proto Resolved
Co-Authored-By: Claude Opus 4.6 <[email protected]>
@TinyKitten

Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 1 file(s) based on 1 CodeRabbit feedback item(s).

Files modified:

  • stationapi.proto

Commit: ae63d81

The latest autofix changes are on the feature/get-train-route branch.

@TinyKitten
TinyKitten merged commit fe1cf5e into main Jun 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[提案] A→B 走行シミュレーション用 gRPC クエリ GetTrainRoute の新設

1 participant