Skip to content

Conversation

testower
Copy link
Contributor

@testower testower commented Oct 10, 2025

Summary

TODO

Issue

Link to or create an issue that
describes the relevant feature or bug. You need not create an issue for small bugfixes and code
cleanups, but in that case do describe the problem clearly and completely in the "summary" section
above. In the linked issue (or summary section for smaller PRs) please describe:

  • Motivation (problem or need encountered)
  • How the code works
  • Technical approach and any design considerations or decisions

Remember that the PR will be reviewed by another developer who may not be familiar with your use
cases or the code you're modifying. It generally takes much less effort for the author of a PR to
explain the background and technical details than for a reviewer to infer or deduce them. PRs may be
closed if they or their linked issues do not contain sufficient information for a reviewer to
proceed.

Add GitHub keywords to this PR's
description, for example:

Closes #6927

Unit tests

Write a few words on how the new code is tested.

  • Were unit tests added/updated?
  • Was any manual verification done?
  • Any observations on changes to performance?
  • Was the code designed so it is unit testable?
  • Were any tests applied to the smallest appropriate unit?
  • Do all tests
    pass the continuous integration service
    ?

Documentation

  • Have you added documentation in code covering design and rationale behind the code?
  • Were all non-trivial public classes and methods documented with Javadoc?
  • Were any new configuration options added? If so were the tables in
    the configuration documentation updated?

Changelog

The changelog file
is generated from the pull-request title, make sure the title describe the feature or issue fixed.
To exclude the PR from the changelog add the label +Skip Changelog to the PR.

Bumping the serialization version id

If you have made changes to the way the routing graph is serialized, for example by renaming a field
in one of the edges, then you must add the label +Bump Serialization Id to the PR. With this label
Github Actions will increase the field otp.serialization.version.id in pom.xml.

Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 58.25243% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.16%. Comparing base (e895874) to head (b04c334).
⚠️ Report is 109 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...le_rental/datasources/gbfs/GbfsFeedLoaderImpl.java 44.11% 11 Missing and 8 partials ⚠️
...rg/opentripplanner/framework/io/OtpHttpClient.java 25.00% 18 Missing ⚠️
...anner/ext/siri/updater/azure/SiriAzureUpdater.java 0.00% 1 Missing ⚠️
...anner/ext/vehicleparking/bikely/BikelyUpdater.java 0.00% 1 Missing ⚠️
.../opentripplanner/framework/io/OtpHttpResponse.java 96.15% 0 Missing and 1 partial ⚠️
.../updater/alert/gtfs/GtfsRealtimeAlertsUpdater.java 0.00% 1 Missing ⚠️
...ipplanner/updater/support/siri/SiriHttpLoader.java 0.00% 1 Missing ⚠️
...r/google/GooglePubsubEstimatedTimetableSource.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6963      +/-   ##
=============================================
+ Coverage      72.13%   72.16%   +0.02%     
- Complexity     19673    19850     +177     
=============================================
  Files           2127     2156      +29     
  Lines          79562    80121     +559     
  Branches        8041     8096      +55     
=============================================
+ Hits           57396    57819     +423     
- Misses         19332    19444     +112     
- Partials        2834     2858      +24     

☔ View full report in Codecov by Sentry.
📢 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.

@testower testower force-pushed the improve/support-caching-mechanisms-in-gbfs-sources branch from 34b5bbe to f0f414b Compare October 10, 2025 11:21
Enable access to HTTP response headers through the ResponseMapper interface
by introducing OtpHttpResponse wrapper class that encapsulates both headers
and body content.

Key Changes:
- Created OtpHttpResponse class with case-insensitive header access
- Updated ResponseMapper interface signature from InputStream to OtpHttpResponse
- Modified all ResponseMapper implementations to use response.body()
- Added comprehensive unit tests for OtpHttpResponse functionality
- Enhanced integration tests to verify header access works correctly

Benefits:
- Enables HTTP caching with ETag and Last-Modified headers
- Supports rate limit monitoring via response headers
- Allows content type inspection and validation
- Facilitates debugging with header access

Implementation Details:
- OtpHttpResponse provides immutable, case-insensitive header access
- Supports multi-value headers (e.g., Set-Cookie)
- InputStream lifecycle remains managed by OtpHttpClient
- Breaking change: All ResponseMapper implementations require update

Files Modified:
- 13 source files updated to use response.body()
- 2 test files updated
- 1 integration test enhanced with header access tests

All existing tests pass. No functional changes to HTTP request behavior.
Only adds capability to access response headers when needed.
@testower testower force-pushed the improve/support-caching-mechanisms-in-gbfs-sources branch 3 times, most recently from 6bea580 to bc8363a Compare October 14, 2025 19:54
@t2gran t2gran changed the title gbfs updater with etag / if-not-modified support Support for etag and if-not-modified in GBFS updater Oct 16, 2025
@t2gran t2gran added this to the 2.9 (next release) milestone Oct 16, 2025
@testower testower force-pushed the improve/support-caching-mechanisms-in-gbfs-sources branch from bc8363a to a8592cf Compare October 16, 2025 17:26
@testower testower force-pushed the improve/support-caching-mechanisms-in-gbfs-sources branch from a8592cf to b04c334 Compare October 16, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ETag and If-None-Match headers in GBFS source for vehicle rental updater

3 participants