-
Notifications
You must be signed in to change notification settings - Fork 1.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 70.31% 70.30% -0.01%
+ Complexity 18158 18151 -7
=============================================
Files 2058 2058
Lines 76939 76939
Branches 7771 7771
=============================================
- Hits 54097 54091 -6
- Misses 20088 20092 +4
- Partials 2754 2756 +2 ☔ 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.
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.
But i think the second issue will still be a problem. If you run otp with both --build --serve
then dagger won't know about the real fare service but will only have a reference to the dummy fare service from LoadApplication.java:85. Right?
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.
I tested this yesterday and it still works in this case. That is because the fareServiceFactory is stored inside and lifecycle-managed by buildConfig (!!!).
This PR appears to break the fare zone display on HSL's frontends. I'll give some more details in a bit. |
If I build a HSL graph and then use the following GraphiQL URL I can see some fares: https://tinyurl.com/26c2dcvg |
For some reason clicking on that image gives me a blank page, and it is really hard to read it as it is. |
The image URLs have a limited validity. You need to refresh the page to get a new one. |
Anyway, that's not the query function our frontend uses. My test:
|
I don't get any fare products with your query either. I can send you a new HSL-gtfs.zip if you want, I guess something has changed. |
I get them: I use the very latest feed from https://dev.hsl.fi/gtfs/hsl.zip Is that the correct URL? |
It's definitely not the same data we use in production, but I'll have to ask Joel about the data pipeline now. |
I still don't know what that zip is, but the trips2.txt in it is our trips.txt, and the trips.txt in it is something we don't have. Also the feed_info.txt are slightly different, we have a feed_id added:
|
Our build-config.json:
I can't actually even get your version of the gtfs dump to load, because the feed id needs to be set in the config when it's not in the gtfs... that might be a relevant difference. |
Just for fun I printed to a debug log the type of fareService in DecorateWithFare and got
The three first ones seem to come from startup, afterwards when I do a new query, I get just one DefaultFareService. That is surely not right. |
Okay, thanks for investigating. I might have made a mistake here. I will make this a draft. |
Pull request was converted to draft
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
✔️