京王バスのGTFSフィードを追加 - #1601
Conversation
ODPT 公開の京王バス (京王電鉄バス) GTFS-JP フィードを取り込み対象に追加する。 - `GTFS_FEEDS` に `keio` フィードを追加(ODPT `files/odpt/KeioBus/AllLines.zip`、 西武バスと同じく `ODPT_ACCESS_TOKEN` が必要) - `company_cd_for_gtfs_route` で `keio:` 接頭辞を京王バス (`company_cd=254`) に対応付け - `data/1!companies.csv` に京王バス (company_cd=254) を追加(lines→companies の 外部キー制約を満たすため) - ダウンロードされる GTFS ディレクトリ (KeioBus/SeibuBus) を `.gitignore` に追加 - README / AGENTS / architecture ドキュメントとデータソース表記を更新 - `test_company_cd_for_gtfs_route` / `test_gtfs_feeds` を京王バス分だけ更新 検証: cargo fmt --all -- --check / SQLX_OFFLINE=true cargo clippy -- -D warnings / SQLX_OFFLINE=true cargo test / cargo run -p data_validator いずれも成功。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfBspXi8MZnEjwrAxvbBzz
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughKeio BusのGTFSフィードをODPTから取得して取り込む設定を追加し、路線IDを会社コード254へ変換する処理とテストを更新しました。関連するデータソース、アーキテクチャ、運用説明、Git管理除外設定も更新されています。 ChangesKeio Bus GTFS integration
Estimated code review effort: 1 (Trivial) | ~5 minutes Sequence Diagram(s)sequenceDiagram
participant GTFS_FEEDS
participant ODPT
participant ImportPipeline
GTFS_FEEDS->>ODPT: keioフィードを取得
ODPT-->>ImportPipeline: GTFSアーカイブを返却
ImportPipeline->>ImportPipeline: keio:路線を会社コード254へ変換
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
stationapi/src/import.rs (1)
3138-3142: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winフィード定義の URL・パス・認証要件もテストしてください。
現在のテストは ID の並びだけを検証するため、Keio の URL、
path、requires_consumer_keyが誤っていても通過します。Keio 要素を取得し、これらの値を明示的に assert してください。修正例
fn test_gtfs_feeds() { assert_eq!( GTFS_FEEDS.iter().map(|feed| feed.id).collect::<Vec<_>>(), vec!["toei", "seibu", "keio"] ); + let keio = GTFS_FEEDS.iter().find(|feed| feed.id == "keio").unwrap(); + assert_eq!(keio.path, "data/KeioBus-GTFS"); + assert_eq!( + keio.url, + "https://api.odpt.org/api/v4/files/odpt/KeioBus/AllLines.zip" + ); + assert!(keio.requires_consumer_key); }🤖 Prompt for 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. In `@stationapi/src/import.rs` around lines 3138 - 3142, Expand the test_gtfs_feeds test to locate the Keio feed entry from GTFS_FEEDS and explicitly assert its URL, path, and requires_consumer_key values. Preserve the existing feed ID ordering assertion while validating these three Keio-specific fields.
🤖 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 `@AGENTS.md`:
- Line 57: Update the nearby TrainType description and ODPT_ACCESS_TOKEN
documentation to refer to all configured GTFS feeds, explicitly including Seibu
Bus and Keio Bus where appropriate. Align both descriptions with the all-feed
behavior documented in the GTFS bus integration section, without changing
implementation details.
---
Nitpick comments:
In `@stationapi/src/import.rs`:
- Around line 3138-3142: Expand the test_gtfs_feeds test to locate the Keio feed
entry from GTFS_FEEDS and explicitly assert its URL, path, and
requires_consumer_key values. Preserve the existing feed ID ordering assertion
while validating these three Keio-specific fields.
🪄 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: 7ded6e8c-32df-4440-bebf-386800ce2345
⛔ Files ignored due to path filters (1)
data/1!companies.csvis excluded by!**/*.csv
📒 Files selected for processing (5)
.gitignoreAGENTS.mdREADME.mddocs/architecture.mdstationapi/src/import.rs
- `test_gtfs_feeds` で京王バスフィードの name / path / url / requires_consumer_key を明示的に assert し、ID の並びだけでなく 定義値の誤りも検知できるようにする - `AGENTS.md` の TrainType 説明を Toei Bus 限定表現から設定済み全 GTFSフィード (Toei / Seibu / Keio) へ更新 - `AGENTS.md` の `ODPT_ACCESS_TOKEN` 説明に京王バスを追記 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfBspXi8MZnEjwrAxvbBzz
概要
ODPT(公共交通オープンデータセンター)が公開する京王バス(京王電鉄バス)の GTFS-JP フィードを取り込み対象に追加し、京王バスの路線・停留所を StationAPI で扱えるようにします。既存の都営バス・西武バスと同じ GTFS 統合パイプラインに乗せています。
変更の種類
変更内容
GTFS_FEEDSに京王バスフィード(keio)を追加。ODPT のfiles/odpt/KeioBus/AllLines.zipから取得し、西武バスと同様にODPT_ACCESS_TOKENが必要company_cd_for_gtfs_routeでkeio:接頭辞を京王バス(company_cd=254)にマッピングdata/1!companies.csvに京王バス(company_cd=254)を追加。lines.company_cd → companiesの外部キー制約を満たすため必須data/KeioBus-GTFS/、および漏れていたdata/SeibuBus-GTFS/)を.gitignoreに追加README.md/AGENTS.md/docs/architecture.mdのデータソース表記・バス統合の説明を更新test_company_cd_for_gtfs_route/test_gtfs_feedsに京王バス分を追加テスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること上記に加え、
cargo run -p data_validatorを実行し[VALID] No errors reported.を確認済み。関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit