Skip to content

Scope asset-wide queued event deletion to editable Dags - #74839

Merged
potiuk merged 3 commits into
apache:mainfrom
potiuk:asset-queued-events-delete-editable-dags
Oct 19, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
potiuk:asset-queued-events-delete-editable-dags

Conversation

@potiuk

@potiuk potiuk commented Oct 16, 2026

Copy link
Copy Markdown
Member

DELETE /assets/{asset_id}/queuedEvents is not tied to a single Dag, but it was guarded by a Dag-edit check that reads the Dag id from the path or, failing that, from a ?dag_id= query parameter. The route has no Dag in its path, so the check was made against whatever Dag the caller named in the query string, while the rows actually deleted were filtered by the Dags the user can read. A user with edit on one Dag and read-only on others could therefore clear the pending asset-triggered queue of the read-only Dags.

This change scopes the delete to the queued events of Dags the user may edit (EditableDagsFilterDep) and removes the Dag-level check on this asset-wide route, the same way the asset-wide GET /assets/{asset_id}/queuedEvents route relies on per-row scoping (readable Dags) rather than a request-supplied Dag id. Rows of Dags the user cannot edit are left in place; if none of the asset's queued events belong to an editable Dag, the route returns 404 as it already does when nothing matches. The per-Dag routes (/dags/{dag_id}/assets/...queuedEvents) are unchanged, since their Dag id comes from the path.

Tests: a user with edit on dag_a and read-only on dag_b deleting the asset-wide queued events (with and without ?dag_id=dag_a) leaves dag_b's row; a request where only read-only Dags have rows returns 404 and deletes nothing; and the route-dependency test now asserts that neither asset-wide queued-events route gates on a request-supplied Dag id (its suffix match previously also picked up the per-Dag route).


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Opus 5 following the guidelines

DELETE /assets/{asset_id}/queuedEvents filtered the rows it removed by the
Dags the user can read, and checked Dag edit against an optional ?dag_id=
query parameter unrelated to those rows. The delete is now limited to the
queued events of Dags the user may edit, and the route no longer makes a
Dag-level check against a request-supplied dag_id.

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Oct 16, 2026
@potiuk potiuk added the backport-to-v3-4-test Backport to v3-4-test label Oct 16, 2026
@potiuk potiuk added this to the Airflow 3.4.0 milestone Oct 16, 2026
@potiuk

potiuk commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@pierrejeambrun @vincbeck Could one of you take a look? It's targeted at 3.4.0 and needs a review to make the cut on 2026-10-19.

@potiuk
potiuk requested a review from vincbeck as a code owner October 16, 2026 05:55

@vatsrahul1001 vatsrahul1001 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The delete is now scoped per row to the Dags the user may edit, and the tests cover the edit-on-one-Dag, read-only-on-another case with and without ?dag_id=.

@vatsrahul1001

Copy link
Copy Markdown
Contributor

LGTM. Could use reviews from @pierrejeambrun @vincbeck before merging.

@potiuk
potiuk merged commit 8942dd4 into apache:main Oct 19, 2026
80 checks passed
@potiuk
potiuk deleted the asset-queued-events-delete-editable-dags branch October 19, 2026 10:44
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
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 Slack channel.

Status Branch Result
✅ v3-4-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 19, 2026
…pache#74839)

* Scope asset-wide queued event deletion to editable Dags

DELETE /assets/{asset_id}/queuedEvents filtered the rows it removed by the
Dags the user can read, and checked Dag edit against an optional ?dag_id=
query parameter unrelated to those rows. The delete is now limited to the
queued events of Dags the user may edit, and the route no longer makes a
Dag-level check against a request-supplied dag_id.

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Rename newsfragment to the PR number

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Regenerate API permission docs
(cherry picked from commit 8942dd4)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 19, 2026
…pache#74839)

* Scope asset-wide queued event deletion to editable Dags

DELETE /assets/{asset_id}/queuedEvents filtered the rows it removed by the
Dags the user can read, and checked Dag edit against an optional ?dag_id=
query parameter unrelated to those rows. The delete is now limited to the
queued events of Dags the user may edit, and the route no longer makes a
Dag-level check against a request-supplied dag_id.

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Rename newsfragment to the PR number

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Regenerate API permission docs
(cherry picked from commit 8942dd4)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
vatsrahul1001 pushed a commit that referenced this pull request Oct 19, 2026
…74839) (#75089)

* Scope asset-wide queued event deletion to editable Dags

DELETE /assets/{asset_id}/queuedEvents filtered the rows it removed by the
Dags the user can read, and checked Dag edit against an optional ?dag_id=
query parameter unrelated to those rows. The delete is now limited to the
queued events of Dags the user may edit, and the route no longer makes a
Dag-level check against a request-supplied dag_id.

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Rename newsfragment to the PR number

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Regenerate API permission docs
(cherry picked from commit 8942dd4)


Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…74839) (#75089)

* Scope asset-wide queued event deletion to editable Dags

DELETE /assets/{asset_id}/queuedEvents filtered the rows it removed by the
Dags the user can read, and checked Dag edit against an optional ?dag_id=
query parameter unrelated to those rows. The delete is now limited to the
queued events of Dags the user may edit, and the route no longer makes a
Dag-level check against a request-supplied dag_id.

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Rename newsfragment to the PR number

Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Regenerate API permission docs
(cherry picked from commit 8942dd4)


Generated-by: Claude Opus 5 following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@shahar1 shahar1 mentioned this pull request Oct 20, 2026
6 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants