fix: operations api async calls - #1790
Open
davidgamez wants to merge 8 commits into
Open
Conversation
davidgamez
marked this pull request as ready for review
July 31, 2026 16:20
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.
Summary
The Operations API's generated FastAPI routers invoke each impl method without
await(
return BaseXApi.subclasses[0]().method(...)). Several impl methods were declaredasync def,so at runtime they returned un-awaited coroutines instead of responses — producing HTTP 500
(
ResponseValidationError) on the live API. Unit tests missed it because they call the impldirectly and
awaitit, never crossing the router→impl seam.This PR:
validate_requestwrapper)plain
def, so the routers' non-awaited calls return real responses. This is a correctness fix,not a performance cleanup — and it does not reduce concurrency. Requests are still served
concurrently by the Cloud Run / functions-framework worker threads; only the Python function
definitions change from
async deftodef.detect_changes: excludes derived/read-only fields(
source_info.license_is_spdx) and normalizes "absent" values (None/""/[]) on bothsides of the diff, so an unchanged feed saved from Retool no longer reports false edits.
test_routes_are_sync.pyasserting no route-backing methodis a coroutine, and an
operations-api-surfaceCI job that boots the real API and hits everyendpoint over HTTP to catch any 5xx from a coroutine/serialization leak.
Expected behavior:
Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).
Testing tips:
Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.
Please make sure these boxes are checked before submitting your pull request - thanks!
./scripts/api-tests.shto make sure you didn't break anything