Skip to content

Conversation

@leonardehrenfried
Copy link
Member

Summary

@daniel-heppner-ibigroup has reported that the time limit types 2 and 3 of the Fares V2 spec are not implemented. This is fixed by this PR.

Unit tests

The majority of the code in this PR is about testing: a new implementation of TransitLeg including an easy-to-use builder was added.

Bumping the serialization version id

@leonardehrenfried leonardehrenfried added the +GTFS Related to import of GTFS data label Nov 17, 2025
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner November 17, 2025 07:22
@leonardehrenfried leonardehrenfried added +Sandbox This will be implemented as a Sandbox feature +Skip Changelog This is not a relevant change for a product owner since last release. labels Nov 17, 2025
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.49%. Comparing base (7de21ea) to head (fe6fb30).
⚠️ Report is 122 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #7062      +/-   ##
=============================================
+ Coverage      72.29%   72.49%   +0.20%     
- Complexity     20182    20456     +274     
=============================================
  Files           2189     2205      +16     
  Lines          81217    82241    +1024     
  Branches        8140     8229      +89     
=============================================
+ Hits           58712    59622     +910     
- Misses         19630    19695      +65     
- Partials        2875     2924      +49     

☔ 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.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

Could you rename one test and its helper method to clarify what it does? Everything else seems to work fine.

.withEndTime("10:20")
.build();

private static List<Arguments> withInLimitCases() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to withinLimitCases.


@ParameterizedTest
@MethodSource("belowLimitCases")
void belowLimit(TimeLimitType type, Duration duration) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename to pastLimit or outsideLimit, to make it easy to see that the leg times fall outside of the transfer limit. Rename the method source accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this name is clearly incorrect. Thanks for spotting.

@binh-dam-ibigroup binh-dam-ibigroup removed their assignment Nov 19, 2025
Copy link
Member

@t2gran t2gran left a comment

Choose a reason for hiding this comment

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

There is a dependency from the RuleMapper to the Sandbox, this was already there before this PR - so it is ok to leave it. But If we want to split out Sandbox code into a separate module (we should), then the only allowed dependencies are those who is used by dependency injection(dagger).

@leonardehrenfried leonardehrenfried merged commit 1cfeadb into opentripplanner:dev-2.x Nov 20, 2025
8 checks passed
@leonardehrenfried leonardehrenfried deleted the more-transfer-types branch November 20, 2025 14:35
@leonardehrenfried
Copy link
Member Author

I have been thinking about moving the fares code into its own module for little while now and have a few ideas how to do it. Right now I am focussing on the street model, but I want to tackle it at some stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+GTFS Related to import of GTFS data +Sandbox This will be implemented as a Sandbox feature +Skip Changelog This is not a relevant change for a product owner since last release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants