nathadfield commented on code in PR #63884:
URL: https://github.com/apache/airflow/pull/63884#discussion_r3228459117
##########
airflow-core/src/airflow/config_templates/config.yml:
##########
@@ -517,6 +517,19 @@ core:
type: boolean
example: ~
default: "False"
+ rerun_with_latest_version:
+ description: |
+ Default value for whether cleared, rerun, or backfilled tasks should
use
+ the latest bundle version. When set to True, reruns and backfills pick
up
+ the latest code. When set to False, they use the original bundle
version.
+ When unset, the fallback depends on the call site: False for clearing
or
+ rerunning tasks, True for creating backfills (preserving the historical
+ defaults for each). Individual DAGs can override this with the
+ ``rerun_with_latest_version`` parameter.
+ type: boolean
+ example: ~
+ default: ~
Review Comment:
@ephraimbuddy Good point on `has_option` being a footgun for boolean
configs. A cleaner alternative if we want to address this properly would be a
tri-state string `("auto" | "true" | "false")` where `"auto"` is the explicit
"no global default, let the call site decide" value:
```
rerun_with_latest_version:
type: string
default: "auto"
value = conf.get("core", "rerun_with_latest_version", fallback="auto")
if value == "auto":
return fallback
return value.lower() == "true"
```
That removes the `has_option`-on-boolean pattern entirely and makes "no
global default" a first-class enum value. **Trade-off**: the option is no
longer a boolean type, so the UI endpoint surfaces three states and the hook
handles them. Happy to switch to this if you'd prefer — let me know.
--
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]