potiuk opened a new pull request, #65915:
URL: https://github.com/apache/airflow/pull/65915

   `XComCreateBody` (POST `/xcomEntries`) rejects payloads containing reserved
   serialization keys (`__classname__`, `__type`, `__var`, `__data__`, …) via a
   `field_validator` that walks the value recursively. `XComUpdateBody` (PATCH
   `/xcomEntries/{key}`) was missing the same validator, so a payload that POST
   correctly rejects with 422 was accepted on PATCH and stored as-is.
   
   This change extracts the recursive walker to a module-level
   `_check_forbidden_xcom_keys` helper and has both `XComCreateBody` and
   `XComUpdateBody` delegate to it, so create and update apply the same
   payload-key check from a single source. A parametrized test mirroring the
   existing `test_create_xcom_entry_blocks_forbidden_keys` covers the PATCH 
path.
   
   The three regenerated files (`_private_ui.yaml`, `schemas.gen.ts`,
   `types.gen.ts`) are pre-commit catch-up for an unrelated `ExtraMenuItem`
   description that had drifted on `main`; they aren't part of the substantive
   change.
   
   <!-- Please keep an empty line above the dashes -->
   ---
   **^ Add meaningful description above**
   
   <!-- Test plan -->
   - [x] New `TestPatchXComEntry::test_patch_xcom_entry_blocks_forbidden_keys` 
covers the three reserved-key shapes and asserts HTTP 422 with `"reserved 
serialization keys"` in the detail.
   - [x] Existing 
`TestCreateXComEntry::test_create_xcom_entry_blocks_forbidden_keys` still 
passes — create-side error message is byte-identical, behaviour preserved.
   - [x] Existing `TestPatchXComEntry` cases all pass (valid update, complex 
object, integer, list, not-found, slash-key, int-type-preservation).
   - [x] `prek run --files <changed files>` clean and idempotent.
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Opus 4.7 (1M context)
   
   Generated-by: Claude Opus 4.7 (1M context) following the guidelines at
   
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to