-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Distinct coach from bus when reading in GTFS data and in GTFS GraphQL API #6171
Conversation
application/src/main/java/org/opentripplanner/framework/application/OTPFeature.java
Outdated
Show resolved
Hide resolved
...st/java/org/opentripplanner/apis/gtfs/mapping/routerequest/LegacyRouteRequestMapperTest.java
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6171 +/- ##
=============================================
- Coverage 69.91% 69.75% -0.17%
+ Complexity 17736 17652 -84
=============================================
Files 2006 2006
Lines 75526 75525 -1
Branches 7730 7731 +1
=============================================
- Hits 52804 52679 -125
- Misses 20036 20134 +98
- Partials 2686 2712 +26 ☔ View full report in Codecov by Sentry. |
application/src/main/java/org/opentripplanner/api/parameter/ApiRequestMode.java
Show resolved
Hide resolved
I think @leonardehrenfried already checked that coaches are not used in his deployments. I have now also checked that these are not used in ours. @flaktack are these used in any of yours? If no one opposed the idea, I think we could apply these changes even without the feature flag. |
We are for applying this without a feature flag. It is a reasonable change (bus is bus, coach is coach) which we've also done locally. |
I can confirm that I don't need a feature flag. |
Does this PR pose any incompatibilities with your local changes? |
# Conflicts: # application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java
43610b9
to
44c94d1
Compare
No, merging this as-is or without the features flag is OK with us. |
122b18a
to
06cf46d
Compare
application/src/main/java/org/opentripplanner/api/parameter/ApiRequestMode.java
Outdated
Show resolved
Hide resolved
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 remove the import and this is good to go.
application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java
Outdated
Show resolved
Hide resolved
application/src/test/java/org/opentripplanner/gtfs/mapping/TransitModeMapperTest.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Leonard Ehrenfried <[email protected]>
application/src/main/java/org/opentripplanner/gtfs/mapping/TransitModeMapper.java
Outdated
Show resolved
Hide resolved
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.
Should we also edit TraverseMode#fromTransitMode
? I'm a bit unsure what would be the effect of it. Seemingly Transmodel API also has this situation where COACH mode is replaced by BUS at least in one place.
Ignore this comment, I just realized the branch I was on used really old version of otp2 where there was transit mode stuff in |
Co-authored-by: Leonard Ehrenfried <[email protected]>
46a6c9c
to
13949af
Compare
Summary
The GTFS specification does not have official support for coach services (as distinct from bus services). This add support for coach services, which changes the behavior as follow:
plan
field in the GTFS GraphQL API is called withBUS
mode, only bus services are returned, whereas the current behavior, kept when the feature flag is off by default, is that bus and coach services are both returned in the itineraries.In addition, this fixes an API error
Exception while fetching data (/plan) : Qualified mode is not valid: 'COACH', details: No enum constant org.opentripplanner.api.parameter.ApiRequestMode.COACH
when I attempt to specifyCOACH
as a mode as an argument in theplan
field.This replaces #6086 for bus and coach services, without the change for the legacy REST API which has since been moved to the sandbox (I can put it back if desired).
Issue
Fixes #5550
Unit tests
Added for bus and coach
Documentation
Added