anzinmhd opened a new pull request, #75350: URL: https://github.com/apache/airflow/pull/75350
Clicking **Active Dags** on the dashboard opens the Dag list without applying the Active filter. This PR restores filtering and displays a visible, editable filter chip. ### Problem The dashboard links to `/dags?scheduling_state=active`, but the Dag list’s Paused state filter mapping ignores `active`. The list request therefore omits the scheduling-state filter and includes paused Dags. In the reproduced case: - The dashboard showed **50 Active Dags**. - Clicking the card opened **63 Dags**, with no state filter chip. - Manually selecting **Paused state → Not paused** reduced the list to **50 Dags**. Changing the dashboard link to `paused=false` would not fully resolve the mismatch: **Not paused** includes draining Dags, while the dashboard’s **Active Dags** count excludes both paused and draining Dags. ### Fix Add an **Active Dags** choice to the existing Paused state filter and support `active` throughout its URL and query mappings. The filter now: - Restores `scheduling_state=active` from the dashboard link. - Displays **Paused state: Active Dags**. - Sends `scheduling_state=active` to the existing API. - Excludes paused and draining Dags. - Allows switching between Active Dags and Not paused, or removing the filter to show all Dags. The existing Not paused, Paused, and Draining choices retain their meanings. The Active Dags label reuses the existing dashboard translation. No backend or API changes are required. ### Steps to reproduce 1. Use an Airflow instance containing both active and paused Dags. 2. Open the dashboard and note the **Active Dags** count. 3. Click **Active Dags**. 4. Compare the Dag list count with the dashboard count. 5. Inspect the Dag list request in browser DevTools. **Before:** No state filter chip appears, the request omits `scheduling_state`, and paused Dags are included. **After:** The list displays the Active Dags filter chip and sends `scheduling_state=active`. With unchanged data, its count matches the dashboard’s Active Dags count. ### Version verification - Reproduced the failure on `main`. - Manually verified the fix in Chrome: the list shows **50 Dags**, displays the Active Dags filter chip, and sends `scheduling_state=active`. - Compared with `3.4.0b1`: clicking Active Dags correctly applies **Scheduling state: Active** in the beta UI. Source inspection also confirmed that the beta forwards the filter to the API. This is a regression relative to `3.4.0b1`; the failure was not reproduced on that beta. ### Tests and validation Updated the existing filter integration test to verify that: - The dashboard URL restores the Active Dags filter chip. - Paused and draining Dags are excluded. - Switching to Not paused includes draining Dags. - Switching back to Active Dags excludes draining Dags again. - Removing the filter restores paused and draining Dags. The mock Dag-list handler now models the API’s Active filtering. Validation completed: - The Active Dags regression test fails without the production fix. - **66 tests pass** across four focused test files covering Dag filters, the Dag list, dashboard stats links, and filter URL handling. - Targeted ESLint and Prettier checks pass. - TypeScript checking passes. - The UI production build passes. - Manual Chrome verification passes. ### Before The dashboard link opens the unfiltered list. Applying Not paused manually demonstrates the missing filtering. https://github.com/user-attachments/assets/0d869073-8c19-4743-93f0-54df97217383 ### After The dashboard link applies the Active Dags filter, displays its filter chip, and sends `scheduling_state=active`. https://github.com/user-attachments/assets/78a67969-6414-4489-b156-f6c8f7cb6a21 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex (GPT-6) -- 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]
