feat/modules #43

Merged
yorunikakeru merged 22 commits from feat/modules into main 2026-06-21 13:59:40 +02:00
Owner

Closes #42

Closes #42
Adds UnvalidatedModule sum type (Docker/PostgreSQL/Nginx/Forgejo variants),
ucModules field to UnvalidatedConfiguration, and csModules/addModule to the
ConfigBuilder. The lower function still emits emptyModuleMap until lowerModules
is wired in Task 8.
Adds enableModule/disableModule/restartModule for use in profile/service
builders, and docker/postgresql/nginx/forgejo as ModuleRef constructors.
Adds dockerModule builder with moduleEnable/rootless/storageDriver combinators.
Mirror test is wrapped in expectFail until lowerModules is wired in Task 8.
Adds named module builders for PostgreSQL, Nginx, and Forgejo. All three
validate the module name eagerly via mkModuleName. Builder-mirror tests are
wrapped in expectFail until lowerModules is wired in Task 8.
feat: wire lowerModules, add DuplicateModuleName, update public API and changelog
All checks were successful
CI / linux (pull_request) Successful in 2m5s
c890c36ca9
Wires lowerModules in DSL.Validate.lower so module configs are included in
IR output. Adds DuplicateModuleName validation error and its Diagnostics
renderer. Removes expectFail wrappers from serialization tests. Adds four
golden fixtures for module configs. Updates CHANGELOG with all issue #42
additions.
nginxModule is now a singleton — name auto-filled as "nginx".
Adds enable, and withFallback combinator for backtick infix use.
Fixtures updated: nginx-module.json and server-stack.json now use "nginx".
Modules now derive their own ServiceSection at lowering time:
- PostgreSQL and Forgejo gain derivePolicies (AllowPorts from declared ports)
- moduleServiceSections in Validate.hs maps enabled modules to service sections
- referenceError now includes module names in the declared set
- Explicit service blocks removed from serverStackConfig and combined tests
- Standalone module fixtures updated with auto-generated service sections
All three are now fixed-name constants mirroring the builder API —
no name argument needed since each is a singleton with a canonical name.
Remove empty-name rejection tests; those code paths no longer exist.
Correct stale entries (named module builders, moduleEnable → enable),
add withFallback, singleton module refs, and auto-generated service sections.
- app/Main.hs: include serverStack in the compiled demo
- DSL.cabal: expose ServerStack in test other-modules
- flake.lock: bump frogos-ir to revCount 31
- src/DSL/Types.hs: clarify why UnvalidatedModule carries [Policy]
feat: add nginx virtual host builder
All checks were successful
CI / linux (pull_request) Successful in 2m4s
9fde52dcd1
refactor: flatten source module layout
All checks were successful
CI / linux (pull_request) Successful in 1m53s
042bf20a26
feat: instead of modules + services -> just services
Some checks failed
CI / linux (pull_request) Failing after 24s
d7de3895a0
choire: update floke.lock
All checks were successful
CI / linux (pull_request) Successful in 1m50s
147edc3969
fix: fallback port logic
Some checks failed
CI / linux (pull_request) Failing after 1m55s
66dae55ee5
test: add nginx port validation coverage; drop unused NginxConfig fields
All checks were successful
CI / linux (pull_request) Successful in 1m51s
e82589ffe6
- Remove nginxHttpPort, nginxHttpsPort, nginxDomain from NginxConfig (IR)
  — no DSL path, no downstream consumer; per-host data lives on NginxVirtualHost
- Add two ModuleSpec cases: empty policy list when vhost has no ports,
  and Left result for withFallback port > 65535
fromRight (error "...") on allowPortsPolicy/fallbackPolicy was
duplicated across Forgejo, Nginx, and PostgreSQL builders.
Centralize in Module.Internal so invariant message and IR wrapping
live in one place.
feat: remove Docker module from DSL
All checks were successful
CI / linux (pull_request) Successful in 1m59s
3ddb71e0e6
Delete Module.Docker, drop docker export from Module, remove
addDockerConfig from Builder. All tests and fixtures updated to use
nginx in place of docker. Golden JSON fixtures regenerated. flake.lock
updated to pick up the matching IR change (DockerDomain removed).
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
FrogOS/DSL!43
No description provided.