pierrejeambrun commented on code in PR #70427:
URL: https://github.com/apache/airflow/pull/70427#discussion_r3665687490
##########
airflow-core/src/airflow/ui/src/components/Clear/Run/ClearRunDialog.tsx:
##########
@@ -91,14 +92,16 @@ const ClearRunDialog = ({ dagRun, onClose, open }: Props)
=> {
onSuccessConfirm: handleClose,
});
- // Check if DAG versions differ (works for both bundle-versioned and local
bundles)
- const latestDagVersionNumber =
dagDetails?.latest_dag_version?.version_number;
- const dagRunVersionNumber = dagRun.dag_versions.at(-1)?.version_number;
- const versionsDiffer =
- latestDagVersionNumber !== undefined &&
- dagRunVersionNumber !== undefined &&
- latestDagVersionNumber !== dagRunVersionNumber;
- const shouldShowBundleVersionOption = versionsDiffer && !onlyNew;
+ // Non-versioned bundles (e.g. LocalDagBundle) always leave bundle_version
null and
+ // resolve to the latest serialized Dag at run time, so "run on latest" is a
no-op there.
+ // Only offer it when the run is pinned to an older bundle version, where it
actually changes the outcome.
+ const { shouldShowRunOnLatestOption } = getRunOnLatestVersionState({
+ latestBundleVersion: dagDetails?.bundle_version,
+ latestDagVersionNumber: dagDetails?.latest_dag_version?.version_number,
+ selectedBundleVersion: dagRun.dag_versions.at(-1)?.bundle_version,
Review Comment:
Shouldn't we use `dagRun.bundle_version` direcly here?
--
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]