-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Remove fare service from Graph #6292
base: dev-2.x
Are you sure you want to change the base?
Remove fare service from Graph #6292
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #6292 +/- ##
=============================================
- Coverage 69.73% 69.72% -0.02%
+ Complexity 18024 18018 -6
=============================================
Files 2057 2057
Lines 76970 76978 +8
Branches 7846 7845 -1
=============================================
- Hits 53678 53674 -4
- Misses 20545 20553 +8
- Partials 2747 2751 +4 ☔ View full report in Codecov by Sentry. |
application/src/main/java/org/opentripplanner/standalone/configure/LoadApplication.java
Show resolved
Hide resolved
@@ -159,7 +159,8 @@ private static void startOTPServer(CommandLineParameters cli) { | |||
DataImportIssueSummary.combine(graphBuilder.issueSummary(), app.dataImportIssueSummary()), | |||
app.emissionsDataModel(), | |||
app.stopConsolidationRepository(), | |||
app.streetLimitationParameters() | |||
app.streetLimitationParameters(), | |||
app.buildConfig().fareServiceFactory.makeFareService() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we create the fareService here instead of in the loadApp.appConstruction() like the other ones?
Doesn't this mean that we will always get a DefaultFareService during graph build? And then overwrite that DefaultFareService with whatever this factory returns?
And if you run with --build --serve
you will always use the DefaultFareService from the loadApp.constructApplication()
. Or is it just me that don't understand how this hangs together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this PR is so old I had to get into it again: the reason why it is so strange is that the fareServiceFactory acts a builder gathering up fares data from all input feeds. It actually lives in the build config and is life-cycle managed and serialized through that.
No doubt this is terrible. It should really be part of the OtpTransitServiceBuilder
which fulfills the same role.
I would like to request to not make this PR any bigger and let me revisit this topic.
Summary
This removes the fare service from the Graph instance and lets Dagger manage it instead.
Unit tests
A few unit tests had to be adjusted.
Bumping the serialization version id
✔️