You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/06/03 09:53:51 UTC

[PR] API: Add bulk update to mark Dag runs as success/failed [airflow]

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

   Implements the `update` action of the bulk Dag-run endpoint (`PATCH /dags/{dag_id}/dagRuns`) so multiple Dag runs can be marked as `success` / `failed` / `queued` in a single request, instead of one PATCH per run. Previously this action returned 405 ("not supported").
   
   This is the **backend** for issue #63854 (bulk "mark as" for Dag runs); the UI wiring will follow in a separate PR.
   
   What changed:
   - `BulkDAGRunBody` gains `state` (`DagRunMutableStates`) and an optional `note`.
   - `BulkDagRunService.handle_bulk_update` resolves each `(dag_id, run_id)`, then calls `set_dag_run_state_to_success/failed/queued` (and fires the `on_dag_run_success/failed` listener hooks), mirroring the single-run `PATCH`. The optional note is applied per run.
   - Route passes `dag_bag` + `user` into the service.
   - Regenerated OpenAPI spec, UI client, and airflow-ctl datamodels for the schema change.
   
   Behavior notes:
   - **Per-entity partial success** via `BulkResponse` (each run independently succeeds or errors), matching the existing bulk task-instance update — deliberately not atomic. A missing run is a 404 entry; an entity with no target `state` is a 400 entry.
   - Single bulk call, no per-run fan-out. Authorization reuses `requires_access_dag_run_bulk` (maps the update action to `PUT` per dag).
   
   related: #63854
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] API: Add bulk update to mark Dag runs as success/failed [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi merged PR #67948:
URL: https://github.com/apache/airflow/pull/67948


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] API: Add bulk update to mark Dag runs as success/failed [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #67948:
URL: https://github.com/apache/airflow/pull/67948#discussion_r3374219096


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -104,21 +98,20 @@
 from airflow.api_fastapi.core_api.services.public.dag_run import (
     BulkDagRunService,
     DagRunWaiter,
+    _patch_dag_run_note,
+    _patch_dag_run_state,

Review Comment:
   ```suggestion
       patch_dag_run_note,
       patch_dag_run_state,
   ```
   
   These aren't private functions anymore are they?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] API: Add bulk update to mark Dag runs as success/failed [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #67948:
URL: https://github.com/apache/airflow/pull/67948#issuecomment-4652423077

   ### Backport failed to create: airflow-ctl/v0-1-test. View the failure log <a href='https://github.com/apache/airflow/actions/runs/27160118349'> Run details </a>
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
   
   In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
       <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>❌</td>
           <td>airflow-ctl/v0-1-test</td>
           <td><a href="https://github.com/apache/airflow/commit/fe92cfd4e01d17bdfcb76d6a2a229a4f1a2c50f3"><img src='https://img.shields.io/badge/Commit-fe92cfd-red' alt='Commit Link'></a></td>
       </tr>
   </table>
   
   You can attempt to backport this manually by running:
   
   ```bash
   cherry_picker fe92cfd airflow-ctl/v0-1-test
   ```
   
   This should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking
   the files that need manual conflict resolution.
   
   After you have resolved the conflicts, you can continue the backport process by running:
   
   ```bash
   cherry_picker --continue
   ```
   
   If you don't have cherry-picker installed, see the [installation guide](https://github.com/apache/airflow/blob/main/dev/README.md#how-to-backport-pr-with-cherry-picker-cli).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org