Unify two-root lib + test layout to one root per namespace #534

Open
opened 2026-06-15 22:14:16 +02:00 by moritz · 0 comments
Owner

Motivation

The same namespace currently lives under two directory roots: Mv.Membership.* is split across lib/membership/
and lib/mv/membership/ (likewise accounts, membership_fees); the test tree is split the same way. This is
the dominant navigation cost and feeds dependency cycles.

Key simplification

Module names are already correctlib/membership/member.ex already defines Mv.Membership.Member, etc.
Only the directory lags. Elixir resolves modules by name, not path, so this is a pure physical relocation
(git mv files + their test files); defmodule and all alias/references stay unchanged → no caller churn.
Do not rename modules here (separate, larger refactor; unnecessary for layout).

Scope (ordered sequence, one step per commit, CI green each)

  • Step 0: move the stray lib/mv_web/member_live/index/membership_fee_status.ex under
    lib/mv_web/live/member_live/index/ (R-004).
  • Step 1: Membership — lib/membership/**lib/mv/membership/**; move matching tests test/membership/**
    test/mv/membership/**.
  • Step 2: Accounts — lib/accounts/**lib/mv/accounts/**; move matching tests.
  • Step 3: MembershipFees — lib/membership_fees/**lib/mv/membership_fees/**; move matching tests.
  • Update the layout section of CODE_GUIDELINES.md.

Acceptance criteria

  • One namespace ↔ one directory across lib + test.
  • mix compile and just ci-dev green after each step.

Main caveats

  • Colliding test module names when merging the two test trees must be renamed.
  • Verify nothing keys on the old paths: .credo.exs included: globs, mix elixirc_paths, any path-based tooling.
  • Run this before the Member-resource split issue so that split operates on the final path.
## Motivation The same namespace currently lives under two directory roots: `Mv.Membership.*` is split across `lib/membership/` and `lib/mv/membership/` (likewise `accounts`, `membership_fees`); the test tree is split the same way. This is the dominant navigation cost and feeds dependency cycles. ## Key simplification Module **names are already correct** — `lib/membership/member.ex` already defines `Mv.Membership.Member`, etc. Only the directory lags. Elixir resolves modules by name, not path, so this is a **pure physical relocation** (`git mv` files + their test files); `defmodule` and all `alias`/references stay unchanged → no caller churn. Do **not** rename modules here (separate, larger refactor; unnecessary for layout). ## Scope (ordered sequence, one step per commit, CI green each) - Step 0: move the stray `lib/mv_web/member_live/index/membership_fee_status.ex` under `lib/mv_web/live/member_live/index/` (R-004). - Step 1: Membership — `lib/membership/**` → `lib/mv/membership/**`; move matching tests `test/membership/**` → `test/mv/membership/**`. - Step 2: Accounts — `lib/accounts/**` → `lib/mv/accounts/**`; move matching tests. - Step 3: MembershipFees — `lib/membership_fees/**` → `lib/mv/membership_fees/**`; move matching tests. - Update the layout section of `CODE_GUIDELINES.md`. ## Acceptance criteria - One namespace ↔ one directory across `lib` + `test`. - `mix compile` and `just ci-dev` green after each step. ## Main caveats - Colliding test module names when merging the two test trees must be renamed. - Verify nothing keys on the old paths: `.credo.exs` `included:` globs, mix `elixirc_paths`, any path-based tooling. - Run this **before** the Member-resource split issue so that split operates on the final path.
moritz added this to the Code and Test Refactoring | TI I milestone 2026-06-15 22:14:16 +02:00
moritz added this to the Sprint 18: Juli 2026 project 2026-06-15 22:14:16 +02:00
Sign in to join this conversation.
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: local-it/mitgliederverwaltung#534
No description provided.