dheerajturaga opened a new pull request, #73915:
URL: https://github.com/apache/airflow/pull/73915

   <!-- SPDX-License-Identifier: Apache-2.0
        https://www.apache.org/licenses/LICENSE-2.0 -->
   
   A change to a task callable can advance a versioned bundle without changing 
the
   serialized Dag. Airflow then reuses the Dag-version record and updates its 
bundle
   metadata, while existing runs remain pinned to their original bundle.
   
   Task Clear compared that mutable version record with the latest bundle, 
hiding
   “Run with latest bundle version” even when the run would execute historical 
code.
   For queued and running runs, an explicit `run_on_latest_version=true` could 
also
   leave the old bundle selected because the Dag-version ID had not changed.
   
   This change:
   
   - Compares the parent run's bundle in task Clear, including mapped tasks, and
     waits for run and Dag metadata before allowing confirmation.
   - Repins queued and running runs when the user requests the latest version,
     including when only the bundle has changed. Clearing with `false` 
continues to
     preserve the historical bundle.
   - Uses `DagRun.bundle_version` for scheduler task and email callbacks, 
matching
     task workload selection for both pinned and unpinned runs.
   
   Structural Dag-version reuse is preserved. The UI uses its existing run 
query;
   no API schema change or database migration is required.
   
   Validation:
   
   - Focused backend regressions: 26 passed; before the fix, 9 failed and 17 
passed.
   - Full clear, workload, task API, and scheduler test files: 916 passed, 4 
skipped
     (two require database locking support and two are marked long-running).
   - Clear UI suite: 32 passed. The four new dialog cases failed before the fix.
   - Fast and manual checks passed, including Ruff, mypy, UI lint/type checks, 
and
     the production UI build.
   
   Backend tests ran in Breeze with Python 3.10 and SQLite. UI tests render the
   dialog with mocked API responses; no live Git worker deployment was 
exercised.
   
   Related: #71425 and #72370. The active-run repinning change follows the 
approach
   in #71425; this PR also fixes task Clear visibility and scheduler callbacks 
when
   the historical and latest bundles are different non-null versions. #72370
   addresses the unpinned email case.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Codex (GPT-6)
   
   Generated-by: Codex (GPT-6) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   Drafted-by: Codex (GPT-6); reviewed by @dheerajturaga before posting
   


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