Add three-level run_on_latest_version configuration hierarchy
#61448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implements a three-level configuration hierarchy for
run_on_latest_versionto provide flexible control over bundle version selection when creating DAG runs.This PR adds:
[core] run_on_latest_versionoption inairflow.cfg@dag(run_on_latest_version=True/False)parameterThe precedence hierarchy is: DAG-level > Global config > System default (False)
Fixes #60887
Motivation
When working with bundle versioning in production, users need flexible control over which bundle version is used when creating DAG runs. Different DAGs may have different requirements:
Previously, this could only be controlled per-operation (trigger/clear). This PR enables configuration at the global and DAG levels for consistent behavior.
Implementation Details
Configuration Hierarchy
Resolution Logic
The resolution logic in
SerializedDAG._resolve_bundle_version()follows this precedence:run_on_latest_versionparameter[core] run_on_latest_versionconfigFalseUI Integration
Created a custom React hook (
useRunOnLatestVersion) that:The Clear/Rerun dialogs show a "Run on latest version" checkbox when the current run's bundle version differs from the latest available version. The checkbox's default state (checked/unchecked) is determined by the configuration hierarchy.
Screen.Recording.2026-01-30.at.14.23.09.mov
Breaking Changes
None. The system default remains
False, preserving existing behavior.Tests
Documentation
Updated
docs/administration-and-deployment/dag-bundles.rstwith:Related Issues/PRs
run_on_latest_versionbehavior on DAG clears/reruns #60887 - Global configuration for run_on_latest_versionGenerative AI Usage
Was generative AI tooling used to co-author this PR?
✅ Yes
Generated-by: Claude Sonnet 4.5 following the Airflow contribution guidelines