Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
Browse files Browse the repository at this point in the history
…023-07-12
  • Loading branch information
leonardehrenfried committed Jul 12, 2023
2 parents b7a1578 + c9f60c6 commit d354f25
Show file tree
Hide file tree
Showing 229 changed files with 3,373 additions and 2,759 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
# schema hasn't changed.
# example commit: https://github.com/opentripplanner/docs/commit/45e6ddf8e4a4
SCHEMA_FILE_MODIFIED=`git log -n 1 --pretty=format:%ct src/ext/resources/legacygraphqlapi/schema.graphqls`
SCHEMA_FILE_MODIFIED=`git log -n 1 --pretty=format:%ct src/ext/resources/gtfsgraphqlapi/schema.graphqls`
echo "schema modified at ${SCHEMA_FILE_MODIFIED}"
git checkout $LOCAL_BRANCH
DOCS_MODIFIED=`git log -n 1 --pretty=format:%ct api/dev-2.x/graphql-gtfs/introduction.html`
Expand All @@ -203,7 +203,7 @@ jobs:
with:
node-version: 16
- name: Run code generator
working-directory: src/ext/java/org/opentripplanner/ext/legacygraphqlapi/generated
working-directory: src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/generated
run: |
yarn install
yarn generate
Expand Down
5 changes: 4 additions & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Empty stop_headsign will fall back to trip_headsign [#5205](https://github.com/opentripplanner/OpenTripPlanner/pull/5205)
- Refactor HTTP client [#5213](https://github.com/opentripplanner/OpenTripPlanner/pull/5213)
- Add escalator reluctance parameter [#5046](https://github.com/opentripplanner/OpenTripPlanner/pull/5046)
- Handle reverse search when starting in no-drop-off zone [#5201](https://github.com/opentripplanner/OpenTripPlanner/pull/5201)
- Refactor edge constructors [#5221](https://github.com/opentripplanner/OpenTripPlanner/pull/5221)
- Upgrade to Apache HTTP Client 5 [#5228](https://github.com/opentripplanner/OpenTripPlanner/pull/5228)
[](AUTOMATIC_CHANGELOG_PLACEHOLDER_DO_NOT_REMOVE)


Expand Down Expand Up @@ -219,7 +222,7 @@ based on merged pull requests. Search GitHub issues and pull requests for smalle
- Cost-based wheelchair accessibility routing for streets [#4163](https://github.com/opentripplanner/OpenTripPlanner/pull/4163)
- Expose SIRI ET PredictionInaccurate in Transmodel-API [#4217](https://github.com/opentripplanner/OpenTripPlanner/pull/4217)
- Do not apply walkable area processing to open platform geometries [#4225](https://github.com/opentripplanner/OpenTripPlanner/pull/4225)
- Add field 'routingErrors' to LegacyGraphQLAPI [#4253](https://github.com/opentripplanner/OpenTripPlanner/pull/4253)
- Add field 'routingErrors' to GTFS GraphQLAPI [#4253](https://github.com/opentripplanner/OpenTripPlanner/pull/4253)
- Configure idempotent upload to Google Cloud Storage [#4269](https://github.com/opentripplanner/OpenTripPlanner/pull/4269)
- Add support to unprefer certain routes [#4238](https://github.com/opentripplanner/OpenTripPlanner/pull/4238)
- Fix inconsistent mapping of NeTEx quay publicCode [#4282](https://github.com/opentripplanner/OpenTripPlanner/pull/4282)
Expand Down
2 changes: 1 addition & 1 deletion docs/RouteRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ and in the [transferRequests in build-config.json](BuildConfiguration.md#transfe
| elevatorBoardTime | `integer` | How long does it take to get on an elevator, on average. | *Optional* | `90` | 2.0 |
| elevatorHopCost | `integer` | What is the cost of travelling one floor on an elevator? | *Optional* | `20` | 2.0 |
| elevatorHopTime | `integer` | How long does it take to advance one floor on an elevator? | *Optional* | `20` | 2.0 |
| escalatorReluctance | `double` | A multiplier for how bad being in an escalator is compared to being in transit for equal lengths of time | *Optional* | `1.5` | na |
| escalatorReluctance | `double` | A multiplier for how bad being in an escalator is compared to being in transit for equal lengths of time | *Optional* | `1.5` | 2.4 |
| geoidElevation | `boolean` | If true, the Graph's ellipsoidToGeoidDifference is applied to all elevations returned by this query. | *Optional* | `false` | 2.0 |
| ignoreRealtimeUpdates | `boolean` | When true, realtime updates are ignored during this search. | *Optional* | `false` | 2.0 |
| [intersectionTraversalModel](#rd_intersectionTraversalModel) | `enum` | The model that computes the costs of turns. | *Optional* | `"simple"` | 2.2 |
Expand Down
2 changes: 1 addition & 1 deletion docs/RouterConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Maximum processing time for an API request

This timeout limits the server-side processing time for a given API request. This does not include
network latency nor waiting time in the HTTP server thread pool. The default value is
`-1s`(no timeout). The timeout is applied to all APIs (REST, Transmodel , Legacy GraphQL).
`-1s`(no timeout). The timeout is applied to all APIs (REST, Transmodel & GTFS GraphQL).
The timeout is not enforced when the parallel routing OTP feature is in use.


Expand Down
4 changes: 2 additions & 2 deletions docs/sandbox/GtfsGraphQlApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ on this API and the [Transmodel GraphQL API](TransmodelApi.md). The new API will

## Changelog

- Initial version of Legacy Graph QL API (September 2020)
- Initial version of GTFS Graph QL API (September 2020)
- Added ids parameter to bikeRentalStations query (May 2021, [#3450](https://github.com/opentripplanner/OpenTripPlanner/pull/3450))
- Added capacity and allowOverloading fields to bike rental stations (not yet properly implemented) (May 2021, [#3450](https://github.com/opentripplanner/OpenTripPlanner/pull/3450))
- Updated documentation and process for generating Java code from GraphQL schema definition (May 2021, [#3450](https://github.com/opentripplanner/OpenTripPlanner/pull/3450))
Expand All @@ -75,7 +75,7 @@ on this API and the [Transmodel GraphQL API](TransmodelApi.md). The new API will
- Fix issue with GraphQL code generator (February 2022, [#3881](https://github.com/opentripplanner/OpenTripPlanner/pull/3881))
- Add GBFS form factors for `rentalVehicle` (April 2022, [#4062](https://github.com/opentripplanner/OpenTripPlanner/pull/4062))
- Implement allowedBikeRentalNetworks while deprecating it and add allowedVehicleRentalNetworks and bannedVehicleRentalNetworks. (July 2022, [#4279](https://github.com/opentripplanner/OpenTripPlanner/pull/4279))
- Filters place types in legacy GraphQL API so that a bike park type is not returned if a vehicle parking has no bicycle spaces and car park type is not returned if a parking has no car spaces. (July 2022, [#4296](https://github.com/opentripplanner/OpenTripPlanner/pull/4296))
- Filters place types in GTFS GraphQL API so that a bike park type is not returned if a vehicle parking has no bicycle spaces and car park type is not returned if a parking has no car spaces. (July 2022, [#4296](https://github.com/opentripplanner/OpenTripPlanner/pull/4296))
- Include departures with skipped stops in the Stop type's stopTimesForPattern query. (July 2022, [#4299](https://github.com/opentripplanner/OpenTripPlanner/pull/4299))
- Add built-in GraphQL client. (October 2022, [#4499](https://github.com/opentripplanner/OpenTripPlanner/pull/4499))
- Implement support for omitCanceled parameter in some stop's stoptime queries (October 2022, [#4504]([#4504](https://github.com/opentripplanner/OpenTripPlanner/pull/4504)))
Expand Down
2 changes: 1 addition & 1 deletion magidoc.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
introspection: {
type: 'sdl',
paths: ['src/ext/resources/legacygraphqlapi/schema.graphqls'],
paths: ['src/ext/resources/gtfsgraphqlapi/schema.graphqls'],
},
website: {
template: 'carbon-multi-page',
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@


<properties>
<otp.serialization.version.id>110</otp.serialization.version.id>
<otp.serialization.version.id>111</otp.serialization.version.id>
<!-- Lib versions - keep list sorted on property name -->
<geotools.version>29.1</geotools.version>
<google.dagger.version>2.46.1</google.dagger.version>
<jackson.version>2.15.2</jackson.version>
<jersey.version>3.1.2</jersey.version>
<junit.version>5.9.3</junit.version>
<micrometer.version>1.11.1</micrometer.version>
<micrometer.version>1.11.2</micrometer.version>
<netcdf4.version>5.5.3</netcdf4.version>
<netty.version>4.1.74.Final</netty.version>
<logback.version>1.4.8</logback.version>
Expand Down Expand Up @@ -945,9 +945,9 @@
<version>20.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.2.1</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
Expand Down
Binary file modified src/client/images/mode/scooter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions src/client/js/otp/util/Itin.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ otp.util.Itin = {

vertexTypeStrings : {
//TRANSLATORS: WALK/CYCLE distance to [Bicycle rental station]
'BIKESHARE_EMPTY': _tr('Bicycle rental station'),
'BIKESHARE_EMPTY': _tr('Vehicle rental station'),
//TRANSLATORS: WALK/CYCLE distance to [Bicycle rental] {name}
'BIKESHARE': _tr('Bicycle rental'),
'BIKESHARE': _tr('Vehicle rental'),
'TRANSIT': ""
},

Expand All @@ -261,7 +261,14 @@ otp.util.Itin = {
vertexType += "_EMPTY";
}
if (vertexType in this.vertexTypeStrings) {
return this.vertexTypeStrings[vertexType] + " " + place.name;
const name = `${this.vertexTypeStrings[vertexType]} ${place.name}`;
if (place.networks && place.networks.length) {
const network = place.networks[0];
return `${name} (${network})`;
} else {
return name;
}

} else {
if (vertexType !== "NORMAL") {
console.log(vertexType + " not found in strings!");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.opentripplanner.ext.legacygraphqlapi;
package org.opentripplanner.ext.gtfsgraphqlapi;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
Expand All @@ -19,20 +19,20 @@ public class GraphQLIndexTest {

@Test
public void build() {
var schema = LegacyGraphQLIndex.buildSchema();
var schema = GtfsGraphQLIndex.buildSchema();
assertNotNull(schema);
}

@ValueSource(strings = { "plan", "nearest" })
@ParameterizedTest(name = "\"{0}\" must be a an async fetcher")
void asyncDataFetchers(String fieldName) {
OTPFeature.AsyncGraphQLFetchers.testOn(() -> {
var schema = LegacyGraphQLIndex.buildSchema();
var schema = GtfsGraphQLIndex.buildSchema();
var fetcher = getQueryType(fieldName, schema);
assertSame(fetcher.getClass(), AsyncDataFetcher.class);
});
OTPFeature.AsyncGraphQLFetchers.testOff(() -> {
var schema = LegacyGraphQLIndex.buildSchema();
var schema = GtfsGraphQLIndex.buildSchema();
var fetcher = getQueryType(fieldName, schema);
assertNotSame(fetcher.getClass(), AsyncDataFetcher.class);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.opentripplanner.ext.legacygraphqlapi;
package org.opentripplanner.ext.gtfsgraphqlapi;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
Expand Down Expand Up @@ -88,7 +88,7 @@ class GraphQLIntegrationTest {
.toInstant();
static final Instant ALERT_END_TIME = ALERT_START_TIME.plus(1, ChronoUnit.DAYS);

private static final LegacyGraphQLRequestContext context;
private static final GraphQLRequestContext context;

private static final Deduplicator DEDUPLICATOR = new Deduplicator();

Expand Down Expand Up @@ -196,7 +196,7 @@ public List<TransitMode> getModesOfStopLocation(StopLocation stop) {
}
};
context =
new LegacyGraphQLRequestContext(
new GraphQLRequestContext(
new TestRoutingService(List.of(i1)),
transitService,
new DefaultFareService(),
Expand All @@ -208,11 +208,11 @@ public List<TransitMode> getModesOfStopLocation(StopLocation stop) {
);
}

@FilePatternSource(pattern = "src/ext-test/resources/legacygraphqlapi/queries/*.graphql")
@FilePatternSource(pattern = "src/ext-test/resources/gtfsgraphqlapi/queries/*.graphql")
@ParameterizedTest(name = "Check GraphQL query in {0}")
void graphQL(Path path) throws IOException {
var query = Files.readString(path);
var response = LegacyGraphQLIndex.getGraphQLResponse(
var response = GtfsGraphQLIndex.getGraphQLResponse(
query,
null,
null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.opentripplanner.ext.legacygraphqlapi;
package org.opentripplanner.ext.gtfsgraphqlapi;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand All @@ -11,21 +11,19 @@
import org.locationtech.jts.geom.GeometryFactory;
import org.opentripplanner.framework.json.ObjectMappers;

class LegacyGraphQLScalarsTest {
class GraphQLScalarsTest {

@Test
void duration() {
var string = LegacyGraphQLScalars.durationScalar
.getCoercing()
.serialize(Duration.ofMinutes(30));
var string = GraphQLScalars.durationScalar.getCoercing().serialize(Duration.ofMinutes(30));
assertEquals("PT30M", string);
}

@Test
void nonDuration() {
Assertions.assertThrows(
CoercingSerializeException.class,
() -> LegacyGraphQLScalars.durationScalar.getCoercing().serialize(new Object())
() -> GraphQLScalars.durationScalar.getCoercing().serialize(new Object())
);
}

Expand All @@ -40,7 +38,7 @@ void geoJson() throws JsonProcessingException {
new Coordinate(0, 0),
}
);
var geoJson = LegacyGraphQLScalars.geoJsonScalar.getCoercing().serialize(polygon);
var geoJson = GraphQLScalars.geoJsonScalar.getCoercing().serialize(polygon);

var jsonNode = ObjectMappers
.ignoringExtraFields()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.opentripplanner.ext.legacygraphqlapi;
package org.opentripplanner.ext.gtfsgraphqlapi;

import java.time.Instant;
import java.time.OffsetDateTime;
Expand Down
Loading

0 comments on commit d354f25

Please sign in to comment.