fix(cli): omit per-module .github/ for in-repo create-module (#210) - #211
Merged
Conversation
Deploying simple-module-python with
|
| Latest commit: |
ddbfbc3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2306b78a.simple-module-python.pages.dev |
| Branch Preview URL: | https://fix-210-create-module-ci-ski.simple-module-python.pages.dev |
antosubash
force-pushed
the
fix-210-create-module-ci-skip
branch
from
June 15, 2026 22:36
cdf500f to
b0e4a09
Compare
…e_router FastAPI 0.137 / Starlette 1.3 made `include_router()` lazy: included routes no longer appear in `app.routes` (they sit behind `_IncludedRouter` wrappers and resolve only at request time). Tests that introspected `app.routes` by `.path` stopped seeing module/health routes — so `test_expected_routes_registered` and `test_registers_module_routes_with_prefix` failed even though the routes still work at runtime. (Surfaced via dependency drift since the last green run.) - Add `simple_module_test.effective_route_paths(app)`: reads the OpenAPI schema (fully-resolved prefixes) unioned with top-level mounts — version-agnostic, and the supported way to assert on registered routes. - Use it in the affected hosting/testing route tests; the absence assertions (`test_isolates_*`, `test_modules_enabled_*`) become meaningful again instead of passing vacuously under lazy inclusion. The dashboard's bare-prefix Inertia alias is `include_in_schema=False`; its behaviour stays covered by `TestProtectedPages`.
Owner
Author
|
Note: this PR's |
`smpy create-module` scaffolds a `.github/` (ci.yml + publish.yml) that only makes sense for a module living in its own repo. Inside an existing host repo (the documented `modules/*` layout) those nested workflows never run — GitHub only reads the repo-root `.github/workflows/` — and `publish.yml` (PyPI publish on any `v*` tag) is a footgun. - `create_module()` gains `include_ci` (default True); when False, the scaffolded `.github/` is removed. - The CLI detects an in-repo dest (ancestor `.git`/`pyproject.toml`) and omits `.github/` by default with a discoverable note; `--standalone` forces it. - New `is_inside_existing_repo()` helper in `scaffolding.py`. - `app_project._scaffold_sample_module` now passes `include_ci=False` instead of a manual `rmtree`. Closes #210
antosubash
force-pushed
the
fix-210-create-module-ci-skip
branch
from
June 15, 2026 23:03
b0e4a09 to
04e5d23
Compare
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
smpy create-module <name>scaffolds a.github/(ci.yml+publish.yml) inside the module. For a module created inside an existing host repo — the documented monorepomodules/*layout — these are dead weight at best and a footgun at worst:.github/workflows/, somodules/<name>/.github/workflows/*.ymlnever triggers.ci.ymlassumes the module is the repo root (runsuv sync/ruff/pytestfrom.) — wrong working dir/dependency graph inside a host's uv workspace.publish.ymlis a PyPI-publish footgun — triggers on anyv*tag to publishsimple_module_<name>via OIDC.Resolves the last of the issues from the consumer-app feedback batch (the others — #199/#200/#203/#206 — were resolved in #209 / v0.0.19; #210 was not covered).
Approach (context detection + opt-in flag, both implemented)
create_module()gainsinclude_ci(defaultTrue, so the low-level API and its existing tests are unchanged). WhenFalse, the scaffolded.github/is removed.include_ci = standalone or not is_inside_existing_repo(target):.gitorpyproject.toml) → omit.github/by default, and print a discoverable note pointing at--standalone.--standalone→ always emit.github/(for a module that lives in its own repo)..github/as before.is_inside_existing_repo()helper inscaffolding.py.app_project._scaffold_sample_module(thesmpy newsample module) now usesinclude_ci=Falseinstead of a manualrmtree(".github")— same effect, one code path.Tests
framework/cli/tests/test_create_module_ci_skip.py:create_module(include_ci=False)omits.github/; default ships it..github/for an in-repo dest (+ prints the note);--standaloneforces it; a clean standalone target keeps it.is_inside_existing_repo(.gitparent,pyprojectparent, clean target — the module's own scaffoldedpyproject.tomldoesn't count).Verification
uv run pytest framework/cli/tests/→ 173 passed.framework/hosting/framework/testing, unrelated to this change — identical onmain).ruff check+ruff format --check+ty+ 300-line file-size cap + readmes — all clean.scaffolding.pystays under the cap (298 lines).Closes #210