Skip to content

Updated Deprecated on_event in Starlette 1.0#150

Merged
hubert-marek merged 2 commits intomainfrom
fix/platform-lifespan-github-enum
Apr 17, 2026
Merged

Updated Deprecated on_event in Starlette 1.0#150
hubert-marek merged 2 commits intomainfrom
fix/platform-lifespan-github-enum

Conversation

@hubert-marek
Copy link
Copy Markdown
Member

@hubert-marek hubert-marek commented Apr 17, 2026

  • Convert the shutdown hook to a lifespan context manager so uvicorn boots on Starlette 1.0 (the decorator-based on_event hook was removed in that release and crashed create_app at import time).

- Convert the shutdown hook to a lifespan context manager so uvicorn
  boots on Starlette 1.0 (the decorator-based ``on_event`` hook was
  removed in that release and crashed ``create_app`` at import time).
- Add ``github`` to the ``Service`` enum so ``initEnv`` accepts the
  GitHub templates that were landed alongside the service package.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hubert-marek
Copy link
Copy Markdown
Member Author

  • Convert the shutdown hook to a lifespan context manager so uvicorn boots on Starlette 1.0 (the decorator-based on_event hook was removed in that release and crashed create_app at import time).

Add it as step 5 in the "Adding a New Service" section so future
service authors don't forget to widen the Pydantic enum — skipping
it leaves initEnv returning a validation error even after the router
is mounted and templates are seeded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hubert-marek hubert-marek changed the title Fix platform startup on Starlette 1.0 and register github service Updated Deprecated on_event in Starlette 1.0 Apr 17, 2026
@hubert-marek hubert-marek merged commit 239ede6 into main Apr 17, 2026
1 check 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.

1 participant