Repository navigation
Prefix location results with each stop's agency - #1796
aaronbrethorst wants to merge 1 commit into
Conversation
stops-for-location, arrivals-and-departures-for-location and the nearbyStopIds of arrivals-and-departures-for-stop chose a stop's prefix from the agencies whose routes serve it, taking the first by ID. Java OneBusAway uses the stop's own agency, so a shared stop could come out under the wrong one. All three now read loadStopAgencyIDs. The location arrivals index fills from it through addStopAgencies, which also records each agency's timezone. GetAgenciesForStops remains for references.agencies only, and its comment says so.
|
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 #1795. Part of the stop consolidation work (#1771–#1779). No issue filed yet.
What it does
stops-for-location,arrivals-and-departures-for-locationand thenearbyStopIdsofarrivals-and-departures-for-stopnow prefix each stop with its own agency.Root cause
All three chose a stop's prefix from
GetAgenciesForStops, the agencies whose routes serve it, taking the first by agency ID. Java OneBusAway uses the stop's own agency, its feed's first. So a stop shared between agencies could come out under the wrong one.All three now read
loadStopAgencyIDs:addStopAgencies, which also records each agency's timezone for the service-day math.GetAgenciesForStopsstays only for search'sreferences.agencies, and its query comment now says so.Testing
mainbefore this change:TestLocationStopIDs_UseTheStopsOwnAgency, on the two-agency fixture, whereothersorts beforeown.stops-for-locationandarrivals-and-departures-for-locationaroundstop-1.other_stop-1andother_stop-2before this change, and returnown_stop-1andown_stop-2now.assignStopAgencies.Response comparison
StopEntriesFactory). Productionstop/29_16140returnsnulleven though Community Transit route29_130serves1_16140.stops-for-locationnear1_16140would pick between1_and29_by agency ID order.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
query(stop code) was given, because no agency resolved for it. Every stop has an agency now, so a stop-code query finds such a stop, as Java's stop index does. Searches without a query still drop stops with no routes that day.stopReferencesstill accepts several IDs per stop (idsByBareID), for trips-for-route, trips-for-location and stops-for-location parent stations. That collapses next.