Skip to content

Conversation

@miklcct
Copy link
Contributor

@miklcct miklcct commented Oct 29, 2024

Summary

This adds a field called stopsInPattern in the Pattern model for the GTFS GraphQL API.

It provides information which cannot be accessed by the existing API, in particular, the board / alight types of stops in a pattern.

Issue

None yet.

Unit tests

The data fetcher code is not tested at all.

I have added a test for the model constructions.

Documentation

Added in GraphQL.

Note that NULL is used for a cancelled PickDrop to be consistent with existing API. It is not possible to change this without breaking backwards compatibility.

@codecov
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

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

Files with missing lines Patch % Lines
...ripplanner/apis/gtfs/datafetchers/PatternImpl.java 14.28% 6 Missing ⚠️
...nner/apis/gtfs/datafetchers/StopInPatternImpl.java 83.33% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6206      +/-   ##
=============================================
- Coverage      72.14%   72.14%   -0.01%     
- Complexity     19673    19677       +4     
=============================================
  Files           2127     2129       +2     
  Lines          79562    79581      +19     
  Branches        8041     8042       +1     
=============================================
+ Hits           57397    57410      +13     
- Misses         19331    19338       +7     
+ Partials        2834     2833       -1     

☔ 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 October 29, 2024 15:17
@miklcct miklcct requested a review from a team as a code owner October 29, 2024 15:17
@optionsome optionsome marked this pull request as draft November 7, 2024 15:31
@miklcct
Copy link
Contributor Author

miklcct commented Nov 14, 2024

@optionsome We discussed before about the use of Pattern in the API and your use case is to show timetables in the app, which you don't want to take real time stop skipping into account (it modifies the pattern in our internal model).

Are you actually showing the real time timetable (with updated times) on the website, or just the scheduled time? How do you deal with the case if a trip is real time diverted?

@miklcct
Copy link
Contributor Author

miklcct commented Nov 14, 2024

We may need to verify the current API behaviour by making a data set with patterns differing in only the board and alight actions.

@miklcct
Copy link
Contributor Author

miklcct commented Nov 15, 2024

I am republishing this PR for discussion. Our existing GTFS GraphQL API distinguish between patterns which differ only in pickup / drop off and they are listed separately in Stop.stoptimesForPatterns

@miklcct miklcct marked this pull request as ready for review November 15, 2024 10:18
@optionsome
Copy link
Member

I am republishing this PR for discussion. Our existing GTFS GraphQL API distinguish between patterns which differ only in pickup / drop off and they are listed separately in Stop.stoptimesForPatterns

I just checked this and looks like you are correct.

"List of stops served by this pattern"
stops: [Stop!]
"List of stops with pickup / dropoff type served by this pattern"
stopsInPattern: [StopInPattern!]!
Copy link
Member

Choose a reason for hiding this comment

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

What do you need this for? Is it just for the index? Isn't it straightforward to compute the index yourself, first item in the list is 0 and so on?

@t2gran t2gran added this to the 2.7 (next release) milestone Nov 29, 2024
@miklcct
Copy link
Contributor Author

miklcct commented Jan 17, 2025

After the meeting with @t2gran we agreed that adding a link to the new TripOnServiceDate class introduced in #5393 in StopTime will satisfy my use case.

I will mark this as draft now and discuss it with @optionsome on the next developer meeting.

@miklcct miklcct marked this pull request as draft January 17, 2025 15:46
@t2gran t2gran removed this from the 2.7 milestone Mar 12, 2025
@t2gran t2gran added this to the 2.8 (next release) milestone Mar 12, 2025
@t2gran t2gran modified the milestones: 2.8, 2.9 (next release) Sep 10, 2025
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.

4 participants