Skip to content

Conversation

@miklcct
Copy link
Contributor

@miklcct miklcct commented Feb 7, 2025

Summary

This adds a canceled field into Place in GTFS GraphQL API, which is referenced in Leg.

It allows clients to show to the rider that if the boarding call, alighting call, or any of the intermediate calls are canceled.

It is possible to see if the boarding call or alighting call is canceled now indirectly by using pickupType and dropoffType in Leg (if the leg is a transit leg and it is null, it means that the call is canceled, but this is not documented at the API level and is only inferred by reading the code), but not intermediate calls.

Issue

#6441

Unit tests

I have added a unit test for intermediate calls.

Documentation

Added in GraphQL

@codecov
Copy link

codecov bot commented Feb 7, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.14%. Comparing base (87cf700) to head (f991526).
⚠️ Report is 1 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...pentripplanner/apis/gtfs/datafetchers/LegImpl.java 66.66% 0 Missing and 2 partials ⚠️
...entripplanner/apis/gtfs/datafetchers/PlanImpl.java 0.00% 2 Missing ⚠️
...ripplanner/model/plan/leg/FrequencyTransitLeg.java 0.00% 2 Missing ⚠️
...ntripplanner/model/plan/leg/StopArrivalMapper.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #6445   +/-   ##
==========================================
  Coverage      72.14%   72.14%           
- Complexity     19673    19678    +5     
==========================================
  Files           2127     2127           
  Lines          79562    79570    +8     
  Branches        8041     8047    +6     
==========================================
+ Hits           57397    57403    +6     
  Misses         19331    19331           
- Partials        2834     2836    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@miklcct miklcct marked this pull request as ready for review February 11, 2025 15:48
@miklcct miklcct requested a review from a team as a code owner February 11, 2025 15:48
@optionsome
Copy link
Member

Perhaps LegTime would be a more fitting place for this information rather than directly on Place. The reason is that in theory, departure from a stop might be canceled while arrival is still scheduled because the last stop(s) of the trip are canceled. Also, maybe we should differentiate between "planned cancellations" and "real-time cancellations". For that, there are two options: either make the boolean field's name more specific or some sort of an enum. I think we have previously identified some issues with trying to combine too many things into one enum as a trip might be both added and cancelled, for example. So maybe I'm leaning towards a boolean field called isRealTimeCanceled on the LegTime.

We could discuss this in a dev meeting next week.

@miklcct
Copy link
Contributor Author

miklcct commented Feb 14, 2025

GTFS does not support planned cancellations and I have no idea how it works internally with Transmodel.

Also, I don't think that it is possible to cancel the arrival but not departure even if the trip is terminated short in the current model.

@t2gran t2gran added this to the Parked milestone Feb 18, 2025
@t2gran t2gran marked this pull request as draft February 18, 2025 10:18
@optionsome
Copy link
Member

We decided to do a bigger refactoring after 2.7. For now, the pickup/dropoff statuses can be used to interpret that a stop is cancelled/skipped. We are parking this pr for now.

@optionsome optionsome removed their request for review February 24, 2025 12:19
miklcct added 2 commits March 7, 2025 10:11
# Conflicts:
#	application/src/test/java/org/opentripplanner/model/plan/ScheduledTransitLegTest.java
@t2gran t2gran modified the milestones: Parked, 2.8 (next release) Mar 12, 2025
miklcct and others added 8 commits March 12, 2025 16:38
# Conflicts:
#	application/src/main/java/org/opentripplanner/apis/gtfs/datafetchers/LegImpl.java
#	application/src/main/java/org/opentripplanner/model/plan/leg/FrequencyTransitLeg.java
#	application/src/test/java/org/opentripplanner/model/plan/ScheduledTransitLegTest.java
@t2gran t2gran modified the milestones: 2.8, 2.9 (next release) Sep 10, 2025
# Conflicts:
#	application/src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
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.

3 participants