Repository navigation
Add reflection_apps to create v1 and v1alpha apps - #460
Merged
Merged
Conversation
Both reflection services list each other in `list_services`, so a server needs to mount both, which took four constructors. The two service paths share no prefix, so a single combined application can't be mounted at one `path`; instead, `reflection_apps` returns the v1 and v1alpha ASGI applications for the same descriptors, and `reflection_apps_sync` does the same for WSGI. Follows up on review feedback in #453. Signed-off-by: Stefan VanBuren <stefan@vanburen.xyz>
stefanvanburen
marked this pull request as ready for review
November 10, 2026 23:14
anuraaga
approved these changes
Nov 11, 2026
Comment on lines
+35
to
+38
| `reflection_apps` returns applications for both `grpc.reflection.v1` and | ||
| `grpc.reflection.v1alpha`. Mount both: each lists the other, and a client | ||
| that calls v1alpha gets a 404 if it isn't mounted. Use | ||
| `reflection_apps_sync` for WSGI. |
Collaborator
There was a problem hiding this comment.
Suggested change
| `reflection_apps` returns applications for both `grpc.reflection.v1` and | |
| `grpc.reflection.v1alpha`. Mount both: each lists the other, and a client | |
| that calls v1alpha gets a 404 if it isn't mounted. Use | |
| `reflection_apps_sync` for WSGI. | |
| `reflection_apps` / `reflection_apps_sync` return applications for both `grpc.reflection.v1` and | |
| `grpc.reflection.v1alpha`. It is recommended to mount both - even if mounting one, both will be returned in `ListServices` and a client that calls the unmounted service will 404. |
Mostly to clarify what lists the other means here which isn't clear. Let's apply the same to the docstrings
Collaborator
|
@stefanvanburen I think you missed the nit comment |
stefanvanburen
added a commit
that referenced
this pull request
Nov 12, 2026
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.
Follow-up to #453 (comment): rather than one combined app (which can't be mounted at a single
path),reflection_apps(*descs)/reflection_apps_sync(*descs)return the v1 and v1alpha apps as a plain tuple, so mounting both is a one-liner loop overMount(app.path, app). The README example now uses it.The helpers only take descriptors; anyone needing interceptors or custom codecs can still construct the classes directly. A plain tuple rather than a
NamedTuplekeeps the API surface small, and upgrading to one later wouldn't break unpacking or indexing.