Skip to content

駅間の線路の長さを返す機能を本番へ反映 - #1706

Merged
TinyKitten merged 2 commits into
masterfrom
dev
Sep 29, 2026
Merged

TinyKitten merged 2 commits into
masterfrom
dev

Conversation

@TinyKitten

Copy link
Copy Markdown
Member

概要

dev の変更を master(本番)へ反映します。

変更の種類

  • バグ修正
  • 新機能
  • データの修正・追加
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • 隣り合う駅のあいだの線路の長さを返せるようにした #1705 隣り合う駅のあいだの線路の長さを返せるようにした(Closes 隣り合う駅のあいだの線路の長さを返せるようにする #1704)
    • Station / StationNested に trackDistanceFromPrevious: Float を追加しました。スキーマへの追加だけで、既存のフィールドは変わりません。
      • 値が入るのは lineStations・lineGroupStations・trainRoute だけです。
      • 先頭の駅、データのない区間、ほかの問い合わせでは null になります。
      • trainRoute の distanceFromPrevious(直線距離)は変えていません。
    • preprocessor が国土数値情報の鉄道データ(N02-25、CC BY 4.0)から線路の長さを求め、generated/connections.csv に書き出します。
      • 約 11,000 組のうち約 10,400 組を計算できました。営業中の駅どうしで測れなかったのは 2 組だけです。
    • Worker は connections.bin を二分探索して値を引きます。起動時に索引は作りません(wasm は約 130KB 増えます)。
    • data/8!connections.csv を線路の長さの手修正に使うようにし、data_validator で検査します。
    • composite action で N02 を actions/cache にキャッシュします。取得に失敗すると preprocessor が失敗します。

デプロイ時の注意

  • 本番デプロイでは N02 を取得します。 actions/cache は、dev で作られたキャッシュを master から使えません。そのため初回の本番デプロイでは、N02(約 13MB)を国土数値情報のサーバーから取得します。サーバーが応答しないとデプロイは失敗します。その場合は再実行してください。
  • デプロイ後の確認: lineStations(lineId: 11302) { name trackDistanceFromPrevious } で、大崎が null、五反田が 806、目黒が 1190 になることを確かめてください。

テスト

関連Issue

Refs #1704

スクリーンショット(任意)

🤖 Generated with Claude Code

* 隣り合う駅のあいだの線路の長さを国土数値情報から求め、Station.trackDistanceFromPreviousで返すようにした

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* N02の取得にタイムアウトを明示し、CIでN02をキャッシュするようにした

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@TinyKitten TinyKitten self-assigned this Sep 28, 2026
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: b709b7db-3762-4026-b3cf-0ec1c014406d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@TinyKitten
TinyKitten merged commit 01c98c8 into master Sep 29, 2026
13 checks passed

This branch was successfully deployed

1 active deployment
staging — c0e7fd00 Deployed Sep 28, 2026 by TinyKitten via Build and deploy to staging #25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant