Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into fix-skipped-removal
Browse files Browse the repository at this point in the history
  • Loading branch information
optionsome committed Jun 3, 2024
2 parents 64d307c + c71c2a7 commit ce0eeaa
Show file tree
Hide file tree
Showing 106 changed files with 1,084 additions and 1,081 deletions.
491 changes: 271 additions & 220 deletions client-next/package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions client-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@
"@graphql-codegen/introspection": "4.0.3",
"@parcel/watcher": "2.4.1",
"@testing-library/react": "15.0.7",
"@types/react": "18.3.2",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@vitejs/plugin-react": "4.2.1",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"@vitejs/plugin-react": "4.3.0",
"@vitest/coverage-v8": "1.6.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-refresh": "0.4.7",
"jsdom": "24.0.0",
"prettier": "3.2.5",
"jsdom": "24.1.0",
"prettier": "3.3.0",
"typescript": "5.4.5",
"vite": "5.2.11",
"vite": "5.2.12",
"vitest": "1.6.0"
}
}
5 changes: 5 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Make naming of stopTransferCosts/stopBoardAlightCosts consistent [#5822](https://github.com/opentripplanner/OpenTripPlanner/pull/5822)
- Namer for applying street names to nearby sidewalks [#5774](https://github.com/opentripplanner/OpenTripPlanner/pull/5774)
- Implement GTFS Flex safe duration spec draft [#5796](https://github.com/opentripplanner/OpenTripPlanner/pull/5796)
- Document and validate timeRange GraphQL parameter [#5834](https://github.com/opentripplanner/OpenTripPlanner/pull/5834)
- Log the origin of a request that causes a transfer cache addition. [#5874](https://github.com/opentripplanner/OpenTripPlanner/pull/5874)
- Fix handling of missing aimed departure time [#5865](https://github.com/opentripplanner/OpenTripPlanner/pull/5865)
- Add OTP request timeout GraphQL instrumentation [#5881](https://github.com/opentripplanner/OpenTripPlanner/pull/5881)
- Add feed publisher name and url to GTFS GraphQL API [#5835](https://github.com/opentripplanner/OpenTripPlanner/pull/5835)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)

## 2.5.0 (2024-03-13)
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@
<geotools.version>31.1</geotools.version>
<google.dagger.version>2.51.1</google.dagger.version>
<jackson.version>2.17.1</jackson.version>
<jersey.version>3.1.6</jersey.version>
<jersey.version>3.1.7</jersey.version>
<junit.version>5.10.2</junit.version>
<micrometer.version>1.13.0</micrometer.version>
<netcdf4.version>5.5.3</netcdf4.version>
<logback.version>1.5.6</logback.version>
<lucene.version>9.10.0</lucene.version>
<slf4j.version>2.0.13</slf4j.version>
<netex-java-model.version>2.0.15</netex-java-model.version>
<siri-java-model.version>1.26</siri-java-model.version>
<siri-java-model.version>1.27</siri-java-model.version>
<jaxb-runtime.version>4.0.5</jaxb-runtime.version>
<!-- Other properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -363,7 +363,7 @@
properly if some input files are missing a terminating newline) -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -444,7 +444,7 @@
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.4.2</version>
<version>3.4.3</version>
<configuration>
<container>
<mainClass>org.opentripplanner.standalone.OTPMain</mainClass>
Expand Down Expand Up @@ -672,9 +672,9 @@
</dependency>

<dependency>
<groupId>org.entur.gbfs</groupId>
<groupId>org.mobilitydata</groupId>
<artifactId>gbfs-java-model</artifactId>
<version>3.1.3</version>
<version>1.0.6</version>
</dependency>

<!-- TESTING -->
Expand Down Expand Up @@ -1013,7 +1013,7 @@
<!-- Recommended way to deploy to OSSRH , which allows deferred manual release to Central. -->
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
5 changes: 3 additions & 2 deletions renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
// noise, so we slow it down a bit
{
"matchPackageNames": [
"org.entur.gbfs:gbfs-java-model"
"org.mobilitydata:gbfs-java-model"
],
"matchUpdateTypes": ["patch"],
"schedule": "on the 18th day of the month",
Expand Down Expand Up @@ -122,7 +122,8 @@
"com.google.cloud.tools:jib-maven-plugin",
"org.apache.maven.plugins:maven-shade-plugin",
"org.apache.maven.plugins:maven-compiler-plugin",
"org.apache.maven.plugins:maven-jar-plugin"
"org.apache.maven.plugins:maven-jar-plugin",
"org.sonatype.plugins:nexus-staging-maven-plugin"
],
"matchPackagePrefixes": [
"org.junit.jupiter:",
Expand Down
4 changes: 2 additions & 2 deletions src/client/debug-client-preview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/img/otp-logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OTP Debug Client</title>
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/05/2024-05-22T13:15/assets/index-Ckc7wSgy.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/05/2024-05-22T13:15/assets/index-CrZjV0cy.css">
<script type="module" crossorigin src="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/06/2024-06-03T06:10/assets/index-BYIu3HuU.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/gh/opentripplanner/debug-client-assets@main/2024/06/2024-06-03T06:10/assets/index-CrZjV0cy.css">
</head>
<body>
<div id="root"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FlexPathTest {

static List<Arguments> cases() {
return List.of(
Arguments.of(TimePenalty.ZERO, THIRTY_MINS_IN_SECONDS),
Arguments.of(TimePenalty.NONE, THIRTY_MINS_IN_SECONDS),
Arguments.of(TimePenalty.of(Duration.ofMinutes(10), 1), 2400),
Arguments.of(TimePenalty.of(Duration.ofMinutes(10), 1.5f), 3300),
Arguments.of(TimePenalty.of(Duration.ZERO, 3), 5400)
Expand All @@ -30,8 +30,8 @@ static List<Arguments> cases() {

@ParameterizedTest
@MethodSource("cases")
void calculate(TimePenalty mod, int expectedSeconds) {
var modified = PATH.withDurationModifier(mod);
void calculate(TimePenalty penalty, int expectedSeconds) {
var modified = PATH.withTimePenalty(penalty);
assertEquals(expectedSeconds, modified.durationSeconds);
assertEquals(LineStrings.SIMPLE, modified.getGeometry());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package org.opentripplanner.ext.flex.trip;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.opentripplanner.graph_builder.issue.api.DataImportIssueStore.NOOP;

import java.util.List;
import org.junit.jupiter.api.Test;
import org.opentripplanner.ext.flex.FlexStopTimesForTest;
import org.opentripplanner.ext.flex.FlexTripsMapper;
import org.opentripplanner.ext.flex.flexpathcalculator.DirectFlexPathCalculator;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.impl.OtpTransitServiceBuilder;
import org.opentripplanner.transit.model._data.TransitModelForTest;
import org.opentripplanner.transit.service.StopModel;

class FlexTripsMapperTest {

@Test
void defaultTimePenalty() {
var builder = new OtpTransitServiceBuilder(StopModel.of().build(), NOOP);
var stopTimes = List.of(stopTime(0), stopTime(1));
builder.getStopTimesSortedByTrip().addAll(stopTimes);
var trips = FlexTripsMapper.createFlexTrips(builder, NOOP);
assertEquals("[UnscheduledTrip{F:flex-1}]", trips.toString());
var unscheduled = (UnscheduledTrip) trips.getFirst();
var unchanged = unscheduled.flexPathCalculator(new DirectFlexPathCalculator());
assertInstanceOf(DirectFlexPathCalculator.class, unchanged);
}

private static StopTime stopTime(int seq) {
var st = FlexStopTimesForTest.area("08:00", "18:00");
st.setTrip(TransitModelForTest.trip("flex-1").build());
st.setStopSequence(seq);
return st;
}
}
66 changes: 60 additions & 6 deletions src/ext-test/java/org/opentripplanner/ext/siri/SiriEtBuilder.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package org.opentripplanner.ext.siri;

import java.math.BigInteger;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
import org.opentripplanner.DateTimeHelper;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.site.StopLocation;
import uk.org.siri.siri20.DataFrameRefStructure;
import uk.org.siri.siri20.DatedVehicleJourneyRef;
import uk.org.siri.siri20.EstimatedCall;
import uk.org.siri.siri20.EstimatedTimetableDeliveryStructure;
import uk.org.siri.siri20.EstimatedVehicleJourney;
import uk.org.siri.siri20.EstimatedVersionFrameStructure;
import uk.org.siri.siri20.FramedVehicleJourneyRefStructure;
import uk.org.siri.siri20.LineRef;
import uk.org.siri.siri20.OperatorRefStructure;
import uk.org.siri.siri20.QuayRefStructure;
Expand Down Expand Up @@ -129,6 +133,42 @@ public SiriEtBuilder withVehicleJourneyRef(String id) {
return this;
}

public SiriEtBuilder withFramedVehicleJourneyRef(
Function<FramedVehicleRefBuilder, FramedVehicleRefBuilder> producer
) {
var builder = new FramedVehicleRefBuilder();
builder = producer.apply(builder);
evj.setFramedVehicleJourneyRef(builder.build());
return this;
}

public static class FramedVehicleRefBuilder {

private LocalDate serviceDate;
private String vehicleJourneyRef;

public SiriEtBuilder.FramedVehicleRefBuilder withServiceDate(LocalDate serviceDate) {
this.serviceDate = serviceDate;
return this;
}

public SiriEtBuilder.FramedVehicleRefBuilder withVehicleJourneyRef(String vehicleJourneyRef) {
this.vehicleJourneyRef = vehicleJourneyRef;
return this;
}

public FramedVehicleJourneyRefStructure build() {
DataFrameRefStructure dataFrameRefStructure = new DataFrameRefStructure();
if (serviceDate != null) {
dataFrameRefStructure.setValue(DateTimeFormatter.ISO_LOCAL_DATE.format(serviceDate));
}
FramedVehicleJourneyRefStructure framedVehicleJourneyRefStructure = new FramedVehicleJourneyRefStructure();
framedVehicleJourneyRefStructure.setDataFrameRef(dataFrameRefStructure);
framedVehicleJourneyRefStructure.setDatedVehicleJourneyRef(vehicleJourneyRef);
return framedVehicleJourneyRefStructure;
}
}

public static class RecordedCallsBuilder {

private final ArrayList<RecordedCall> calls;
Expand Down Expand Up @@ -208,17 +248,31 @@ public EstimatedCallsBuilder call(StopLocation stop) {
return this;
}

public EstimatedCallsBuilder arriveAimedExpected(String aimedTime, String expectedTime) {
public EstimatedCallsBuilder arriveAimedExpected(
@Nullable String aimedTime,
@Nullable String expectedTime
) {
var call = calls.getLast();
call.setAimedArrivalTime(dateTimeHelper.zonedDateTime(aimedTime));
call.setExpectedArrivalTime(dateTimeHelper.zonedDateTime(expectedTime));
if (aimedTime != null) {
call.setAimedArrivalTime(dateTimeHelper.zonedDateTime(aimedTime));
}
if (expectedTime != null) {
call.setExpectedArrivalTime(dateTimeHelper.zonedDateTime(expectedTime));
}
return this;
}

public EstimatedCallsBuilder departAimedExpected(String aimedTime, String expectedTime) {
public EstimatedCallsBuilder departAimedExpected(
@Nullable String aimedTime,
@Nullable String expectedTime
) {
var call = calls.getLast();
call.setAimedDepartureTime(dateTimeHelper.zonedDateTime(aimedTime));
call.setExpectedDepartureTime(dateTimeHelper.zonedDateTime(expectedTime));
if (aimedTime != null) {
call.setAimedDepartureTime(dateTimeHelper.zonedDateTime(aimedTime));
}
if (expectedTime != null) {
call.setExpectedDepartureTime(dateTimeHelper.zonedDateTime(expectedTime));
}
return this;
}

Expand Down
Loading

0 comments on commit ce0eeaa

Please sign in to comment.