Skip to content

[v3-3-test] Keep OpenAPI error responses in sync with the statuses routes raise - #73968

Merged
pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-71647
Oct 1, 2026
Merged

pierrejeambrun merged 1 commit into
apache:v3-3-testfrom
astronomer:backport-71647

Conversation

@pierrejeambrun

Copy link
Copy Markdown
Member

Backport of #71647 to v3-3-test.

Cherry-picked from 8d4ab8a.

Two files conflicted and were scope-narrowed to this PR's actual change (the create_openapi_http_exception_doc import and the responses= additions), dropping main-only context that does not exist on v3-3-test:

  • core_api/routes/ui/assets.py — kept the release-branch imports and added only create_openapi_http_exception_doc; dropped the get_assets UI handler and its OnlyActiveFilter / ReadableAssetsFilterDep / requires_access_asset_alias imports (main-only). Applied the 404 on next_run_assets.
  • execution_api/routes/asset_events.py — dropped the main-only _parse_extra_params helper; applied only the 400 on /by-asset (the handler here raises that 400 directly on v3-3-test).

The new check-openapi-exception-doc-in-sync hook passes on all v3-3-test route files.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

🤖 Generated with Claude Code

…pache#71647)

* Keep OpenAPI error responses in sync with the statuses routes raise

`create_openapi_http_exception_doc(...)` feeds the `responses=` block that the
generated spec — and every client built from it — uses to model error
responses, but nothing ties that list to the statuses a handler actually
raises. The two drift apart silently, and the same drift has had to be found
and patched by hand four times (apache#67570, apache#67571, apache#70992, apache#71011).

A static check keeps them together, so the next divergence fails in CI instead
of shipping a spec that omits a response the API really returns.

* Recognize Cadwyn routers in the OpenAPI error-response check

ROUTER_CLASSES omitted VersionedAPIRouter, so router-level `responses=` was invisible on every Cadwyn-based execution API route, and three statuses those routers already declare were reported as undeclared.

prek executes hook scripts directly, so the script needs its executable bit to run at all.

(cherry picked from commit 8d4ab8a)
@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:dev-tools area:task-sdk area:UI Related to UI/UX. For Frontend Developers. labels Sep 30, 2026
@pierrejeambrun
pierrejeambrun merged commit 1fa2bbb into apache:v3-3-test Oct 1, 2026
114 of 115 checks passed
@pierrejeambrun
pierrejeambrun deleted the backport-71647 branch October 1, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:dev-tools area:task-sdk area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants