Skip to content

Introduce API package for street module - #8281

Open
leonardehrenfried wants to merge 7 commits into
opentripplanner:dev-2.xfrom
leonardehrenfried:street-api
Open

leonardehrenfried wants to merge 7 commits into
opentripplanner:dev-2.xfrom
leonardehrenfried:street-api

Conversation

@leonardehrenfried

@leonardehrenfried leonardehrenfried commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

This PR looks big, but it is 99% import statements.

It introduces an API package for the street module:

  • street.api.request: sending a routing request
  • street.api.path: return types for the routing request

All of these still leak the edges and vertices but they make the direction of travel visible.

I originally had the linking in this PR, too, but that barely added any value so I chose to defer it.

Ref #8081

@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.16%. Comparing base (2ee5850) to head (64d0d2e).

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #8281      +/-   ##
=============================================
- Coverage      76.17%   76.16%   -0.01%     
+ Complexity     24900    24895       -5     
=============================================
  Files           2671     2671              
  Lines          93270    93270              
  Branches        9293     9293              
=============================================
- Hits           71049    71042       -7     
- Misses         19082    19086       +4     
- Partials        3139     3142       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leonardehrenfried
leonardehrenfried marked this pull request as ready for review November 27, 2026 14:02
@leonardehrenfried
leonardehrenfried requested a review from a team as a code owner November 27, 2026 14:02
@leonardehrenfried leonardehrenfried added !Technical Debt Improve code quality, no functional changes. +Skip Changelog This is not a relevant change for a product owner since last release. labels Nov 27, 2026
optionsome
optionsome previously approved these changes Nov 27, 2026
@optionsome

Copy link
Copy Markdown
Member

Are any of the requests serialized? Do we need to bump the serialization id?

@leonardehrenfried

Copy link
Copy Markdown
Member Author

Only ElevatorRequest implements Serializable, but I don't know why. I think it's mistake.

So therefore I don't think we need to bump.

* elevators and stairs, is only referenced by the produced steps and must be resolved by the
* caller.
*/
public class StatesToStreetStepsMapper {

@t2gran t2gran Dec 1, 2026 •

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.

Consider: Mappers are not API classes, only classes that is passed between modules should be in the package. I know this is just a step towards cleaning up, but this needs to be moved again - later. If you want, we can discuss the migration strategy.

@leonardehrenfried leonardehrenfried Dec 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree with this sentiment.

My plan is the following: The next PR introduces the split between api (containing mostly interfaces) and implementation. I would move this class into the implementation package so that it eventually becomes inaccessible outside of the module.

I am very happy to discuss the strategy. Let me know when is a good time for you.

@t2gran t2gran added this to the 2.11 (next release) milestone Dec 2, 2026
vpaturet
vpaturet previously approved these changes Dec 4, 2026
# Conflicts:
#	application/src/main/java/org/opentripplanner/graph_builder/module/osm/internal/walkablearea/WalkableAreaBuilder.java
#	application/src/test/java/org/opentripplanner/graph_builder/module/TurnRestrictionModuleTest.java
#	application/src/test/java/org/opentripplanner/street/integration/TurnCostTest.java
#	application/src/test/java/org/opentripplanner/street/integration/TurnRestrictionTest.java
@leonardehrenfried

Copy link
Copy Markdown
Member Author

Conflicts are, once more, resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

+Skip Changelog This is not a relevant change for a product owner since last release. !Technical Debt Improve code quality, no functional changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants