opentripplanner / OpenTripPlanner

An open source multi-modal trip planner
http://www.opentripplanner.org
Other
2.13k stars 1.01k forks source link

Filter routes and patterns by service date in GTFS GraphQL API #5869

Open leonardehrenfried opened 1 month ago

leonardehrenfried commented 1 month ago

Summary

TriMet has requested to be able to filter routes and their patterns based on the service dates that the operate on to only display those from the current week. The request is fleshed out in more details in #4879.

This makes the Date scalar implementation from the Transmodel API into a general one used by both APIs. Since the GTFS API also accepts dates in other places in yyyyMMdd format this would also become possible in the Transmodel API. Is this a problem?

Issue

4879

Unit tests

Lots added.

Documentation

Javadoc and GraphQL docs.

cc @miles-grant-ibigroup @fpurcell

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 79.74684% with 16 lines in your changes missing coverage. Please review.

Project coverage is 69.46%. Comparing base (2a5c8be) to head (b617f95). Report is 38 commits behind head on dev-2.x.

Files Patch % Lines
...ntripplanner/apis/gtfs/generated/GraphQLTypes.java 62.50% 8 Missing and 1 partial :warning:
...pplanner/apis/gtfs/datafetchers/QueryTypeImpl.java 0.00% 2 Missing and 1 partial :warning:
...ntripplanner/apis/gtfs/datafetchers/RouteImpl.java 75.00% 1 Missing and 1 partial :warning:
...ner/apis/gtfs/support/time/LocalDateRangeUtil.java 66.66% 1 Missing :warning:
...er/framework/graphql/scalar/DateScalarFactory.java 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev-2.x #5869 +/- ## =========================================== Coverage 69.45% 69.46% - Complexity 17070 17104 +34 =========================================== Files 1937 1940 +3 Lines 73692 73792 +100 Branches 7540 7555 +15 =========================================== + Hits 51184 51260 +76 - Misses 19880 19896 +16 - Partials 2628 2636 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

t2gran commented 1 month ago

See my comments in https://github.com/opentripplanner/OpenTripPlanner/issues/4879

leonardehrenfried commented 1 month ago

Note to self: clarify docs on service date.

fpurcell commented 1 day ago

BTW @leonardehrenfried and @miles-grant-ibigroup ... so looking forward to this fix, as the OTP-RR and Calltaker apps are really broken (and will continue to be until October) in terms of future versions of routes and stops showing up: https://rtp.trimet.org/rtp/#/route.

TriMet has a lot of changes coming in the September service change (https://trimet.org/betterbus/servicechanges-fy25proposed.htm#proposedchanges). That data is now in TriMet's gtfs.zip. Without a date filter, all of this junk is showing up and making for a confusing experience when viewing routes and stops that are not currently active.

leonardehrenfried commented 15 hours ago

@fpurcell Since many developers from Europe are on holiday these days it will be a little longer until we will have finished the review. If you are keen to have it beforehand (and @miles-grant-ibigroup has capacity) we can supply you with a preview version of it.

fpurcell commented 14 hours ago

Thanks Leonard ... no rush on my end, especially since the new call taker app is not yet in the hands of end-users. Just pointing out that these fixes will eliminate a lot of confusion in today's system.