-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Surface alerts from trip informed entities #140
base: master
Are you sure you want to change the base?
Conversation
Also @jamespfennell FYI, I think something in CI has been broken recently. I haven't had a chance to look, but things do pass locally. If you have any ideas LMK or else I can also try and debug further. |
Thanks for the PR and sorry for the slow review! As usual you've put a lot of great thought and research in, thank you! Some initial thoughts:
For the CI - will take a look! The error message is weird and indicates that some dependency of the CI has had its version updated. |
I know why the CI is broken. Over the last couple of years the Docker team has been merging the Docker compose tool into the main Docker tool (while also rewriting compose in Go). I think now in order to run Docker compose one needs to type |
This fixes the CI. Unfortunately it requires devs to update their local Docker setup to use the compose plugin instead of the dedicated command.
CI fixed! Unfortunately running the E2E tests locally via Docker won't work unless you update to use the compose plugin...I haven't done that yet but wanted to unblock the CI at least. |
Thanks for fixing the CI! And it definitely makes sense to do this in the GTFS library, good call! I've opened a PR there to handle this: jamespfennell/gtfs#18 I can perhaps repurpose this PR to keep the schema change for As the current parser change stands, there will be 2 implications for Transiter:
|
Overview
This change surfaces alerts associated with specific trips. It also handles an edge case where the
trip
entity selector is used for providing alerts for a given route without atripId
.For example, the MTA buses provide alerts in this form sometimes:
In the above case, the alert effectively applies to the whole route since both directions are covered. We therefore consider the following cases for how to handle this:
1.) An alert has an informed trip with no
tripId
, arouteId
, and both directions are specified: consider this alert as affecting the entire route and add a route informed entity.2.) An alert has an informed trip with no
tripId
, arouteId
, and no directions are specified: consider this alert as affecting the entire route and add a route informed entity.3.) An alert has an informed trip with no
tripId
, arouteId
and a single direction is specified: consider this alert as affecting the trips running the specified direction.In all 3 cases, the alert is still considered to affect all trips along the route/direction. Such alerts will now be surfaced from the
/trips
endpoint, whereas only alerts meeting criteria (1) and (2) are surfaced in the/routes
endpoint.TODOs
tripId
. This will be fine in most cases, but can be incorrect when trips run across multiple days.