Skip to content

do not discard turn restrictions where the turn description and angle do not match, just add an issue - #6553

Merged
tkalvas merged 3 commits into
opentripplanner:dev-2.xfrom
HSLdevcom:turn-restriction-unifier-only-warn-dont-discard
Mar 21, 2025
Merged

tkalvas merged 3 commits into
opentripplanner:dev-2.xfrom
HSLdevcom:turn-restriction-unifier-only-warn-dont-discard

Conversation

@tkalvas

@tkalvas tkalvas commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

Summary

Throwing out restrictions based on a heuristic was wrong. We still continue adding issues to the issue store for them.

The code in question is really old, and no one really remembered why it is written this way. Maybe OSM data used to be worse, these days this check seems counterproductive.

Issue

Fixes #6536

Unit tests

None existed in the first place.

Documentation

I left a comment explaining the logic.

Changelog

No.

Bumping the serialization version id

No.

@tkalvas
tkalvas requested a review from a team as a code owner March 19, 2025 08:26
@codecov

codecov Bot commented Mar 19, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.24%. Comparing base (52dc65f) to head (caa8dff).
Report is 93 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6553      +/-   ##
=============================================
- Coverage      70.24%   70.24%   -0.01%     
- Complexity     18369    18382      +13     
=============================================
  Files           2087     2088       +1     
  Lines          77381    77415      +34     
  Branches        7839     7842       +3     
=============================================
+ Hits           54357    54379      +22     
- Misses         20249    20265      +16     
+ Partials        2775     2771       -4     

☔ 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.

@leonardehrenfried leonardehrenfried added the !Improvement A functional improvement or micro feature label Mar 19, 2025
@leonardehrenfried

Copy link
Copy Markdown
Member

You're right in that the testing situation with the OSM code is pretty bad. However, @vesameskanen and I have recently started working a testing framework that allows you to write module tests for exactly these kinds of features that regrettably span several classes.

I've taken the liberty to write a test for the feature you're changing: leonardehrenfried@c59fb79

Could you cherry-pick, adapt it and perhaps flesh it out a little so that a few more cases are tested?

@tkalvas
tkalvas merged commit a0ba98d into opentripplanner:dev-2.x Mar 21, 2025
@tkalvas
tkalvas deleted the turn-restriction-unifier-only-warn-dont-discard branch March 21, 2025 10:34
t2gran pushed a commit that referenced this pull request Mar 21, 2025
@t2gran t2gran added this to the 2.8 (next release) milestone Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Improvement A functional improvement or micro feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OTP rejects valid turn restrictions in OSM data

4 participants