Skip to content

Validate the number of service links mapped to a JourneyPattern - #4963

Merged
vpaturet merged 1 commit into
opentripplanner:dev-2.xfrom
entur:otp2_validate_wrong_number_service_link
Mar 24, 2023
Merged

vpaturet merged 1 commit into
opentripplanner:dev-2.xfrom
entur:otp2_validate_wrong_number_service_link

Conversation

@vpaturet

@vpaturet vpaturet commented Mar 10, 2023

Copy link
Copy Markdown
Contributor

Summary

Fixes #4962
This PR adds validation logic to check that the number of ServiceLinks mapped to a JourneyPattern is consistent with the number of intervals between stops in the JourneyPattern.
If the mapping is inconsistent, an issue is logged in the issue store and the graph builder falls back to generating straight-line ServiceLinks between the stops.

Note: the current mapping logic is fragile. It assumes that the position of the ServiceLink in the shape is the same as the position of the ServiceLinkInJourneyPattern element in the XML file. Instead the "order" field in the ServiceLinkInJourneyPattern should be used. This improvement is out-of-scope for this PR.

Issue

#4962

Unit tests

Added unit test.

Documentation

No

@vpaturet vpaturet self-assigned this Mar 10, 2023
@vpaturet vpaturet added the !Improvement A functional improvement or micro feature label Mar 10, 2023
@codecov

codecov Bot commented Mar 10, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 82.60% and project coverage change: -0.02 ⚠️

Comparison is base (f53c9f0) 63.88% compared to head (28c7f11) 63.87%.

❗ Current head 28c7f11 differs from pull request most recent head 043ec5d. Consider uploading reports for the commit 043ec5d to get more accurate results

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #4963      +/-   ##
=============================================
- Coverage      63.88%   63.87%   -0.02%     
+ Complexity     13482    13474       -8     
=============================================
  Files           1674     1674              
  Lines          66111    66107       -4     
  Branches        7145     7151       +6     
=============================================
- Hits           42235    42224      -11     
- Misses         21493    21499       +6     
- Partials        2383     2384       +1     
Impacted Files Coverage Δ
...entripplanner/netex/mapping/ServiceLinkMapper.java 54.68% <82.60%> (+3.02%) ⬆️

... and 10 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@t2gran t2gran added this to the 2.3 milestone Mar 14, 2023
@vpaturet
vpaturet force-pushed the otp2_validate_wrong_number_service_link branch from 28c7f11 to 043ec5d Compare March 15, 2023 13:43
@vpaturet
vpaturet marked this pull request as ready for review March 15, 2023 14:27
@vpaturet
vpaturet requested a review from a team as a code owner March 15, 2023 14:27
@jtorin
jtorin self-requested a review March 23, 2023 16:20
@vpaturet
vpaturet merged commit 599f6ec into opentripplanner:dev-2.x Mar 24, 2023
t2gran pushed a commit that referenced this pull request Mar 24, 2023
@t2gran
t2gran deleted the otp2_validate_wrong_number_service_link branch November 21, 2023 16:06
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.

Validate ServiceLink mapping consistency during NeTEx import

3 participants