Repository navigation
Name a trip's stops by their own agency - #1794
aaronbrethorst wants to merge 1 commit into
Conversation
Trip status closestStop and nextStop, trip schedule stop times and block stop times prefixed each stop with the trip's or block's agency. Java OneBusAway names a stop after its feed's first agency wherever it appears, so another agency's trip showed the stop under an ID that doesn't exist. These now read each stop's agency through loadStopAgencyIDs. The three copies of "fetch the trip's stops and map their coordinates" become loadTripStops, which returns coordinates and agencies together, and stopIDsForStopTimes replaces the loops that collected their IDs. The interlined-block test expected each stop twice, once per agency; it now expects one reference per stop.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
@aaronbrethorst, the PR description does not follow the PR template:
Keep this PR as Draft until these are fixed. This comment updates when the description changes. |
|
Performance Smoke Test ResultsStatus: PASSED
Smoke test config: 5 VUs x 30s. Thresholds: p(95) < 300ms, error rate < 1%. Full results uploaded as workflow artifact: k6-smoke-summary. |
|
Closing as superseded. The multi-feed static GTFS spec (#1811, |



Stacked on #1793. Part of the stop consolidation work (#1771–#1779). No issue filed yet.
What it does
These now carry each stop's own agency, not the agency of the trip or block that visits it:
closestStopandnextStopstopTimes[].stopIdblockStopTimes[].stopTime.stopIdreferences.stopsRoot cause
These code paths prefixed stops with the trip's or block's agency. Java OneBusAway names a stop after its feed's first agency everywhere. So an interlined trip, or another agency's trip at a shared stop, produced a stop ID that doesn't exist.
They now read each stop's agency through
loadStopAgencyIDs. Two helpers replace duplicated code:loadTripStopsreturns the stops' coordinates and agencies together. It replaces three copies of "fetch the trip's stops and map their coordinates" inBuildTripSchedule,buildStopTimesListand the trips-for-location bulk loader.stopIDsForStopTimesreplaces the loops that collected a trip's stop IDs.Testing
mainbefore this change:TestTripStopIDs_UseTheStopsOwnAgency, on the two-agency fixture. It uses a mock vehicle onother-tripat 10:15 UTC.trip-details/other_other-trip: statusclosestStop/nextStopand the schedule's stop IDs wereother_stop-1/other_stop-2before this change. Now they'reown_stop-1/own_stop-2.block/other_other-block: same before and after.TestTripsForRouteHandler_CrossAgencyInterlinedBlockexpected four stop references, each stop once per agency. It now expects two, one per stop.Response comparison
StopEntriesFactory). Productionstop/29_16140returnsnulleven though Community Transit route29_130serves1_16140.nextStopon a Community Transit trip at that stop would be29_16140.1_16140.Checklist
mainand passes on this branch.gtfsdb/(db.go,models.go,query.sql.go) ortestdata/openapi.yml(synced from upstream).r.Context()to DB/service calls, notcontext.Background().testdata/openapi.yml, has an issue open on OneBusAway/sdk-config, or is outside the SDK and the description says why.Notes for reviewers
BuildTripStatusnow runs one more small indexed query per trip to read its stops' agencies.BuildStopReferencesAndRouteIDsForStops, and they prefix every route with the block's agency. That's a separate follow-up.