Skip to content

Add reparse button to the Dag import errors modal - #72896

Merged
bbovenzi merged 7 commits into
apache:mainfrom
astronomer:add-reparse-to-import-errors
Sep 23, 2026
Merged

bbovenzi merged 7 commits into
apache:mainfrom
astronomer:add-reparse-to-import-errors

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Adds a reparse action next to each file in the Dag import errors modal, so a file that failed to parse can be retried in place, instead of waiting for the next scheduled parse or reparsing the file from elsewhere after fixing it.

A file with an import error has no registered Dag, so the reparse endpoint had no per-Dag key to authorize the request against and returned 404. Reparsing an errored file is now gated on the dedicated REPARSE_ALL permission (admin-by-default, scoped to the file's team via its bundle) added in #73274 — a write permission of its own, so being able to view import errors does not grant the reparse action. ImportErrorResponse exposes the file_token the button needs to call the existing reparse endpoint.

closes: #72038

related: #72039 — an earlier, still-open draft for the same issue.

Screenshots

Reparse button in the import errors modal:

Reparse button in the Dag import errors modal

Tooltip on hover:

Reparse Dag tooltip


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

Comment thread airflow-core/src/airflow/api_fastapi/core_api/security.py
@pierrejeambrun
pierrejeambrun force-pushed the add-reparse-to-import-errors branch 4 times, most recently from bc1b3ce to 6e0088c Compare September 16, 2026 15:27
@pierrejeambrun
pierrejeambrun force-pushed the add-reparse-to-import-errors branch 2 times, most recently from a61c88d to b805b3c Compare September 17, 2026 11:34
@pierrejeambrun

pierrejeambrun commented Sep 17, 2026 •

Copy link
Copy Markdown
Member Author

First two commits are not relevant and coming from #73274

The import errors modal lists files that failed to parse but gave no way to retry them; users had to wait for the next scheduled parse or trigger a reparse elsewhere after fixing the file. Surfacing a reparse action next to each failed file lets them retry from the same place they see the error.
Reparsing a file with no registered Dag now returns 403 instead of 404 when
the caller lacks the new REPARSE_ALL permission -- an observable behaviour
change that warrants a release note.
@pierrejeambrun
pierrejeambrun force-pushed the add-reparse-to-import-errors branch from b805b3c to 59438c3 Compare September 17, 2026 14:29
@bbovenzi bbovenzi added this to the Airflow 3.4.0 milestone Sep 18, 2026
Comment thread airflow-core/src/airflow/api_fastapi/core_api/security.py Outdated
Comment thread airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DagImportErrorsModal.tsx Outdated
@bbovenzi bbovenzi added the area:UI Related to UI/UX. For Frontend Developers. label Sep 18, 2026
@bbovenzi bbovenzi added the area:API Airflow's REST/HTTP API label Sep 18, 2026
The two-step check on a file with no registered Dag returned 404 for a file
Airflow had never heard of and 403 for one with an import error, so an
unauthorized caller could tell them apart. Auth runs first, and the existence
probe now serves only its own purpose (an authorized caller against a stale
file). The dashboard modal also invalidates the import-errors and DAG-stats
queries on a successful reparse, so a fixed error disappears from the list
and the resolved Dag shows up in the stats without a manual refresh.
Reparse is asynchronous: the endpoint inserts a DagPriorityParsingRequest row
and returns, and the dag processor picks it up on its next cycle. Invalidating
the modal, dashboard, and Dags-table queries the instant the mutation resolves
refetches against a DB the processor has not touched yet, so every refetch
returns the same rows and only marks the queries fresh again. The toast is the
honest signal that the reparse has been queued.
Reparse enqueues a DagPriorityParsingRequest and returns; the dag processor
picks it up on its next cycle. Nothing tells the modal when that happens, so
a user watching the list has no way to see the row disappear without closing
and reopening the modal. Polling on the same auto-refresh cadence the dashboard
cards use closes that gap. Polling only starts once a reparse has been issued
in this modal session, so a modal that is opened and never mutated hits the
endpoint no more than it did before, and it stops when the modal is closed.
@bbovenzi
bbovenzi merged commit 938a9d1 into apache:main Sep 23, 2026
156 checks passed
@bbovenzi
bbovenzi deleted the add-reparse-to-import-errors branch September 23, 2026 17:37
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 area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the reparse button to dag import errors

2 participants