-
Notifications
You must be signed in to change notification settings - Fork 44
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
Overhaul core::Tracker
#1181
Labels
- Developer -
Torrust Improvement Experience
Code Cleanup / Refactoring
Tidying and Making Neat
EPIC
Contains several subissues
Comments
This was referenced Jan 15, 2025
This was referenced Jan 20, 2025
This was referenced Jan 27, 2025
This was referenced Jan 28, 2025
Hi @da2ce7, I've removed these two sub-tasks from this epic:
Because I think it's better to wait until we finish the "Refactor packages" issue. The public API will be more stable. In the mean time I can move things from one workspace package to another if needed and we are not in a hurry to publish those crates. |
This was referenced Feb 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
- Developer -
Torrust Improvement Experience
Code Cleanup / Refactoring
Tidying and Making Neat
EPIC
Contains several subissues
I think the
core::Tracker
is the most "important type" in the whole repo.In my opinion it's too big. It has too many responsibilities. It's coupled with everything and it makes hard to write unit tests. In many places the
Tracker
is injected as a dependency and it makes impossible to unit test anything that depends on theTracker
.The tracker has at least these responsibilities:
I called them
contexts
and I organized methods in contexts long time ago.I think we should consider refactor to improve further the sustainability and testability of the code.
I think we can start by extracting new services inside the tracker:
Moving their data structures and methods. And after that, we can move the new services out of the tracker. That will require to inject them directly where they are currently used via the tracker. for example Axum handlers.
We could start with the most obvious ones
Whitelist
andStatistics
.Extracting the services will be beneficial for the core module even if we keep those services behind the tracker facade. In fact we could also extract a core tracker (context tracker) and rename the current one to
TrackerFacade
or something like that.What do you think @da2ce7?
Sub-issues
core::Tracker
#1209tracker-core
package #1226tracker-core
package #1258 *(2)tracker-core
package documentation #1261[ ]Overhaul core Tracker: publish the new crate[ ] Overhaul core Tracker: write a blog post about the new crate*1 = Database migration are only used inside the core tracker module. If we extract the core lib package we need to move the DB migrations together with the new crate.
*2 = We only need to publicly expose types and functions in the tracker lib crate that are used in the main repo. At the beginning we can start with a restrictive approach for the new package, exposing only what we are using.
The text was updated successfully, but these errors were encountered: