RehanAhmad25 commented on code in PR #72499:
URL: https://github.com/apache/airflow/pull/72499#discussion_r3975381353
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -456,7 +496,7 @@ def clear_dag_runs(
)
)
return DAGRunCollectionResponse(
- dag_runs=cleared_runs,
+ dag_runs=_build_masked_dag_run_responses(cleared_runs, dag_bag,
session),
Review Comment:
Confirmed, thanks. `clear_dag_run` (the single-run
`/dagRuns/{dag_run_id}/clear` endpoint) is a different function from
`clear_dag_runs` (bulk), which is what the diff hunk on this thread actually
shows, and it still returned `perform_clear_dag_run()`'s raw `DagRun` directly
on the non-dry-run path.
Fixed the same way as the other endpoints: wrapped the result in
`DAGRunResponse.model_validate()` and masked using the `dag` already resolved
in scope from `get_dag_run_and_dag_for_clear`. Added
`test_single_run_clear_response_masks_password_conf`, hitting this endpoint
with `dry_run=False`. Pushed.
--
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]