Skip to content

Rename bikeRental options to vehicleRental - #5089

Merged
leonardehrenfried merged 13 commits into
opentripplanner:dev-2.xfrom
HBTGmbH:improve-rental-config-options
May 22, 2023
Merged

leonardehrenfried merged 13 commits into
opentripplanner:dev-2.xfrom
HBTGmbH:improve-rental-config-options

Conversation

@2martens

@2martens 2martens commented May 3, 2023

Copy link
Copy Markdown
Contributor

Summary

Renamed bikeRental options to vehicleRental

Issue

closes #5088

@2martens
2martens requested a review from a team as a code owner May 3, 2023 09:20
Comment thread src/ext/graphql/transmodelapi/schema.graphql
Comment thread src/ext/resources/legacygraphqlapi/schema.graphqls
Comment thread src/main/java/org/opentripplanner/api/common/RoutingResource.java
@leonardehrenfried

Copy link
Copy Markdown
Member

You need to run mvn test to re-generate the docs. Then commit the changes and rerun mvn test.

@leonardehrenfried leonardehrenfried added the +Config Change This PR might require the configuration to be updated. label May 4, 2023
@leonardehrenfried leonardehrenfried changed the title Renamed bikeRental options to vehicleRental Rename bikeRental options to vehicleRental May 4, 2023
@t2gran t2gran added this to the 2.4 milestone May 4, 2023
@2martens

2martens commented May 5, 2023

Copy link
Copy Markdown
Contributor Author

Have updated the documentation and removed the remaining API-breaking change.

@leonardehrenfried

Copy link
Copy Markdown
Member

The tests are failing because you have not comitted the updated docs.

@leonardehrenfried

Copy link
Copy Markdown
Member

I also think that we should be moving these "vehicleRentalFoo" and "vehicleRentalBar" properties into their own JSON object.

@2martens

2martens commented May 5, 2023

Copy link
Copy Markdown
Contributor Author

The tests are failing because you have not comitted the updated docs.

I did update them but the changes within router-config.json were missing in the committed documentation changes. Will fix that.

Do you have an example of such a JSON object I could use as template?

@leonardehrenfried

leonardehrenfried commented May 5, 2023 •

Copy link
Copy Markdown
Member

The tests are failing because you have not comitted the updated docs.

I did update them but the changes within router-config.json were missing in the committed documentation changes. Will fix that.

Do you have an example of such a JSON object I could use as template?

I hope that there isn't someone on the core team who is super against doing that. If you'd be disappointed if you have to undo that work, you can wait until Tuesday to establish a consensus.

@codecov

codecov Bot commented May 5, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 89.55% and project coverage change: -0.01 ⚠️

Comparison is base (acd912d) 64.79% compared to head (8fb64dd) 64.78%.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5089      +/-   ##
=============================================
- Coverage      64.79%   64.78%   -0.01%     
- Complexity     14160    14162       +2     
=============================================
  Files           1733     1734       +1     
  Lines          67487    67504      +17     
  Branches        7221     7223       +2     
=============================================
+ Hits           43729    43734       +5     
- Misses         21330    21344      +14     
+ Partials        2428     2426       -2     
Impacted Files Coverage Δ
...pplanner/graph_builder/module/osm/OsmDatabase.java 78.57% <0.00%> (-0.77%) ⬇️
...i/request/preference/VehicleRentalPreferences.java 96.00% <ø> (ø)
...alone/config/routerequest/VehicleRentalConfig.java 98.27% <98.27%> (ø)
...g/updaters/sources/VehicleRentalSourceFactory.java 86.66% <100.00%> (ø)
...dalone/config/routerequest/RouteRequestConfig.java 97.77% <100.00%> (-0.27%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@2martens

2martens commented May 5, 2023

Copy link
Copy Markdown
Contributor Author

I looked at the mentioned class but don't yet understand how a VehicleRentalConfig would have to be wired in order for the config to have an effect. After all, it would still have to be within the route request, correct?

@leonardehrenfried

Copy link
Copy Markdown
Member

You'd have to add it to RouterConfig which is then combined with the API parameters and together they make the RouteRequest which is passed to the routing engine.

@leonardehrenfried

leonardehrenfried commented May 5, 2023 •

Copy link
Copy Markdown
Member

This is a very simple schematic how it works.

Untitled-2023-05-05-1243

The implementation is surprisingly complex because there are a few layers of preferences that all need to be combined into a single RouteRequest.

@2martens

2martens commented May 5, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for the info. Will take a look at it but likely not before Tuesday next week.

@2martens

Copy link
Copy Markdown
Contributor Author

I tried to extract the options into a separate object. Hope it works like that.

@leonardehrenfried leonardehrenfried left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good but I have 2 smaller requests.

2martens and others added 2 commits May 17, 2023 00:20
…st/VehicleRentalConfig.java


Fixed typo

Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
@2martens

Copy link
Copy Markdown
Contributor Author

Have implemented the requested changes

@leonardehrenfried
leonardehrenfried merged commit 7689846 into opentripplanner:dev-2.x May 22, 2023
t2gran pushed a commit that referenced this pull request May 22, 2023
@2martens
2martens deleted the improve-rental-config-options branch May 22, 2023 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+Config Change This PR might require the configuration to be updated.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bikeRental options apply to all vehicle rentals

4 participants