Skip to content
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

Merged
merged 31 commits into from
Nov 25, 2024
Merged

Migrate from RTR to GTFS-rt #810

merged 31 commits into from
Nov 25, 2024

Conversation

PaulJKim
Copy link
Collaborator

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

@PaulJKim PaulJKim requested a review from a team as a code owner August 26, 2024 20:19
Comment on lines +158 to +161
defp has_departed?(prediction) do
prediction.seconds_until_departure && prediction.seconds_until_departure < 0 &&
not prediction.stopped_at_predicted_stop?
end
Copy link
Collaborator Author

@PaulJKim PaulJKim Aug 26, 2024

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.

Copy link
Contributor

@sloanelybutsurely sloanelybutsurely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm!

.envrc.template Outdated Show resolved Hide resolved
@sloanelybutsurely sloanelybutsurely requested review from a team and sloanelybutsurely and removed request for sloanelybutsurely November 8, 2024 19:15
@PaulJKim PaulJKim deployed to dev-green-linux November 13, 2024 21:46 — with GitHub Actions Active
),
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"
Copy link
Contributor

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.

Copy link
Collaborator Author

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?

Copy link
Contributor

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.

Copy link
Collaborator

@panentheos panentheos left a 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.

@PaulJKim PaulJKim merged commit 9d5d608 into main Nov 25, 2024
2 checks passed
@PaulJKim PaulJKim deleted the pk/migrate-from-rtr-to-gtfs-rt branch November 25, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants