Vamsi-klu opened a new pull request, #64989:
URL: https://github.com/apache/airflow/pull/64989

   ## Why this matters
   
   The Browse/XComs page currently has no sorting — users troubleshooting data 
handoffs between tasks must manually scan an unsorted, paginated list to find 
the XCom entry they need. For DAGs with dozens of tasks exchanging XComs, this 
makes debugging slow and frustrating.
   
   This PR adds **server-side column sorting** to the XComs page, matching the 
pattern already used by Event Logs, DAG Runs, and Task Instances. Users can now 
click any sortable column header to reorder results across the entire dataset 
(not just the current page), with **newest-first by timestamp** as the default.
   
   closes: #64594
   
   ## What changes
   
   - **API**: The `GET /xcomEntries` endpoint now accepts an `order_by` query 
parameter via the existing `SortParam` convention. Sortable fields: 
`timestamp`, `run_after`, `dag_id`, `task_id`, `key`, `map_index`, plus aliases 
`run_after` (DagRun join) and `task_display_name` (maps to `task_id`). Default: 
`-timestamp`.
   - **UI**: Six columns (`Key`, `DAG`, `Run After`, `Task`, `Map Index`, 
`Timestamp`) now have clickable sort headers. Sorting state persists in URL 
params and localStorage, consistent with other pages.
   - **OpenAPI spec + generated client**: Regenerated via `pnpm codegen` — not 
hand-edited.
   
   ## Tradeoffs
   
   - Sorting by the **DAG** column sorts by `dag_id`, not `dag_display_name` — 
this is consistent, predictable, and avoids a cross-table sort that would 
degrade query performance.
   - Same for the **Task** column — sorts by `task_id` under the hood.
   - The `Run ID` column is intentionally not sortable since run IDs are opaque 
strings with no meaningful sort order.
   
   ## Test plan
   
   - [x] 7 new parametrized backend tests covering: ascending/descending `key`, 
ascending/descending `timestamp`, `run_after`, `task_display_name`, and invalid 
attribute (400 error)
   - [x] 5 existing order-dependent tests updated with explicit `order_by` 
params to remain deterministic under the new default
   - [x] Full test suite: **61/61 tests pass** in `test_xcom.py`
   - [x] Ruff format + check clean on all edited Python files
   - [ ] Manual UI verification: click column headers on Browse/XComs, confirm 
sort indicators, pagination, and filters all work together
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.6)
   
   Generated-by: Claude Code (Opus 4.6) following [the 
guidelines](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