Refactor disk persistence #20

Merged
antman merged 27 commits from refactor-disk-persistence into main 2026-08-24 07:18:50 +00:00
Owner

Motivation

A lot of the application logic was scattered across the translation layer, lifecycle services, and resource implementations. Now that the first use case has mostly been implemented, we need to consolidate the software architecture

Solution

We want to distinguish between primary types and input types. All types are assumed to be primary types, unless they have the input suffix. Input types must not be used outside of the translation layer, e.g. they must only be used in a route handler and must not be used in derivers.

To fulfill the above architecture directive, I created an adapter that transforms the ServerConfigInput into the ServerConfig primary type. But this approach had an issue in that it needed the data from the application manifest. I realized there's not a lot of point leaving the application manifests on disk and waiting until we need them before reading them into memory. So I created an app manifests lifecycle service that loads the manifests into memory and provide them to the rest of the application. This allowed us to synchronously retrieve the app manifest inside the adapter.

I thought it was weird that the patch config controller had a lot of logic regarding how to perform a transaction to update and implement configuration changes. I moved these responsibilities into the config service, which means other controllers are going to be able to reuse this logic.

In the process of implementing the adapter, a lot of responsibility was extracted from the application resource, since it was mostly trying to figure out how to transform the input type into the resource definitions.

### Motivation A lot of the application logic was scattered across the translation layer, lifecycle services, and resource implementations. Now that the first use case has mostly been implemented, we need to consolidate the software architecture ### Solution We want to distinguish between primary types and input types. All types are assumed to be primary types, unless they have the input suffix. Input types must not be used outside of the translation layer, e.g. they must only be used in a route handler and must not be used in derivers. To fulfill the above architecture directive, I created an adapter that transforms the `ServerConfigInput` into the `ServerConfig` primary type. But this approach had an issue in that it needed the data from the application manifest. I realized there's not a lot of point leaving the application manifests on disk and waiting until we need them before reading them into memory. So I created an app manifests lifecycle service that loads the manifests into memory and provide them to the rest of the application. This allowed us to synchronously retrieve the app manifest inside the adapter. I thought it was weird that the patch config controller had a lot of logic regarding how to perform a transaction to update and implement configuration changes. I moved these responsibilities into the config service, which means other controllers are going to be able to reuse this logic. In the process of implementing the adapter, a lot of responsibility was extracted from the application resource, since it was mostly trying to figure out how to transform the input type into the resource definitions.
Add ip service
All checks were successful
/ test-and-lint (push) Successful in 2m51s
9428d7b8f6
refactoring server config
Some checks failed
/ test-and-lint (push) Failing after 5s
14ee61ae0e
quick cleanup before refactoring deriver
Some checks failed
/ test-and-lint (push) Failing after 5s
7f3e9ffcbc
fixed manager arguments
Some checks failed
/ test-and-lint (push) Failing after 4s
16c7703eb9
update file manager
Some checks failed
/ test-and-lint (push) Failing after 6s
3c4f44fd16
fixed test
Some checks failed
/ test-and-lint (push) Failing after 4m33s
370a583b09
log?
Some checks failed
/ test-and-lint (push) Has been cancelled
a0fedfcfc5
Fixed test
Some checks failed
/ test-and-lint (push) Failing after 2m50s
b410c9ab24
actually fix test properly
All checks were successful
/ test-and-lint (push) Successful in 2m50s
74ba9aea20
create adapter
Some checks failed
/ test-and-lint (push) Failing after 5s
10aa9296c8
update deriver
Some checks failed
/ test-and-lint (push) Failing after 5s
f5ea90b6c4
fixed webserver
Some checks failed
/ test-and-lint (push) Failing after 4s
f1d57eefdf
update patchConfig controller
Some checks failed
/ test-and-lint (push) Failing after 6s
c5a04ff74f
update deriver tests
Some checks failed
/ test-and-lint (push) Failing after 1m28s
78ffa847a1
derp
Some checks failed
/ test-and-lint (push) Failing after 1m31s
158a47ce7d
don't try to walk itself
Some checks failed
/ test-and-lint (push) Has been cancelled
11e3da6461
exclude .git
Some checks failed
/ test-and-lint (push) Has been cancelled
1bc74279a6
double derp
Some checks failed
/ test-and-lint (push) Failing after 3m45s
54bc494a46
hmm
Some checks failed
/ test-and-lint (push) Failing after 3m41s
cdcfcbbb05
idk
Some checks failed
/ test-and-lint (push) Has been cancelled
38a22a0e26
nnnnnn
Some checks failed
/ test-and-lint (push) Failing after 3m35s
9ff0b0b448
reeeeeeeeeeeeeeeeee
Some checks failed
/ test-and-lint (push) Failing after 2m52s
171c1f793e
what is going on
Some checks failed
/ test-and-lint (push) Failing after 2m54s
df21e21554
various cleanup
Some checks failed
/ test-and-lint (push) Failing after 2m56s
83fb27a6fc
update test
All checks were successful
/ test-and-lint (push) Successful in 2m56s
8669d5b8be
cleanup
Some checks failed
/ test-and-lint (push) Has been cancelled
784359f85e
removed comment
All checks were successful
/ test-and-lint (push) Successful in 2m58s
cab77d99bf
antman merged commit 6031a32470 into main 2026-08-24 07:18:50 +00:00
antman deleted branch refactor-disk-persistence 2026-08-24 07:18:50 +00:00
antman referenced this pull request from a commit 2026-08-24 07:18:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kill-the-cloud/server-manager!20
No description provided.