The GitHub Actions job "Tests" on 
airflow.git/fix-dag-run-state-response-validation has failed.
Run started by GitHub user ephraimbuddy (triggered by ephraimbuddy).

Head commit for run:
3874371db7dadaa7b39f4c98e5163fcaf61e61f6 / Ephraim Anierobi 
<[email protected]>
Fix execution API response-downgrade footgun and guard against regressions

When a Cadwyn VersionChange uses
@convert_response_to_previous_version_for(...) to pop a field from the
response body, FastAPI still re-validates that body against the HEAD
response_model after the converter runs. If the field is required on
the HEAD schema with no default, validation fails with
ResponseValidationError(missing) and the older-version client gets a
500 even though the endpoint executed successfully.

This was hitting clients on API version 2025-05-20 against the
PATCH /execution/task-instances/{task_instance_id}/run endpoint, where
v2025_08_10 strips DagRun.state from the body but state was declared
required on the HEAD TIRunContext schema.

Make the affected fields Optional with a default on the HEAD schemas:
- DagRun.state (stripped by v2025_08_10)
- DagRun.partition_key (stripped by v2026_04_06)
- DagRunAssetReference.partition_key (stripped by v2026_04_06)

Newer clients still receive the populated values from the SQLAlchemy
row unchanged; older clients continue to see no key on the wire.

Add a pre-commit hook (check-cadwyn-response-field-optional) that
walks the execution_api/versions/ tree, finds VersionChange classes
with response converters and `schema(X).field("Y").didnt_exist`
instructions, and verifies Y has a default on the HEAD class so
post-pop bodies still validate.

Report URL: https://github.com/apache/airflow/actions/runs/25179048527

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to