luc-pimentel opened a new pull request, #76259:
URL: https://github.com/apache/airflow/pull/76259

   A code-only change to a Dag advances a versioned bundle to a new commit 
without changing the serialized Dag, so the Dag processor reuses the existing 
Dag version and refreshes its `bundle_version` in place (#68336). Runs created 
before that stay pinned to the earlier commit in `DagRun.bundle_version`, but 
the dag-run, task-instance, task-try and grid responses read the commit from 
the version row. A run that executed commit A reports commit B under 
`dag_versions`, and its source link points at code it never ran.
   
   The responses now follow the run, the way #71425 and #73915 did for clearing 
and task callbacks: the version a pinned run was created with is reported with 
the run's own `bundle_version` and a URL rendered for that commit, through a 
new `DagVersion.bundle_url_for`. Every other version, and every version of an 
unpinned run, keeps the row's values, so a task left on another version by a 
clear keeps its row too. There is no schema change, no migration and no new 
query; the override keys on `created_dag_version_id`. The trade is that the 
same version id reports commit A on the run and commit B on `GET /dagVersions`. 
The write path and the 404 when triggering at a refreshed-away commit are left 
to the Dag version pinning work (AIP-109, #76041).
   
   Tested with a git bundle on main: commit A, parse, trigger a run; commit B 
changing only the task body, parse. Before, `GET 
/dags/{dag_id}/dagRuns/{run_id}` reported `dag_versions[0].bundle_version` B 
for the run pinned to A; after, A. Same after a third commit that adds a task, 
with a run at B as the control. The new API tests cover the dag-run get and 
list, task-instance get and list, the archived try and the grid runs, each red 
on main, plus the unpinned run, a task on another version and a bundle without 
a URL template; unit tests cover `bundle_url_for`.
   
   related: #73861
   related: #76041
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes - Claude Code (claude-fable-5-1)
   
   Generated-by: Claude Code (claude-fable-5-1) 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