Skip to content

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

Merged
leonardehrenfried merged 46 commits into
opentripplanner:dev-2.xfrom
ibi-group:route-filter
Jul 30, 2024
Merged

Filter routes and patterns by service date in GTFS GraphQL API#5869
leonardehrenfried merged 46 commits into
opentripplanner:dev-2.xfrom
ibi-group:route-filter

Conversation

@leonardehrenfried

Copy link
Copy Markdown
Member

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

@leonardehrenfried leonardehrenfried added the !New Feature A functional feature targeting the end user. label May 24, 2024
@leonardehrenfried
leonardehrenfried requested a review from a team as a code owner May 24, 2024 15:33
@codecov

codecov Bot commented May 24, 2024

Copy link
Copy Markdown

Codecov Report

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

Project coverage is 69.65%. Comparing base (2a5c8be) to head (3cf6130).
Report is 196 commits behind head on dev-2.x.

Files Patch % Lines
...ntripplanner/apis/gtfs/generated/GraphQLTypes.java 54.54% 9 Missing and 1 partial ⚠️
...pplanner/apis/gtfs/datafetchers/QueryTypeImpl.java 0.00% 1 Missing and 1 partial ⚠️
...ntripplanner/apis/gtfs/datafetchers/RouteImpl.java 75.00% 1 Missing and 1 partial ⚠️
...ner/apis/gtfs/support/time/LocalDateRangeUtil.java 66.66% 1 Missing ⚠️
...er/framework/graphql/scalar/DateScalarFactory.java 85.71% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5869      +/-   ##
=============================================
+ Coverage      69.45%   69.65%   +0.20%     
- Complexity     17070    17195     +125     
=============================================
  Files           1937     1946       +9     
  Lines          73692    73866     +174     
  Branches        7540     7562      +22     
=============================================
+ Hits           51184    51453     +269     
+ Misses         19880    19782      -98     
- Partials        2628     2631       +3     

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

@leonardehrenfried
leonardehrenfried requested a review from t2gran May 28, 2024 09:32
@leonardehrenfried leonardehrenfried added TriMet IBI Developed by or important for IBI Group labels May 28, 2024
@t2gran

t2gran commented Jun 3, 2024

Copy link
Copy Markdown
Member

See my comments in #4879

@leonardehrenfried

Copy link
Copy Markdown
Member Author

Note to self: clarify docs on service date.

@t2gran t2gran added this to the 2.6 (next release) milestone Jun 7, 2024
Comment thread src/main/java/org/opentripplanner/apis/gtfs/PatternByServiceDatesFilter.java Outdated
Comment thread src/main/java/org/opentripplanner/framework/graphql/scalar/DateScalarFactory.java Outdated
Comment thread src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls Outdated
Comment thread src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls Outdated
Comment thread src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls Outdated
Comment thread src/test/java/org/opentripplanner/apis/gtfs/PatternByServiceDatesFilterTest.java Outdated
Comment thread src/test/java/org/opentripplanner/apis/gtfs/PatternByServiceDatesFilterTest.java Outdated
Comment thread src/main/resources/org/opentripplanner/apis/gtfs/schema.graphqls
Comment thread src/test/java/org/opentripplanner/apis/gtfs/PatternByServiceDatesFilterTest.java Outdated
Comment thread src/test/java/org/opentripplanner/apis/gtfs/mapping/LocalDateRangeMapperTest.java Outdated
Comment thread src/test/java/org/opentripplanner/apis/gtfs/mapping/LocalDateRangeMapperTest.java Outdated
Comment thread src/main/java/org/opentripplanner/apis/gtfs/PatternByServiceDatesFilter.java Outdated
optionsome
optionsome previously approved these changes Jul 8, 2024
@fpurcell

fpurcell commented Jul 11, 2024

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

@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

Copy link
Copy Markdown
Member

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.

Comment thread src/main/java/org/opentripplanner/apis/gtfs/model/LocalDateRange.java Outdated
…ge.java

Co-authored-by: Thomas Gran <t2gran@gmail.com>
@leonardehrenfried
leonardehrenfried merged commit 09be088 into opentripplanner:dev-2.x Jul 30, 2024
t2gran pushed a commit that referenced this pull request Jul 30, 2024
@leonardehrenfried
leonardehrenfried deleted the route-filter branch July 30, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IBI Developed by or important for IBI Group !New Feature A functional feature targeting the end user. TriMet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants