Skip to content

Conversation

@t2gran
Copy link
Member

@t2gran t2gran commented Oct 15, 2024

Summary

The list of ids inside passThroughPoints is allowed to be empty or null. We cannot change this - that would be a breaking change. So, when the via search enforced this, the API was not backward compatible anymore. This commit reverts the behavior and just ignores the passThroughPoints if the list of ids is null or empty. This bug was
introduced in PR #6084.

This PR also changes the graphql schema for via search - the assumtion is that no one has put it in production jet. The list of stop ids are med required. This was initially optional, because we want to add coordinates. But, it should be relaxed when the coordinates are added, not now. At least one id or coordinate must be set anyway!

Issue

🟥 There is not OTP issue for this.

Unit tests

✅ Regression unit tests are added to via and passthrough in the TransmodelAPI for this.

Documentation

🟥 This does not change any doc.

Changelog

🟥 This is a regression fix to the via PR #6084 merged last week.

Bumping the serialization version id

🟥 Should not be requiered.

@t2gran t2gran added !Bug Apply to issues describing a bug and PRs witch fixes it. Regression Entur Test This is currently being tested at Entur +Skip Changelog This is not a relevant change for a product owner since last release. labels Oct 15, 2024
@t2gran t2gran requested a review from a team as a code owner October 15, 2024 18:31
@codecov
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.90%. Comparing base (ead941e) to head (1b8da58).
Report is 51 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...outing/api/request/via/PassThroughViaLocation.java 0.00% 0 Missing and 1 partial ⚠️
...nner/routing/api/request/via/VisitViaLocation.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6162      +/-   ##
=============================================
- Coverage      69.93%   69.90%   -0.03%     
+ Complexity     17715    17710       -5     
=============================================
  Files           1996     1996              
  Lines          75365    75337      -28     
  Branches        7705     7717      +12     
=============================================
- Hits           52705    52663      -42     
- Misses         19989    19996       +7     
- Partials        2671     2678       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vpaturet vpaturet self-requested a review October 16, 2024 07:03
Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but I noticed a small typo.

The list of ids inside passThroughPoints is allowed to be empty or null. We cannot
change this - that would be a breaking change. So, when the via search enforced this,
the API was not backward compatible anymore. This commit reverts the behavior and
just ignores the passThroughPoints if the list of ids is null or empty. This bug was
 introduced in PR opentripplanner#6084.
@t2gran t2gran force-pushed the otp2_fix_npe_passthrough branch from d761531 to 1b8da58 Compare October 16, 2024 11:08
@t2gran t2gran added this to the 2.7 (next release) milestone Oct 16, 2024
@t2gran t2gran merged commit 440498f into opentripplanner:dev-2.x Oct 17, 2024
5 checks passed
@t2gran t2gran deleted the otp2_fix_npe_passthrough branch October 17, 2024 09:43
@t2gran t2gran removed the Regression label Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it. Entur Test This is currently being tested at Entur +Skip Changelog This is not a relevant change for a product owner since last release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants