Skip to content

Itin checks using legid#357

Open
binh-dam-ibigroup wants to merge 111 commits intodevfrom
itin-checks-using-legid
Open

Itin checks using legid#357
binh-dam-ibigroup wants to merge 111 commits intodevfrom
itin-checks-using-legid

Conversation

@binh-dam-ibigroup
Copy link
Collaborator

@binh-dam-ibigroup binh-dam-ibigroup commented Nov 26, 2025

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JavaDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

This PR changes the approach for checking itinerary existence. Instead of sending plan queries to OTP, we send instead leg queries based on expected leg id, and we attempt to reconstruct the original itinerary with the updated legs. If there is sufficient time for transfers between two consecutive transit legs, the reconstructed itinerary is deemed valid.

Many tests using plan queries are rewritten to use leg queries, however the functionality to send plan queries remains/is not deleted yet. (so is the mock OTP test feature)

There are no UI changes. The following should still work with the latest OTP-RR code:

  • Saving a new trip for monitoring
  • Editing a monitored trip
  • Previewing a monitored trip.

@binh-dam-ibigroup binh-dam-ibigroup marked this pull request as ready for review January 2, 2026 22:02
return new ItineraryFromLegMatcher(itinerary, legResponses).process();
}

private Map<String, Leg> getLegResponsesNonThreaded(List<Leg> transitLegs) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment as to why this might be used instead of the threaded version.

Copy link
Contributor

@br648 br648 left a comment

Choose a reason for hiding this comment

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

Good enhancement.

# Conflicts:
#	src/main/java/org/opentripplanner/middleware/otp/response/Leg.java
#	src/test/java/org/opentripplanner/middleware/tripmonitor/jobs/CheckMonitoredTripTest.java
Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup left a comment

Choose a reason for hiding this comment

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

Very unfamiliar with the codebase, but it looks good from my scroll through.

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.

3 participants