hkc-8010 commented on code in PR #69403:
URL: https://github.com/apache/airflow/pull/69403#discussion_r3627339897


##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -860,6 +861,43 @@ def ti_skip_downstream(
     log.info("Downstream tasks skipped", tasks_skipped=getattr(result, 
"rowcount", 0))
 
 
+@ti_id_router.patch(
+    "/{task_instance_id}/dag-run-note",
+    status_code=status.HTTP_204_NO_CONTENT,
+    responses=create_openapi_http_exception_doc(
+        [
+            (status.HTTP_404_NOT_FOUND, "Task Instance not found"),
+            (HTTP_422_UNPROCESSABLE_CONTENT, "Invalid payload for the DagRun 
note update"),
+        ]
+    ),
+)
+def update_dag_run_note(
+    task_instance_id: UUID,
+    body: DagRunNoteUpdatePayload,
+    session: SessionDep,
+) -> None:
+    """Update the note for the DagRun associated with this task instance."""
+    bind_contextvars(ti_id=str(task_instance_id))
+
+    dag_run = session.scalar(
+        select(DR)
+        .join(TI, and_(TI.dag_id == DR.dag_id, TI.run_id == DR.run_id))
+        .options(joinedload(DR.dag_run_note))
+        .where(TI.id == task_instance_id)
+    )
+    if dag_run is None:
+        raise HTTPException(
+            status_code=status.HTTP_404_NOT_FOUND,
+            detail={"reason": "not_found", "message": "Task Instance not 
found"},
+        )
+
+    if dag_run.dag_run_note is None:

Review Comment:
   Good catch. Switched the runtime endpoint to reuse `patch_dag_run_note` and 
made its attribution optional (`user_id: str | None`), so set/update/clear 
lives in one place. A runtime clear (empty or null note) now removes the 
`dag_run_note` row like the UI/public API path, instead of leaving a 
NULL-content row. Updated the three existing callers to pass 
`user_id=user.get_id()` and the clear test now asserts the row is gone.



##########
task-sdk/src/airflow/sdk/execution_time/schema/versions/v2026_06_16.py:
##########
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+In-progress supervisor schema version.
+
+New supervisor message bodies introduced in the head schema do not need 
field-level migration
+instructions for this first dated schema version.
+"""
+
+from __future__ import annotations

Review Comment:
   It is the in-progress supervisor schema version file. `UpdateDagRunNote` is 
a new body on the `ToSupervisor`/`ToManager` unions, and per `schema/AGENTS.md` 
a brand-new body needs no `VersionChange` (its head shape is the schema). But 
`check-supervisor-schemas-versions` fails when the snapshot changes and nothing 
under `versions/` is touched, so the dated file has to exist even with no 
migration instructions yet; later field-level changes to the 2026-06-16 version 
get appended here. Happy to drop it if you would rather we teach the hook to 
allow net-new bodies without a version file.



-- 
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