data model: add classes #7

Closed
kiara wants to merge 1 commit from data-model-add-classes into deployment-data-model-with-tests
Contributor

specifies classes in the data model, raising these to from _class model attributes to subModuleWith's class parameter where possible.

note: resource policy has remained as to use deferredModuleWith (rather than submoduleWith) to ensure evaluation will go thru.

may subsume #6, in addition to superseding #4.

merge-wise, it may be preferable to handle this PR before #5.

finally, while forgejo is horrible in viewing diffs, the likes of diffchecker handle this slightly better, highlighting changed parts of lines. in practice tho, there aren't really additional changes here.

specifies classes in the data model, raising these to from `_class` model attributes to `subModuleWith`'s `class` parameter where possible. note: resource policy has remained as to use `deferredModuleWith` (rather than `submoduleWith`) to ensure evaluation will go thru. may subsume #6, in addition to superseding #4. merge-wise, it may be preferable to handle this PR before #5. finally, while forgejo is horrible in viewing diffs, the likes of [diffchecker](https://www.diffchecker.com/text-compare/) handle this slightly better, highlighting changed parts of lines. in practice tho, there aren't really additional changes here.
kiara added 1 commit 2025-07-31 17:30:12 +02:00
specifies classes in the data model, raising these to from `_class`
model attributes to `subModuleWith`'s `class` parameter where possible.

note: resource policy has remained as to use `deferredModuleWith`
(rather than `submoduleWith`) to ensure evaluation will go thru.
fricklerhandwerk reviewed 2025-07-31 18:06:12 +02:00
@ -132,2 +139,2 @@
description = ''
Resources made available by the hosting provider, and their policies.
type = attrsOf (submoduleWith {
class = "fediversity-environment";

I don't think this is an improvement in readability

I don't think this is an improvement in readability
Author
Contributor

the PR's intent was semantic rather than just documentation - even if (as noted in Fediversity/Fediversity#481 (comment)) i haven't fully grasped the full extent of subModuleWith's class parameter.

the PR's intent was semantic rather than just documentation - even if (as noted in https://git.fediversity.eu/Fediversity/Fediversity/pulls/481#issuecomment-9183) i haven't fully grasped the full extent of `subModuleWith`'s `class` parameter.
Author
Contributor

looks like a lot of that pertains to merging logic - maybe the type checks are the main thing then

looks like a lot of that pertains to merging logic - maybe the type checks are the main thing then
fricklerhandwerk reviewed 2025-07-31 18:06:30 +02:00
@ -31,6 +33,7 @@ let
inputs.nixops4.modules.nixops4Deployment.default
{
_class = "nixops4Deployment";

Very likely not needed, as noted in the other PR

Very likely not needed, as noted in the other PR
Author
Contributor

resolving until the upstream PR may supersede this, now #6 is merged

resolving until the upstream PR may supersede this, now #6 is merged
Author
Contributor

given this got merged upstream, i rebased to remove this now, ahead of our updating nixops4 (which i will consider out of scope for this PR, as i'm sure we will down the line)

given this got merged upstream, i rebased to remove this now, ahead of our updating nixops4 (which i will consider out of scope for this PR, as i'm sure we will down the line)
kiara marked this conversation as resolved
fricklerhandwerk reviewed 2025-07-31 18:07:13 +02:00
fricklerhandwerk left a comment
Owner

The small changes dotting the i-s make sense, thanks a lot! The larger one not so much.

The small changes dotting the i-s make sense, thanks a lot! The larger one not so much.
kiara force-pushed data-model-add-classes from 6cba217e53 to 9f596ad820 2025-07-31 20:55:33 +02:00 Compare
Author
Contributor

hm, while submoduleWith seems to actually enforce the check, i'm now not sure deferredModuleWith and submodule function as more than documentation on this.

hm, while `submoduleWith` seems to actually enforce the check, i'm now not sure `deferredModuleWith` and `submodule` function as more than documentation on this.
kiara closed this pull request 2025-08-27 00:45:58 +02:00
Author
Contributor
superseded by https://git.fediversity.eu/Fediversity/Fediversity/pulls/504

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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: fricklerhandwerk/Fediversity#7
No description provided.