Skip to content
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

Add typed models for projects #507

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Add typed models for projects #507

wants to merge 18 commits into from

Conversation

eljamm
Copy link
Contributor

@eljamm eljamm commented Feb 14, 2025

Can be tested with:

nix-instantiate --eval --strict --expr "let self = import ./default.nix {}; in self.project-models.example"

You can also use watchexec to continuously monitor the output as the file changes:

watchexec '<COMMAND>'

If this is the correct way to go, project deliverables will be added next.

@eljamm eljamm linked an issue Feb 14, 2025 that may be closed by this pull request
@eljamm eljamm self-assigned this Feb 14, 2025
Copy link
Contributor

@erictapen erictapen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looking forward to have some kind of model in tree that we can start iterating on.

We might want to consider adding extensive doc comments in projects/models.nix, as this is a file that is likely to be looked at by contributors a lot.

Also I'm not sure I yet understand the exact scope of the project model. Is it supposed to eventually contain only the external data we get from NLnet or also the kind of information that we have from the package set itself, e.g. versions, vulnerabilities, labels?

fricklerhandwerk and others added 9 commits February 25, 2025 18:04
This is not only much cleaner and more readable than the previous
approach, but it also ensures that only the specified fields are allowed
in the data model.
First, each program and service should have at least one example, that's
why we require that the attribute is non empty.

Second, we allow examples to be null in order to express that it's
something needed, but not yet available.
@eljamm
Copy link
Contributor Author

eljamm commented Feb 26, 2025

The code looks much cleaner now after using structs and it should also be more robust since only the modeled attributes will be allowed. The included example should also be more useful now since it details how things fit together and how the structure will actually look like.

PS: I tried to add some requirements from ngi-nix/summer-of-nix#163, but there are some things I'm not certain about like how to implement the configuration options for programs and services and how tests should be structured beyond simple derivations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

US: Force correct data type for deliverables
3 participants