-
Notifications
You must be signed in to change notification settings - Fork 3
Data Changed > compat with service IDs regex #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @mmathieum, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the robustness and consistency of how service and trip identifiers are processed and exported within the system. By centralizing ID cleaning through Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors service ID handling to make it compatible with regex-based cleaning, which is a good improvement for consistency and maintainability. The changes involve passing agencyTools to necessary methods and introducing new helper functions like convertServiceId. I've identified a couple of places where the old, incorrect service ID comparison logic remains, which could lead to bugs. I've also pointed out a minor inconsistency in how string fields are being processed. Overall, the direction is good, but a few spots need attention to ensure correctness.
I am having trouble creating individual review comments. Click here to see my feedback.
src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt (199)
While removing this suppression comment is good, the line that was below it (now line 198) appears to have a bug. It uses it.serviceId.escapeId() for comparison against removedServiceDate.serviceId. However, it.serviceId is a raw service ID from the GTFS file, and escapeId() does not perform the necessary cleaning based on the agency's regex. This will likely cause lookups to fail for service IDs that need cleaning. The comparison should use the cleaned service ID, like agencyTools.cleanServiceId(it.serviceId).
src/main/java/org/mtransit/parser/mt/MDataChangedManager.kt (224)
Similar to a previous comment, while removing this suppression is fine, the line below it (now line 222) seems to have the same bug. It uses it.serviceId.escapeId() for comparison, which doesn't clean the raw service ID. This can lead to mismatches when comparing with removedServiceDate.serviceId. You should use agencyTools.cleanServiceId(it.serviceId) to ensure a correct comparison.
src/main/java/org/mtransit/parser/mt/data/MStop.kt (47)
You've changed this line to use quotes() instead of quotesEscape(), which means underscores will no longer be removed from the stop name. However, the line for code just above still uses quotesEscape(). This seems inconsistent. Was it intentional to keep removing underscores from code but not from name? For consistency, you might consider applying the same change to code.quotesEscape() unless there's a specific reason for this difference.
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the handling of service and trip IDs to make them compatible with agency-specific cleaning regex. The changes introduce new convertServiceId and convertTripId extension functions and update their call sites across the codebase. This is a good improvement for consistency and correctness.
I've added a couple of high-severity comments pointing out two places in MDataChangedManager.kt where the old escapeId() method is still used for comparison, which seems to be an oversight from the refactoring and could lead to incorrect behavior. Please take a look at those.
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the handling of service and trip IDs to make them compatible with service ID regex cleaning. The changes are mostly centered around centralizing the ID cleaning and conversion logic, which is a good improvement for code clarity and maintainability. However, I've found a couple of logical errors in the new date handling logic within MDataChangedManager.kt and one place where the refactoring seems to have been missed. Please see my detailed comments.
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces compatibility for service ID regex by refactoring how service IDs are cleaned and converted. The changes centralize the cleaning logic by passing agencyTools and using new extension functions like convertServiceId, which improves code consistency and readability. A critical bug that could cause an infinite loop when processing added calendar dates has also been fixed. While the changes are generally good, there's an opportunity to reduce code duplication in MDataChangedManager.kt by refactoring similar logic blocks into a helper function.
- parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: mt-sync-code-data.yml > fix skip on main repo - commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
No description provided.