Skip to content

Phase 1: optional User example slice + bake matrix#27

Merged
tomasanchez merged 1 commit into
mainfrom
feat/optional-user-example
Jun 12, 2026
Merged

Phase 1: optional User example slice + bake matrix#27
tomasanchez merged 1 commit into
mainfrom
feat/optional-user-example

Conversation

@tomasanchez

Copy link
Copy Markdown
Owner

Phase 1 — Optional User example slice (#21) + bake matrix (#22)

Makes the include_user_example Copier flag functional and proves both template states with a feature-flag bake matrix.

#21 — optional User slice

  • Conditional _exclude (templated, gitignore-style wildcards) drops the entire User slice when include_user_example=false: commands, events, model, adapters (model/repository/queries), routes, reader, handlers, the create-users migration, and all user tests.
  • bootstrap.py, router.py, migrations/env.py, and both unit-of-work modules are Jinja-guarded so the OFF path yields a coherent monitor-only service (empty bus, no user reader) that still imports, types, and runs.
  • Added generic core tests (unit-of-work lifecycle, self-contained messagebus/messages) so the monitor-only baseline keeps 100% coverage without user-specific tests — no coverage omit/gate hacks.

#22 — bake matrix

  • tests/test_bake.py now parametrizes over include_user_example true/false; each variant runs uv sync, ruff check, ruff format --check (newly added to match the generated make lint), pyrefly check, and pytest --cov-fail-under=100.
  • Asserts the User slice is present iff the flag is on.

Validation (both states, full gate, green)

  • User-on: 56 tests, 100% coverage. User-off: 34 tests, 100% coverage. Ruff (+format) and Pyrefly clean in both.
  • Independently re-verified the generated make lint (ruff format --check) passes for both states (70 / 54 files).

Closes #21
Closes #22
Refs #24

🤖 Generated with Claude Code

Wire the include_user_example flag: conditional _exclude drops the User slice (commands, events, model, adapters, routes, reader, handlers, migration, and user tests) when off, and bootstrap/router/migrations/unit-of-work are Jinja-guarded so the off path yields a coherent monitor-only service. Add generic core tests (unit-of-work lifecycle, self-contained messagebus and messages) so both states stay at 100% coverage, and extend the bake-test into a true/false matrix that runs ruff check, ruff format --check, pyrefly, and pytest --cov-fail-under=100 for each.

Bakes proven green both ways: User-on 56 tests / User-off 34 tests, 100% coverage each.

Closes #21

Closes #22

Refs #24

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomasanchez tomasanchez merged commit a99cbeb into main Jun 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(template): bake-and-test CI matrix for the template feat(template): optional feature flags and post-generation tasks

1 participant