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

Log failed itin checks and bus notifs #263

Merged
merged 18 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
9c1027f
refactor(CheckMonitoredTrip): Log instances where no matching itinera…
binh-dam-ibigroup Oct 21, 2024
3418ef8
refactor(UsRideGw...Operator): Log before sending bus notifications.
binh-dam-ibigroup Oct 21, 2024
9b4115f
refactor(CheckMonitoredTrip): Dump comparison itinerary data.
binh-dam-ibigroup Oct 21, 2024
aa05049
refactor(CheckMonitoredTrip): Add trip id in logs, log null OTP respo…
binh-dam-ibigroup Oct 22, 2024
111af9b
refactor(BusOpAction): Add log to confirm actions.
binh-dam-ibigroup Oct 22, 2024
878c54c
fix(ItineraryUtils): use OTP2 objects.
binh-dam-ibigroup Oct 22, 2024
4f1dc85
ci(mnaven): Temp remove e2e tests
binh-dam-ibigroup Oct 22, 2024
dcfcbf6
fix(ItineraryUtils): Use Otp2 stop gtfsid
binh-dam-ibigroup Oct 22, 2024
a8fcae4
refactor(ItineraryExistence): Log failed day-of itinerary checks.
binh-dam-ibigroup Oct 23, 2024
967e6f3
fix(MonitoredTripController): Tolerate not-found trips after saving/e…
binh-dam-ibigroup Oct 23, 2024
935558d
fix(ItineraryExistence): Tweak error message about non-existent itine…
binh-dam-ibigroup Oct 24, 2024
24a20c6
fix(ItineraryExistence): Remove \\n from error message about non-exis…
binh-dam-ibigroup Oct 24, 2024
de0922d
Merge branch 'dev' into log-failed-itin-checks-and-bus-notifs
binh-dam-ibigroup Oct 25, 2024
22423f8
refactor(ItineraryExistence): Tweak error message for trip not possible.
binh-dam-ibigroup Oct 29, 2024
b937857
Revert "ci(mnaven): Temp remove e2e tests"
binh-dam-ibigroup Oct 31, 2024
ccbde41
refactor(ItineraryExistence): Extract method for logging itins not fo…
binh-dam-ibigroup Nov 1, 2024
bebd4e9
style(ItineraryExistence): Add full stops and address indents.
binh-dam-ibigroup Nov 5, 2024
6f0de6e
refactor(ItineraryExistence): Combine 3 log statements into one.
binh-dam-ibigroup Nov 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.opentripplanner.middleware.utils.DateTimeUtils;
import org.opentripplanner.middleware.utils.I18nUtils;
import org.opentripplanner.middleware.utils.ItineraryUtils;
import org.opentripplanner.middleware.utils.JsonUtils;
import org.opentripplanner.middleware.utils.NotificationUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -301,7 +302,9 @@ private boolean makeOTPRequestAndUpdateMatchingItineraryInternal() {
}

// If this point is reached, a matching itinerary was not found
LOG.warn("No comparison itinerary found in otp response for trip");
LOG.warn("No comparison itinerary found in otp response for trip - params: {}", JsonUtils.toJson(this.trip.otp2QueryParams));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. this. is not needed.

LOG.warn("No comparison itinerary found in otp response for trip - saved itinerary: {}", JsonUtils.toJson(this.trip.itinerary));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit. this. is not needed.

LOG.warn("No comparison itinerary found in otp response for trip - OTP itineraries: {}", JsonUtils.toJson(otpResponse.plan.itineraries));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this guard against a NPE in case plan is null?


if (hasReachedMaxItineraryChecks()) {
// Check whether this trip should no longer ever be checked due to not having matching itineraries on any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public void cancelNotification(TravelerPosition travelerPosition) {
* Makes a call to the bus driver notification API, followed by a call to the bus priority API.
*/
private static void makeApiRequests(TravelerPosition travelerPosition, String body, String routeId, String action) {
LOG.info("Sending bus operator/priority requests: {}", body);

var httpStatus = postBusDriverNotification(body);
if (httpStatus == HttpStatus.OK_200) {
travelerPosition.trackedJourney.updateNotificationMessage(routeId, body);
Expand Down
Loading