Skip to content

JSON > + direction_id_use_other_trips_with_same_headsign #sncf#80

Open
mmathieum wants to merge 6 commits into
masterfrom
mm/json_direction_id_use_other_trips_with_same_headsign
Open

JSON > + direction_id_use_other_trips_with_same_headsign #sncf#80
mmathieum wants to merge 6 commits into
masterfrom
mm/json_direction_id_use_other_trips_with_same_headsign

Conversation

@mmathieum

@mmathieum mmathieum commented Jul 22, 2026

Copy link
Copy Markdown
Member

Try to fix missing trips.direction_id when other route trips with same head-sign have a direction_id...

Copilot AI left a comment

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.

Pull request overview

Adds an opt-in GTFS parsing step to infer and fill missing trips.direction_id values by looking at other trips on the same route with the same trip_headsign, aligning with the PR goal of reducing missing direction IDs (e.g., SNCF feeds).

Changes:

  • Introduces GSpec.fixMissingTripDirectionIds() (guarded by direction_id_use_other_trips_with_same_headsign) and wires it into the parser startup flow.
  • Extends route JSON config (RouteConfig) with a new opt-in flag to enable this behavior.
  • Minor logging/formatting adjustments and a small iteration refactor.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt Tweaks debug log message formatting for headsign/merge diagnostics.
src/main/java/org/mtransit/parser/gtfs/data/GTrip.kt Refactors list-update iteration style for trip updates.
src/main/java/org/mtransit/parser/gtfs/data/GSpecExt.kt Adds opt-in direction-id auto-fix logic based on same-route same-headsign trips.
src/main/java/org/mtransit/parser/gtfs/data/GSpec.java Exposes route-id enumeration for trips and includes minor formatting updates.
src/main/java/org/mtransit/parser/DefaultAgencyTools.java Calls the new direction-id auto-fix step during parsing startup.
src/main/java/org/mtransit/parser/config/gtfs/data/RouteConfig.kt Adds new JSON config flag direction_id_use_other_trips_with_same_headsign.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/org/mtransit/parser/gtfs/data/GSpec.java
Comment thread src/main/java/org/mtransit/parser/gtfs/data/GSpec.java Outdated
Comment thread src/main/java/org/mtransit/parser/gtfs/data/GSpecExt.kt
Comment thread src/main/java/org/mtransit/parser/gtfs/data/GTrip.kt Outdated
Comment thread src/main/java/org/mtransit/parser/gtfs/data/GSpecExt.kt
@mmathieum
mmathieum marked this pull request as ready for review July 23, 2026 19:44
@mmathieum
mmathieum requested a review from Copilot July 23, 2026 19:44

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/main/java/org/mtransit/parser/gtfs/data/GSpecExt.kt
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mmathieum, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 850fedb3-376f-4229-bf59-d15a14359b7d

📥 Commits

Reviewing files that changed from the base of the PR and between b875c18 and db7c507.

📒 Files selected for processing (7)
  • src/main/java/org/mtransit/parser/DefaultAgencyTools.java
  • src/main/java/org/mtransit/parser/config/gtfs/data/RouteConfig.kt
  • src/main/java/org/mtransit/parser/gtfs/data/GSpec.java
  • src/main/java/org/mtransit/parser/gtfs/data/GSpecExt.kt
  • src/main/java/org/mtransit/parser/gtfs/data/GTrip.kt
  • src/main/java/org/mtransit/parser/mt/MDirectionHeadSignFinder.kt
  • src/main/java/org/mtransit/parser/mt/MDirectionSplitter.kt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mm/json_direction_id_use_other_trips_with_same_headsign

Comment @coderabbitai help to get the list of available commands.

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.

2 participants