kaxil commented on code in PR #67639:
URL: https://github.com/apache/airflow/pull/67639#discussion_r3324701227
##########
airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/ClearTaskInstanceDialog.tsx:
##########
@@ -264,21 +256,13 @@ const ClearTaskInstanceDialog = (props: Props) => {
include_future: future,
include_past: past,
include_upstream: upstream,
+ note: noteChanged ? note : undefined,
Review Comment:
Moving the note into the clear body changes its scope. The old
`mutatePatchTaskInstance` call targeted only this task (`taskId` + `mapIndex`),
but the clear body's note is applied by the backend's
`_patch_task_instance_note`, which loops over the entire `dag.clear()` result
set. Since this dialog defaults `selectedOptions` to `["downstream"]`, clearing
a single task with a note now writes that note onto every downstream task
instance too, overwriting any notes those tasks already had. Was applying the
note to the whole cleared set intended, or should it stay scoped to the
selected TI?
##########
airflow-core/src/airflow/ui/src/queries/useBulkClearDagRuns.ts:
##########
@@ -106,6 +106,7 @@ export const useBulkClearDagRuns = ({ deselectKeys,
onSuccessConfirm }: Props) =
dagRunId: dagRun.dag_run_id,
requestBody: {
dry_run: false,
+ note: options.note ?? undefined,
Review Comment:
Worth checking the failure semantics here. The note now rides along with the
clear request, so a note that fails validation (e.g. over `max_length=1000`)
returns 422 and fails the clear for that run. The old flow cleared first, then
patched notes in a separate `Promise.allSettled`, so a bad note did not block
the clear and its error surfaced on its own. If that separation mattered, this
is a behavior change; if not, fine to drop.
--
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]