How do we minimise the existing tech debt? #6264
Replies: 5 comments 1 reply
-
For a major refactoring backend project like this, it's usually best to create a new branch, especially when mixed with switching to FastAPI and a better database schema. The redesigned database schema is in the tm-admin project, and has an extensive unit level (still needs more work) test suite. I'll be less painful to switch to using tm-admin instead of modifying the existing code around major schema changes. I recently added an API layer designed to support a backend so other developers don't have to look at low-level SQL code. It's based on extensive reading of the TM backend code. If the backend REST API is the same using FastAPI as the current Flask one, the frontend should be able to be refactored in parallel. Refactoring both the backend and frontend at the same time is basically a total rewrite. This would be the time to consider any functionality in the UI or backend that should be incorporated while going through this process. To be able to shift resources to refactoring, the current TM code base would have to be in maintenance mode with only critical bugs fixed so effort could be shifted to the refactoring work. This refactoring work would take many months. As much of the backend functionality as possible should be in modules, which makes writing unit test cases easier. Other existing modules should also be used, like TM-Extractor, osm-rawdata, tm-admin, the UI library, etc... Most of the existing code lacks comments, so all new code should have comment block in mkdocs format for each function and class so we can generate API documentation. Higher level documents that explain data flow, using the API, etc... should also be written. |
Beta Was this translation helpful? Give feedback.
-
I think you covered most of the points @ramyaragupathy !
One last thing that I am not certain about is the release cycle process for TM currently.
|
Beta Was this translation helpful? Give feedback.
-
As a non developer TM user (mapping, validating) i am wondering:
Thanks. |
Beta Was this translation helpful? Give feedback.
-
I'll be honest, but at least for the backend, it's unfixable. This is responsible for the performance issues, as the size of the data in the tables continues to grow. The current implementation just doesn't scale well. Adding async processing and other modern techniques is a bit impossible to graft onto the current code base, so refactoring the backend completely will enable TM to function well for years in the future. Otherwise it's going to just keep getting slower and slower... I've already got a large part of the backend rewritten, but there is still months of work unless we could get more developer resources, which probably isn't going to happen unless we could get some skilled volunteer help. So yes, we need to shift focus to refactoring, or it'll never get done in a reasonable amount of time. Obviously any critical bugs will get fixed as best as possible, but they'll just be band-aids to buy time. |
Beta Was this translation helpful? Give feedback.
-
Please see the approach outlined for the backend code migration here: https://community.openstreetmap.org/t/migrating-tasking-manager-from-flask-to-fastapi-and-psycopg2-to-asyncpg/116543 cc @prabinoid @kaditya97 @manjitapandey @royallsilwallz @spwoodcock |
Beta Was this translation helpful? Give feedback.
-
Technical debt quietly accrues in open-source projects, posing a significant threat as updates are deferred due to time and resource constraints. Tasking Manager, having been in maintenance mode since its Version 4 launch, faces this challenge.
Here's our plan to ensure the Tasking Manager's long term viability, scalability and maintainability:
🛠 Redesign Database Schema: Optimize backend queries for speed and efficiency.
🛠 Migrate to Fast API: Enhance performance by transitioning from Flask framework.
🛠 Upgrade Frontend Dependencies on a regular basis.
🛠 Boost overall test coverage.
🛠 Streamline translation management.
🛠 Create a Common Frontend Component Library for a seamless user experience across tools.
Addressing technical debt in the Tasking Manager codebase requires a holistic approach, and we are committed to regular code reviews, refactoring, documentation improvements, and testing practices to remove these impediments.
Please do share your insights and strategies for tackling the problem!
Beta Was this translation helpful? Give feedback.
All reactions