dheerajturaga opened a new pull request, #73055:
URL: https://github.com/apache/airflow/pull/73055

   Adds a way to pause or drain several Dags at once from the Dags list table 
view: select rows with the new checkbox column, then trigger the bulk action 
once. If any selected Dag has unfinished runs, the drain-vs-pause choice is 
shown a single time for the whole batch instead of once per Dag.
   
   Depends on #72407 (draining state), which hasn't merged yet — draining 
introduced the per-Dag choice this bulk action collapses back down to one click 
for a whole selection. Until #72407 merges, this PR's diff includes its changes 
too; it will shrink automatically to just this PR's commit once #72407 lands on 
`main`.
   
   - New `PATCH /dags/bulk` endpoint (`BulkDAGBody` + `BulkDagService` + 
`requires_access_dag_bulk`), following the same `Bulk*` pattern already used 
for Task Instances, Dag Runs, Variables, Connections, and Pools.
   - Row selection + bulk action bar on the Dags list table view, reusing the 
existing `useRowSelection`/`SelectionProvider`/`ActionBar` primitives from Task 
Instances and Dag Runs.
   - The pause-vs-drain choice dialog is extracted out of the single-Dag 
`TogglePause` toggle into a shared `PauseOrDrainChoiceModal`, so both flows 
show identical behavior/copy.
   - Two incidental doc-generation script fixes surfaced by the new permission 
dependency: `extract_permissions.py` needed a resource mapping for 
`requires_access_dag_bulk`, and `fab_permissions_doc.py` had a gap where a 
bare-`DAG`-resource bulk permission (no explicit HTTP method) defaulted to the 
wrong FAB action.
   
   ## Test plan
   
   - [x] Backend: `TestBulkDags` in `test_dags.py` — bulk pause, bulk drain, 
legacy `is_paused`, missing-id fail/skip semantics, unsupported create/delete, 
401/403, and per-Dag authorization rejection. Full `test_dags.py` suite passes 
(153 passed, 6 pre-existing skips).
   - [x] Frontend: new bulk-selection test in `DagsList.test.tsx`; 
`TogglePause.test.tsx` passes unchanged, confirming the extracted choice dialog 
is behavior-preserving.
   - [x] `prek run --stage pre-commit` passes with 0 failures (includes mypy, 
ruff, the regenerated OpenAPI spec/TS client, and the regenerated 
permission-reference docs).
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Sonnet 5
   
   Generated-by: Claude Sonnet 5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01QEsvWxemkjXqw7GE69YLPk


-- 
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]

Reply via email to