Mass refactor the crates structure [6 / seq 1]#200
Conversation
Coverage Report
Compared to |
|
The difference in the coverage is likely because I've moved the fault-injecting backend into a separate crate (it seems to be a reasonable thing to build up and integrate) - but now it adds to the code that needs test coverage. |
| @@ -0,0 +1,150 @@ | |||
| // The models that we use for our backends are similar to the ones that we | |||
There was a problem hiding this comment.
I'm a bit conflicted about the naming convention with these crates. But I think almost certainly core-backend and backends-core are too similar in naming convention that it will result in confusion to new contributors joining the project...
Perhaps we switch the convention for core-backend webapp-backend and scheduler-backend to instead be:
backend-interface-core
backend-interface-webapp
backend-interface-scheduler
I mentally associate these interfaces closer to the backend-* crates than to the webapp/scheduler folders which is how they group right now in IDEs.
Then grouping the core types could then become core-webapp, core-scheduler, and core-backend to prioritize a statement of who consumes them instead of what they're about (which is already readily grokable in the name itself).
Open to hearing alternatives.
There was a problem hiding this comment.
This is also what I had in mind - I just wanted to address this a bit later in the pipeline, together with other changes to the structure. But since this PR is the one that is introducing the crates I see how it makes sense to right away correct it here.
That said, the pattern that we are moving towards here will also eventually be well-structured; currently it seems like they are just scattered, but that's only becase we have to unwrap the logic in layers - starting from the backends.
What I'm saying is, my plan is to have a structure like this in the end: webapp-backend, webapp-core, webapp-server, webapp-config and webapp-bringup, and similarly for other subsystems (i.e. garbage-collection-task and garbage-collection-backend). The key idea here is what we definitely have certain subsystems, but not all subsystem are structured in the same way - meaning it is possible that we'd have, like, one or two -servers, couple or more -controls and etc. Maybe some unique suffixes even. Grouping things by subsystem allows us to have semantic groups even for things that would otherwise be singular.
So, to sum it up - what you are proposing makes sense now, but if we take the process further I feel like this layout will be less optimal.
| @@ -11,4 +11,4 @@ uuid = { workspace = true, features = ["serde", "v4"] } | |||
| waymark-proto = { workspace = true, features = ["serde"] } | |||
There was a problem hiding this comment.
This DAG create feels a bit too light in substance, would it make sense to combine with another one or is there a dependency/feature reason why it's split independently?
| @@ -0,0 +1,8 @@ | |||
| [package] | |||
| name = "waymark-test-support" | |||
There was a problem hiding this comment.
Similar to the proposal above, consider switching these to semantically group support-test and support-integration
This is a huge PR that I've built as a PoC for the more atomic crates; we can merge it as-is, or I can subdivide it into smaller parts so we can review individual changes.
The totality of the changes in this PR are:
usestatementsThere are no semantic changes to the code, or tests; in fact, most of the files remain as-is, and don't really have any associated changes at all but the
usesection update and new placement.This is the majority of the work required to split out the monolithic crate structure into small and atomic crates; we have resolved all of the dependency cycle issues and establish necessary patterns to move forward.
waymark-<subsystem>-backendcrates andwaymark-<subsystem>-corecrates.waymark-runnerandwaymark-runner-state; that last one could've been calledwaymark-runner-core, and that it because it holds the core types used bywaymark-core-backendAgain, this refactor only moves code around. It does apply no changes to the type names, or fn implementations (except correcting the item paths when they're affected by code movements).