-
Notifications
You must be signed in to change notification settings - Fork 2
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
Migrate from RTR to GTFS-rt #810
Conversation
Co-authored-by: Brett Heath-Wlaz <[email protected]>
…bta/realtime_signs into pk/migrate-from-rtr-to-gtfs-rt
defp has_departed?(prediction) do | ||
prediction.seconds_until_departure && prediction.seconds_until_departure < 0 && | ||
not prediction.stopped_at_predicted_stop? | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flagging for review: This is new logic since the first attempt at migrating for more accurately filtering out departed trains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm!
), | ||
vehicle_positions_url: | ||
System.get_env( | ||
"VEHICLE_POSITIONS_URL", | ||
"https://s3.amazonaws.com/mbta-gtfs-s3/rtr/VehiclePositions_enhanced.json" | ||
"https://s3.amazonaws.com/mbta-gtfs-s3/concentrate/VehiclePositions_enhanced.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a drive-by note, these have "official" public-facing URLs which are behind a CDN. We ended up using these in Screens LTOTD tracking rather than these internal S3 bucket URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, thanks for calling that out. Does Screens LTOTD also use dev/dev-blue versions of the CDN URLs as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the production feeds have CDN URLs as far as I know — if we're fetching a non-prod feed those will probably have to still use S3 bucket URLs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. We should make sure to give this some runtime in dev or dev-green before deploying if we haven't already.
Summary of changes
Asana Ticket: Redeploy RTS Migration to Concentrate
This PR changes the predictions parsing logic so that we can read from the GTFS-rt feed instead of RTR.
This was previously attempted with #743 but after seeing some issues with
BRD
predictions and passthrough announcements, we had to rollback and do some investigation.Following the investigation, some flaws in the filtering logic were uncovered so this new PR includes a minor adjustments which helps us more accurately filter out predictions where a train has already departed.
Note
There are still some things regarding passthrough announcements that need to be worked out before this PR can be merged which are described in this ticket