Show deactivated DAG state in the UI (#63800)#64374
Conversation
|
Pushed the UI update for stale DAGs. Local validation covered the new header regression test, focused eslint on the changed files, and a full UI build, so the branch now shows the deactivated state explicitly instead of active-looking controls. |
kalluripradeep
left a comment
There was a problem hiding this comment.
Good UX improvement. The e2e tests are failing on all three browsers (Chromium, Firefox, WebKit) and static checks too — probably worth investigating those before this is ready to merge.
610738d to
e209c4d
Compare
|
Validation update after rebasing this PR on
On the last failing run before this push, the browser e2e failures were in |
|
Follow-up after investigating the current failing checks:
Local validation rerun on this head:
I force-pushed the existing PR branch so CI reruns on this narrower behavior. The previous Chromium / Firefox failures were still broad ( |
|
Quick CI follow-up: on the last run after the UI fix, I checked the WebKit log before rerunning. The remaining failures were in |
There was a problem hiding this comment.
Should we also hide the 'trigger dag button' ? The description mentions that but isn't actually implementing it.
Suggestion: Header Actions Not Addressed
For a stale DAG, the header still shows Parse DAG and Delete DAG buttons. "Parse" in particular is misleading for a stale DAG (the file doesn't exist anymore). The PR should consider hiding or disabling ParseDagButton for stale DAGs as well, since parsing a DAG that has no source file doesn't make sense.
Suggestion: DAGs List Page isn't addressed and other TogglePause places too
| if (!dag?.is_stale) { | ||
| stats.splice(2, 0, { | ||
| label: translate("dagDetails.nextRun"), | ||
| value: Boolean(dag?.next_dagrun_run_after) ? ( | ||
| <DagRunInfo | ||
| logicalDate={dag?.next_dagrun_logical_date} | ||
| runAfter={dag?.next_dagrun_run_after as string} | ||
| /> | ||
| ) : undefined, | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
you can just use the spread operator her to not have to splice. ...(!dag?.is_stale: [], [])
|
Addressed the review points on this branch:
I kept the code change scoped to the stale DAG detail/header path from the original issue report rather than broadening this PR into the DAG list views. Local validation on this head:
Pushed in |
There was a problem hiding this comment.
Pull request overview
This PR makes “stale/deactivated” DAGs explicit in the UI by adding a deactivated badge and hiding controls/stats that imply the DAG is still schedulable.
Changes:
- Added a reusable
DagDeactivatedBadgecomponent and corresponding i18n string. - Updated the DAG header and breadcrumb to show the badge and hide pause/parse/next-run UI for stale DAGs.
- Added a regression test for stale DAG behavior in the DAG header.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx | Conditionally hides “Next run” and parse action for stale DAGs; shows deactivated badge instead of pause toggle. |
| airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx | Adds a regression test for stale DAG UI behavior in the header. |
| airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx | Removes run-after date filter local-storage state/props; simplifies useLocalStorage typing usage. |
| airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx | Shows deactivated badge in breadcrumb for stale DAGs instead of pause toggle. |
| airflow-core/src/airflow/ui/src/components/DagDeactivatedBadge.tsx | Introduces new badge component backed by i18n key. |
| airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json | Adds the “Deactivated” label under header.status.deactivated. |
|
Pushed a follow-up on top of the earlier review pass. The main fix here was restoring the |
pierrejeambrun
left a comment
There was a problem hiding this comment.
That's a nice addition. We should probably gray out the 'trigger' button too but that's not straightforward since we do not have that information at the DetailsLayout level.
ca3e5c2 to
4469eb7
Compare
|
I just rebased the branch to remove unrelated CI failure. Can you fix the formatting for: (and double check lint UI) const nextRunStat =
- isStale
- ? []
- : [
- {
- label: translate("dagDetails.nextRun"),
- value: Boolean(dag?.next_dagrun_run_after) ? (
- <DagRunInfo
- logicalDate={dag?.next_dagrun_logical_date}
- runAfter={dag?.next_dagrun_run_after as string}
- />
- ) : undefined,
- },
- ];
+ const nextRunStat = isStale
+ ? []
+ : [
+ {
+ label: translate("dagDetails.nextRun"),
+ value: Boolean(dag?.next_dagrun_run_after) ? (
+ <DagRunInfo
+ logicalDate={dag?.next_dagrun_logical_date}
+ runAfter={dag?.next_dagrun_run_after as string}
+ />
+ ) : undefined,
+ },
+ ];CI is complaining |

Summary
When a DAG becomes stale or deactivated, the UI still shows active-oriented controls like the pause toggle, parse action, and next-run information. This change makes the deactivated state explicit by showing a badge and hiding controls or stats that imply the DAG is still schedulable.
Changes
airflow-core/src/airflow/ui/src/components/DagDeactivatedBadge.tsx-- added a reusable badge component for stale/deactivated DAGs.airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx-- shows the deactivated badge for stale DAGs, hides the misleading next-run stat, and removes the parse action for stale DAGs.airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx-- shows the deactivated badge in the breadcrumb instead of the pause toggle for stale DAGs.airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json-- adds the deactivated badge label.airflow-core/src/airflow/ui/src/pages/Dag/Header.test.tsx-- adds a regression test covering the stale DAG header behavior, including hiding the stale-only parse action.Test plan
npm run test -- Header.test.tsxnpx eslint src/components/DagDeactivatedBadge.tsx src/pages/Dag/Header.tsx src/layouts/Details/DagBreadcrumb.tsx src/layouts/Details/DetailsLayout.tsx src/pages/Dag/Header.test.tsxEvidence it works
2 passedtest files and3 passedtests, including the stale-DAG regression that now verifies the parse action is hidden.Fixes #63800