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

add stopPositionInPattern in Stoptime in GTFS GraphQL API #6204

Merged

Conversation

miklcct
Copy link
Contributor

@miklcct miklcct commented Oct 29, 2024

Summary

Add stopIndex in Stoptime model in GTFS GraphQL API.

The purpose of this field is to find the absolute position in a pattern, such as in conjunction with the pattern in Stop.stoptimesForPatterns.

Although the stopIndex field is used as the current implementation, it is considered an implementation detail, and this fetcher must return 0 to n-1 regardless of the implementation detail.

Issue

Closes #6026

Unit tests

The fetcher code is not tested at all and is untestable, but if possible the fetcher should be tested to always return 0 to n-1.

Documentation

Added in GraphQL.

@miklcct miklcct changed the title add stopIndex in Stoptime in GTFS GraphQL AP add stopIndex in Stoptime in GTFS GraphQL API Oct 29, 2024
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.72%. Comparing base (ee53e50) to head (bb653bc).
Report is 145 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6204      +/-   ##
=============================================
- Coverage      69.91%   69.72%   -0.19%     
+ Complexity     17736    17669      -67     
=============================================
  Files           2006     2007       +1     
  Lines          75526    75648     +122     
  Branches        7730     7741      +11     
=============================================
- Hits           52804    52749      -55     
- Misses         20036    20185     +149     
- Partials        2686     2714      +28     

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

@miklcct miklcct marked this pull request as ready for review October 29, 2024 14:14
@miklcct miklcct requested a review from a team as a code owner October 29, 2024 14:14
@miklcct miklcct changed the title add stopIndex in Stoptime in GTFS GraphQL API add stopPositionInPattern in Stoptime in GTFS GraphQL API Nov 5, 2024
stopIndex is considered an implementation detail in OTP which shouldn't be exposed, while stopPositionInPattern is guaranteed to run from 0 to n-1.
Copy link
Member

@optionsome optionsome left a comment

Choose a reason for hiding this comment

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

Use this new field in some integration test(s).

@leonardehrenfried leonardehrenfried merged commit 73f67b0 into opentripplanner:dev-2.x Nov 12, 2024
5 checks passed
t2gran pushed a commit that referenced this pull request Nov 12, 2024
@miklcct miklcct deleted the index-in-stoptime-in-pattern branch November 26, 2024 16:16
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.

Need stopPosition in Pattern in GraphQL
3 participants