Skip to content
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

Open
wants to merge 11 commits into
base: dev-2.x
Choose a base branch
from

Conversation

leonardehrenfried
Copy link
Member

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

✔️

@leonardehrenfried leonardehrenfried added Technical Debt bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Skip Changelog labels Nov 29, 2024
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner November 29, 2024 11:00
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.

Project coverage is 69.72%. Comparing base (1030408) to head (2e2b3da).
Report is 41 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...n/java/org/opentripplanner/standalone/OTPMain.java 0.00% 2 Missing ⚠️
...entripplanner/apis/gtfs/GraphQLRequestContext.java 0.00% 1 Missing ⚠️
...ner/standalone/configure/ConstructApplication.java 0.00% 1 Missing ⚠️
...pplanner/standalone/configure/LoadApplication.java 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@habrahamsson-skanetrafiken habrahamsson-skanetrafiken marked this pull request as draft December 10, 2024 10:34
vpaturet
vpaturet previously approved these changes Jan 13, 2025
@@ -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()

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?

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR Skip Changelog Technical Debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants