Skip to content

Fix quay duplicates overwriting stop index - #4964

Merged
leonardehrenfried merged 10 commits into
opentripplanner:dev-2.xfrom
HBTGmbH:fix-quay-duplicates-overwriting-stop-index
Mar 27, 2023
Merged

Fix quay duplicates overwriting stop index#4964
leonardehrenfried merged 10 commits into
opentripplanner:dev-2.xfrom
HBTGmbH:fix-quay-duplicates-overwriting-stop-index

Conversation

@bas-hbt

@bas-hbt bas-hbt commented Mar 13, 2023

Copy link
Copy Markdown
Contributor

Issue

closes #4949

@codecov

codecov Bot commented Mar 13, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 96.42% and no project coverage change.

Comparison is base (279b058) 64.06% compared to head (284c5f5) 64.07%.

❗ Current head 284c5f5 differs from pull request most recent head 4130fde. Consider uploading reports for the commit 4130fde to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             dev-2.x    #4964   +/-   ##
==========================================
  Coverage      64.06%   64.07%           
- Complexity     13579    13589   +10     
==========================================
  Files           1675     1675           
  Lines          66229    66243   +14     
  Branches        7147     7147           
==========================================
+ Hits           42429    42443   +14     
- Misses         21428    21429    +1     
+ Partials        2372     2371    -1     
Impacted Files Coverage Δ
.../org/opentripplanner/netex/mapping/QuayMapper.java 89.28% <95.00%> (+3.57%) ⬆️
...org/opentripplanner/netex/mapping/NetexMapper.java 82.30% <100.00%> (+0.07%) ⬆️
...g/opentripplanner/netex/mapping/StationMapper.java 64.40% <100.00%> (+2.58%) ⬆️
...ripplanner/netex/mapping/StopAndStationMapper.java 85.36% <100.00%> (+0.18%) ⬆️
...ripplanner/transit/model/framework/EntityById.java 92.59% <100.00%> (+0.28%) ⬆️

... and 3 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
@bas-hbt
bas-hbt marked this pull request as ready for review March 15, 2023 10:39
@bas-hbt
bas-hbt requested a review from a team as a code owner March 15, 2023 10:39
@leonardehrenfried

Copy link
Copy Markdown
Member

The commit list contains some which are not part of the PR. Can you please rebase to clean this up?

Comment thread src/test/resources/netex/epip/netex_epip_minimal.zip Outdated
@bas-hbt
bas-hbt changed the base branch from dev-2.x to 0.10.x March 15, 2023 12:44
@bas-hbt
bas-hbt changed the base branch from 0.10.x to dev-2.x March 15, 2023 12:44
@leonardehrenfried

Copy link
Copy Markdown
Member

I think you made it worse. Can you please use git rebase?

Alternatively, we can also squash everything into a single commit when we merge this.

@bas-hbt
bas-hbt force-pushed the fix-quay-duplicates-overwriting-stop-index branch from 7e8c6e2 to dd01e51 Compare March 16, 2023 11:33
Comment thread src/test/java/org/opentripplanner/ConstantsForTests.java Outdated
@vpaturet

Copy link
Copy Markdown
Contributor

I miss the big picture, could you add a few words in the PR description to explain what was wrong and how you solved it?

transitMode,
wheelchair
);
return quay == null

@vpaturet vpaturet Mar 23, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I cannot see any code path that leads to a null quay. You could remove the null check and annotate the method parameter with a Nonnull annotation

@loj-hbt

loj-hbt commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

I miss the big picture, could you add a few words in the PR description to explain what was wrong and how you solved it?

The problem was that our data contains no shared data for stations and stops so that all of these are declared in multiple files. This lead to a situation where boarding and alighting was only possible for the last line referencing this quay that was read.
Whenever a quay was declared another time, a new RegularStop with a new index got added to the map in the StopModelBuilder. The old index was no longer valid but was still referenced from trips. We fixed this by checking if the Quay already existed and returning the corresponding reference if present.
We did the same for the Station although that did not cause the initial problem. This makes sure that all child stops get referenced correctly.

@@ -1,5 +1,6 @@
package org.opentripplanner.netex.mapping;

import jakarta.validation.constraints.NotNull;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The rest of the codebase uses @javax.annotation.Nonnull rather than @jakarta.validation.constraints.NotNull

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh good point, I will change that

vpaturet
vpaturet previously approved these changes Mar 23, 2023
@leonardehrenfried

Copy link
Copy Markdown
Member

Can you resolve the conflicts?

@loj-hbt

loj-hbt commented Mar 24, 2023

Copy link
Copy Markdown
Contributor

Well it looks like I broke it again

@leonardehrenfried

Copy link
Copy Markdown
Member

In this case you could have just merged dev-2.x. We don't require a linear history.

@2martens
2martens force-pushed the fix-quay-duplicates-overwriting-stop-index branch from 284c5f5 to 4130fde Compare March 24, 2023 15:02
@2martens

Copy link
Copy Markdown
Contributor

The hickup was caused by the following:

  • local branch was rebased successfully onto dev-2.x
  • remote branch on GitHub still contained the previous version
  • local changes (history changes) were attempted to push (not force-push), Git rejects
  • subsequently a merge occurred with the remote branch and the result pushed
  • consequence: branch-off point remained the same as the remote branch had before and all commits added to dev-2.x. in the meantime were now part of the branch history

Solution: merge was reverted locally and then correctly force-pushed. History should now be clean.

@leonardehrenfried

leonardehrenfried commented Mar 24, 2023

Copy link
Copy Markdown
Member

Thanks for solving this.

Something to remember for the future: it's preferable to not rebase/force-push after the review has started because this means the "review state" (which files have been changed since you last viewed) is wiped out.

@leonardehrenfried
leonardehrenfried merged commit 1b1f3c0 into opentripplanner:dev-2.x Mar 27, 2023
t2gran pushed a commit that referenced this pull request Mar 27, 2023
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.

Conflict between two lines when importing Hamburg NeTEx EPIP feed

6 participants