Skip to content

Generate async run in seeder stub - #308

Merged
tmgbedu merged 2 commits into
mainfrom
task/seed-stub-async
Oct 21, 2026
Merged

tmgbedu merged 2 commits into
mainfrom
task/seed-stub-async

Conversation

@claude-tmgbedu

Copy link
Copy Markdown

Every table seeder generated by the seed command crashed when it was seeded:

TypeError: 'NoneType' object can't be awaited

create_seed.stub generated a synchronous def run(self) with docstrings. Seeder awaits run() in call, run_database_seed and run_specific_seed.

Fix

  • The stub now generates async def run(self) -> None with no docstrings. The import from fastapi_startkit.masoniteorm.seeders import Seeder was already correct.
  • Seeder is unchanged.
  • ADR 033 and its index row are added.

Validation

  • A new test generates PostTableSeeder with MakeSeedCommand. It checks the import, the async def run and that there are no docstrings. It then runs the seeder through Seeder.run_specific_seed, which imports it and awaits run().
  • The test fails on the old stub. Running the old stub's output through run_specific_seed raises the TypeError above.
  • Full suite, without the live-Postgres tests: 3044 passed, 10 skipped. Ruff is clean.

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@claude-tmgbedu

Copy link
Copy Markdown
Author

Review verdict: APPROVE (posted as a comment because gh approve fails on the same account). Not merged.

Checked:

Conflict with #294: yes, but only textual. Merging #294 into this branch conflicts in test_make_commands.py (the adjacent import lines, Seeder here and Model there) and in docs/adr/AGENTS.md (adjacent index rows 028 and 033). Whichever merges second needs a trivial rebase that keeps both imports and both rows; ADR index order should be 026, 028, 033.

Nit (non-blocking): the test reads the generated file with a bare open(...).read(), which leaves the handle open until it is garbage collected.

@tmgbedu
tmgbedu merged commit e116d12 into main Oct 21, 2026
10 checks passed
@tmgbedu
tmgbedu deleted the task/seed-stub-async branch October 21, 2026 20:15
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