Passthrough NO_DATA schedule_relationship for stop_time_updates#467
Passthrough NO_DATA schedule_relationship for stop_time_updates#467KTibow wants to merge 2 commits into
Conversation
When a GTFS-RT feed sets schedule_relationship: NO_DATA on a stop_time_update, it means no real-time timing is available and consumers should use the static GTFS schedule. OBA was treating NO_DATA the same as SCHEDULED, fabricating predictions from the arrival/departure time fields. Changes: - GtfsRealtimeTripLibrary (static path): Handle NO_DATA like SKIPPED but without arrival/departure times; skip time computation for NO_DATA - GtfsRealtimeTripLibrary (dynamic path): Add NO_DATA case to the switch; guard arrival/departure time reads against NO_DATA - TripStatusBeanServiceImpl: Passthrough schedule_relationship value directly instead of hardcoding SCHEDULED for non-skipped stops - TripUpdatesForAgencyAction: Write schedule_relationship from bean to the GTFS-RT StopTimeUpdate protobuf output
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughGTFS-RT trip update processing now preserves ChangesSchedule Relationship Propagation
Estimated code review effort: 2 (Simple) | ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Once again, not signing the CLA because it needs to be updated to use a custom gist instead of the SAP default |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/beans/TripStatusBeanServiceImpl.java (1)
372-387: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winGuard
scheduleRelationshipbefore dereferencing it.AbstractOrbcadRecordSourcestill createsTimepointPredictionRecordinstances without setting this field, sotpr.getScheduleRelationship().getValue()can throw here. Default it or add a null check before mapping.🤖 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 `@onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/beans/TripStatusBeanServiceImpl.java` around lines 372 - 387, The timepoint prediction mapping in TripStatusBeanServiceImpl dereferences scheduleRelationship without checking for null, which can fail for TimepointPredictionRecord instances coming from AbstractOrbcadRecordSource. Update the loop that builds TimepointPredictionBean objects to guard tpr.getScheduleRelationship() before calling getValue(), and either skip setting the field or supply a safe default when it is missing. Keep the change localized to the timepointPredictions population block so the bean assembly remains otherwise unchanged.
🤖 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.
Outside diff comments:
In
`@onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/beans/TripStatusBeanServiceImpl.java`:
- Around line 372-387: The timepoint prediction mapping in
TripStatusBeanServiceImpl dereferences scheduleRelationship without checking for
null, which can fail for TimepointPredictionRecord instances coming from
AbstractOrbcadRecordSource. Update the loop that builds TimepointPredictionBean
objects to guard tpr.getScheduleRelationship() before calling getValue(), and
either skip setting the field or supply a safe default when it is missing. Keep
the change localized to the timepointPredictions population block so the bean
assembly remains otherwise unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 468626e0-c453-44fb-9a7d-e549b63a0d90
📒 Files selected for processing (3)
onebusaway-api-webapp/src/main/java/org/onebusaway/api/actions/api/gtfs_realtime/TripUpdatesForAgencyAction.javaonebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/beans/TripStatusBeanServiceImpl.javaonebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/realtime/gtfs_realtime/GtfsRealtimeTripLibrary.java
|
@KTibow thanks for the head's up. there was some special casing for this repo in the CLA tool and I have removed it, so hopefully it defaults to the OBA org-wide CLA now. |
AbstractOrbcadRecordSource creates TimepointPredictionRecord instances without setting scheduleRelationship, so the direct passthrough in TripStatusBeanServiceImpl would NPE. Add a null guard defaulting to SCHEDULED, preserving the existing behavior for those records.
|
@coderabbitai review |
✅ Action performedReview finished.
|
When a GTFS-RT feed sets schedule_relationship: NO_DATA on a stop_time_update, it means no real-time timing is available and consumers should use the static GTFS schedule. OBA was treating NO_DATA the same as SCHEDULED, fabricating data.
Changes:
Disclosure: generated by DeepSeek V4 Pro with CI verification
Summary by CodeRabbit