Untangle compile cycles #594

Merged
simon merged 14 commits from issue/mitgliederverwaltung-538 into main 2026-10-16 11:15:41 +02:00
Owner

closes #538

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

Untangle compile cycles: split Mv.Config and extract the join-request workflow. The 721-line Mv.Config and the join workflow inside the Mv.Membership domain tied the domain, its policy checks and the web layer into compile-time cycles, so small edits recompiled large parts of the app. Configuration now lives in per-context modules, the join workflow has its own module outside the domain, and the two remaining edges into the web layer and the OIDC provider switch go through configuration. Measured with mix xref graph: cycles 69 → 49, compile-connected cycles 19 → 3 (the three left are outside this scope: roles/permissions, user/OIDC role sync, Router ↔ LiveUserAuth). Behaviour is unchanged.

What has been changed?

  • Share ENV-over-settings resolution in Mv.Config.Source
  • Read settings without going through the Membership domain
  • Read sql_sandbox? from a settings-free Mv.Env
  • Move SMTP and sender configuration into Mv.Smtp.Config
  • Move OIDC configuration into Mv.Oidc.Config
  • Move Vereinfacht configuration into Mv.Vereinfacht.Config
  • Keep only the helpers the slices use public in Mv.Config.Source
  • Move CSV import and PDF export limits into ImportExport.Config
  • Extract the join-request workflow into Mv.Membership.JoinFlow
  • Resolve the join notifier from config without a web-layer default
  • Reach the OIDC provider switch through a configured observer
  • Order JoinFlow public functions before private helpers
  • Guard against a config facade and join functions on the domain
  • Point configuration and join workflow docs at the new modules

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

  • config :mv, :join_notifier and the new config :mv, :oidc_provider_observer are required now; a missing entry raises instead of falling back silently. Both are set in config/config.exs.
  • New architecture tests (test/mv/architecture/) run mix xref and fail if the settings/ProviderSwitch or domain/mail-layer cycles come back.
  • Oversized commits (> 5 files or > 150 lines): the SMTP, OIDC and Vereinfacht slice moves, the JoinFlow extraction (≈ 540 lines moved out of Mv.Membership) and the JoinFlow reorder (pure move). Most of these diffs are moves.
closes #538 ## Description of the implemented changes The changes were: - [ ] Bugfixing - [ ] New Feature - [ ] Breaking Change - [x] Refactoring Untangle compile cycles: split `Mv.Config` and extract the join-request workflow. The 721-line `Mv.Config` and the join workflow inside the `Mv.Membership` domain tied the domain, its policy checks and the web layer into compile-time cycles, so small edits recompiled large parts of the app. Configuration now lives in per-context modules, the join workflow has its own module outside the domain, and the two remaining edges into the web layer and the OIDC provider switch go through configuration. Measured with `mix xref graph`: cycles 69 → 49, compile-connected cycles 19 → 3 (the three left are outside this scope: roles/permissions, user/OIDC role sync, `Router` ↔ `LiveUserAuth`). Behaviour is unchanged. ## What has been changed? - Share ENV-over-settings resolution in Mv.Config.Source - Read settings without going through the Membership domain - Read sql_sandbox? from a settings-free Mv.Env - Move SMTP and sender configuration into Mv.Smtp.Config - Move OIDC configuration into Mv.Oidc.Config - Move Vereinfacht configuration into Mv.Vereinfacht.Config - Keep only the helpers the slices use public in Mv.Config.Source - Move CSV import and PDF export limits into ImportExport.Config - Extract the join-request workflow into Mv.Membership.JoinFlow - Resolve the join notifier from config without a web-layer default - Reach the OIDC provider switch through a configured observer - Order JoinFlow public functions before private helpers - Guard against a config facade and join functions on the domain - Point configuration and join workflow docs at the new modules ## Definition of Done ### Code Quality - [ ] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [ ] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes - `config :mv, :join_notifier` and the new `config :mv, :oidc_provider_observer` are required now; a missing entry raises instead of falling back silently. Both are set in `config/config.exs`. - New architecture tests (`test/mv/architecture/`) run `mix xref` and fail if the settings/ProviderSwitch or domain/mail-layer cycles come back. - Oversized commits (> 5 files or > 150 lines): the SMTP, OIDC and Vereinfacht slice moves, the JoinFlow extraction (≈ 540 lines moved out of `Mv.Membership`) and the JoinFlow reorder (pure move). Most of these diffs are moves.
A missing :join_notifier entry now raises at call time instead of silently
falling back to the web implementation. The fallback literal was the last
compile-time edge from the join workflow into MvWeb.
The observer runs synchronously inside the settings update, as the direct
call did, so a failed provider switch still rolls back the base URL change.
docs: point configuration and join workflow docs at the new modules
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing
cbf3559b30
simon merged commit 216ff0b082 into main 2026-10-16 11:15:41 +02:00
simon deleted branch issue/mitgliederverwaltung-538 2026-10-16 11:15:41 +02:00
Sign in to join this conversation.
No description provided.