23 refactor optimize ndjson storage#25
Merged
ArtemDychenko merged 5 commits intomainfrom Mar 31, 2026
Merged
Conversation
… remove txt logic for routes, rewrite checker for routes.
…uploading files structure
There was a problem hiding this comment.
Pull request overview
This PR migrates configuration and routes data from legacy .txt formats to structured /config/config.json and /config/routes.ndjson, centralizes file validation, and removes the intermediate routes DB layer to simplify storage and loading.
Changes:
- Added
utils/file_checker.pywith JSON/NDJSON validators and wired it into config/routes loading and the web update upload flow. - Switched runtime file paths to
config.json/routes.ndjson, updated UI selection display logic, and adjusted request size limits for web uploads. - Removed legacy
config.exampletext template and deprecated routes “DB refresh” flow in favor of directly reading NDJSON.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/file_checker.py | New centralized validators for config JSON and routes NDJSON. |
| app/config_management/config_manager.py | Loads config from /config/config.json using the new checker. |
| app/routes_management/routes_manager.py | Reads routes directly from /config/routes.ndjson and exposes labels for UI. |
| app/web_update/web_server.py | Upload UI/logic updated to accept .json/.ndjson and validate via checker. |
| main.py | Updates config/routes paths and config loading call signature. |
| app/error_codes.py | Refactors error code constants/messages to align with new validation flow. |
| app/gui_management/gui_manager.py | Uses RoutesManager.get_routes_labels() and updates trip list display formatting. |
| app/gui_management/states/route_menu_state.py | Calls updated get_route_list_to_display() signature. |
| app/gui_management/states/status_state.py | Passes point_id without int() coercion. |
| app/selection_management/selection_manager.py | Refactors TripInfo to use integer point_id and removes unused group_id. |
| app/ibis_management/ibis_manager.py | Formats DS003 using already-integer point_id. |
| lib/microdot.py | Increases max_content_length to 24KB and applies formatting changes. |
| config/sample-config.json | Adds a sample JSON config. |
| config/config.example | Removes old text-based config template. |
| .gitignore | Ignores JSON/NDJSON broadly while attempting to unignore the sample config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.