choo121600 commented on code in PR #70427:
URL: https://github.com/apache/airflow/pull/70427#discussion_r3666345001
##########
airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/runOnLatestVersion.test.ts:
##########
@@ -22,11 +22,20 @@ import { getRunOnLatestVersionState } from
"./runOnLatestVersion";
describe("getRunOnLatestVersionState", () => {
it.each([
+ {
+ expectedDagVersionsDiffer: true,
+ expectedShouldShowRunOnLatestOption: false,
+ latestDagVersionNumber: 3,
+ name: "does not show when DAG versions differ but no bundle version is
present (non-versioned bundle)",
Review Comment:
We recently standardized on referring to DAG as Dag in text. Could you
update it here as well?
https://lists.apache.org/thread/0651j4vdgzmlhgndmotvznlg97kyh328
##########
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.
Review Comment:
I think we need to update this comments
##########
airflow-core/src/airflow/ui/src/components/Clear/TaskInstance/runOnLatestVersion.test.ts:
##########
@@ -22,11 +22,20 @@ import { getRunOnLatestVersionState } from
"./runOnLatestVersion";
describe("getRunOnLatestVersionState", () => {
it.each([
+ {
+ expectedDagVersionsDiffer: true,
+ expectedShouldShowRunOnLatestOption: false,
+ latestDagVersionNumber: 3,
+ name: "does not show when DAG versions differ but no bundle version is
present (non-versioned bundle)",
+ selectedDagVersionNumber: 2,
+ },
{
expectedDagVersionsDiffer: true,
expectedShouldShowRunOnLatestOption: true,
+ latestBundleVersion: "bundle-b",
latestDagVersionNumber: 3,
- name: "shows and defaults on when DAG version numbers differ",
+ name: "shows when DAG versions differ on a versioned bundle even if the
run has no recorded bundle version",
Review Comment:
Same here as well :)
--
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]