Skip to content

23 refactor optimize ndjson storage#25

Merged
ArtemDychenko merged 5 commits intomainfrom
23-refactor-optimize-ndjson-storage
Mar 31, 2026
Merged

23 refactor optimize ndjson storage#25
ArtemDychenko merged 5 commits intomainfrom
23-refactor-optimize-ndjson-storage

Conversation

@ArtemDychenko
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.py with 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.example text 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.

@ArtemDychenko ArtemDychenko merged commit 1220566 into main Mar 31, 2026
1 check passed
@ArtemDychenko ArtemDychenko deleted the 23-refactor-optimize-ndjson-storage branch March 31, 2026 22:34
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.

Refactor: optimize NDJSON storage and adjust parsing logic

2 participants