Skip to content

Minor fixes + Type annotations for the whole codebase#206

Merged
ndevenish merged 7 commits into
mainfrom
typing
May 12, 2026
Merged

Minor fixes + Type annotations for the whole codebase#206
ndevenish merged 7 commits into
mainfrom
typing

Conversation

@ndevenish
Copy link
Copy Markdown
Contributor

Most of the public API was done manually (for public base classes). Claude was used to extrapolate these to the downstream implementations of that base class, and for some of the less important internal details (e.g. the stuff in contrib, example services).

Docstrings have been reformatted to Google-Style. Some of them have been rewritten/enhanced, especially in the RecipeWrapper systems.

ndevenish added 5 commits May 11, 2026 17:51
Pyright flagged int(headers.get("subscription")) since .get() can
return None. Subscription is always present on incoming stomp
messages, so use direct indexing instead.
The classes internally are set up to allow empty or null transport, which we
almost never want to actually use. Use this property as a way of retrieving
the concrete transport (or failing) rather than handling None logic everywhere
that we don't need it
Comment thread src/workflows/transport/middleware/__init__.py Dismissed
Comment thread src/workflows/transport/middleware/__init__.py Dismissed
Comment thread src/workflows/transport/middleware/__init__.py Dismissed
Comment thread src/workflows/recipe/__init__.py Fixed
Comment thread src/workflows/recipe/__init__.py Dismissed
Comment thread src/workflows/recipe/__init__.py Dismissed
Comment thread src/workflows/recipe/wrapper.py Dismissed
Comment thread src/workflows/recipe/wrapper.py Dismissed
Comment thread src/workflows/transport/common_transport.py Dismissed
Comment thread src/workflows/transport/common_transport.py Dismissed
ndevenish added 2 commits May 12, 2026 09:05
Annotate Recipe, RecipeWrapper, CommonTransport, common_service,
transport middleware (incl. OTEL), pika/stomp/offline transports,
frontend, contrib, services, and util/zocalo modules. Also includes
related minor refactors required by typing: elevate kwargs to explicit
parameters where appropriate; make CommonService.transport raise if
unset; route the cls.recipe override correctly in Recipe.__init__;
forward log_extender in recipe.wrap_subscribe; type-annotate
validate_recipe and the offline/middleware classes; tighten test
signature expectations to match the new exact send() signature.
@ndevenish ndevenish merged commit 9d82637 into main May 12, 2026
12 of 13 checks passed
@ndevenish ndevenish deleted the typing branch May 12, 2026 08:13
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