Skip to content

fix(cli): strip .github/workflows/ from workspace-bundled sample module - #149

Merged
antosubash merged 3 commits into
mainfrom
claude/fix-workflow-location-MRVNa
May 13, 2026
Merged

fix(cli): strip .github/workflows/ from workspace-bundled sample module#149
antosubash merged 3 commits into
mainfrom
claude/fix-workflow-location-MRVNa

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

smpy create-module legitimately ships .github/workflows/{ci.yml, publish.yml} — modules published as their own repo need CI + PyPI trusted publishing on day one.

But smpy new also calls create_module() to drop a sample hello module under modules/hello/ inside a workspace. GitHub Actions only reads workflows from the repo root (<app>/.github/workflows/), so <app>/modules/hello/.github/workflows/ ends up being dead files masquerading as active CI — confusing for anyone learning the layout.

This PR strips the sample's .github/ tree after scaffolding, mirroring how _strip_workspace_owned_files already drops host files the workspace root owns. The standalone smpy create-module path is untouched.

Test plan

  • New regression test test_sm_new_strips_sample_module_github_workflows asserts modules/hello/.github/ is absent after smpy new
  • Existing test_scaffold_ships_github_workflows (and the other publish.yml/ci.yml tests in test_scaffolding_module.py) still pass — standalone smpy create-module still ships workflows
  • uv run pytest framework/cli/tests/test_cli_new.py framework/cli/tests/test_scaffolding_module.py → 33 passed
  • ruff check + ruff format --check clean on changed files

https://claude.ai/code/session_01LfX6sdezX5NFAH3v1eixUq


Generated by Claude Code

claude added 2 commits May 13, 2026 06:19
`smpy create-module` ships .github/workflows/{ci.yml, publish.yml} so
authors who publish a module as its own repo get CI + PyPI trusted
publishing out of the box. But `smpy new` calls create_module() to drop
a sample `hello` module under modules/hello/ in a workspace — GitHub only
reads workflows from the repo root, so the bundled copies were dead
files masquerading as active CI.

Strip the sample's .github/ tree after scaffolding, mirroring how
_strip_workspace_owned_files drops host files the workspace root owns.

https://claude.ai/code/session_01LfX6sdezX5NFAH3v1eixUq
…t test

The dedicated test pushed test_cli_new.py past the 300-line cap.
Move the regression assertion next to the other "files we don't ship
at host/" assertions in test_sm_new_default_lays_down_workspace_layout
— both check the same workspace-mode trimming behavior.

https://claude.ai/code/session_01LfX6sdezX5NFAH3v1eixUq
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 13, 2026

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: bc8e71f
Status: ✅  Deploy successful!
Preview URL: https://92954713.simple-module-python.pages.dev
Branch Preview URL: https://claude-fix-workflow-location.simple-module-python.pages.dev

View logs

- Trim the 4-line comment to one line covering only the non-obvious
  WHY (workflows under a sub-path don't run).
- Drop ignore_errors=True — the template guarantees .github/ exists
  immediately after create_module(), so silent error-swallowing only
  hides real OS-level failures.

https://claude.ai/code/session_01LfX6sdezX5NFAH3v1eixUq
@antosubash
antosubash marked this pull request as ready for review May 13, 2026 06:30
@antosubash
antosubash merged commit 8b6dee0 into main May 13, 2026
12 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.

2 participants