Pushkal-Gupta opened a new pull request, #77473:
URL: https://github.com/apache/airflow/pull/77473
The run type filter on the Dag Runs list and in the grid view offers four of
the six run types. There is no way to filter for `operator_triggered` or
`asset_materialization` runs, even though the table right next to the filter
shows them.
| Run type | In the filter |
| --- | --- |
| `backfill` | yes |
| `manual` | yes |
| `scheduled` | yes |
| `operator_triggered` | no |
| `asset_triggered` | yes |
| `asset_materialization` | no |
The API accepts all six. `run_type` is validated in
`_transform_dag_run_types` with `DagRunType(run_type)`, and its error message
even spells the valid values as `', '.join(DagRunType)`. So the two values work
if you type them into the URL by hand, which is the only way to reach them
today.
Everything else for these two is already in place. `RunTypeIcon` draws an
icon for both, and `common:runTypes` has labels for both in en, so the new
options get their icon and their wording with no further change.
`operator_triggered` is not a rare run type. `/execution/dag-runs` sets it
whenever one task triggers another Dag, so any deployment using
`TriggerDagRunOperator` has these runs and cannot filter for them.
## What this changes
Two entries in `dagRunTypeOptions`, placed next to the run types they belong
with.
## The guard
`dagRunTypeOptions` is typed `Array<{ label: string; value: DagRunType |
"all" }>`, which does not make the list exhaustive, so nothing failed when the
enum grew. The new test holds it to `$DagRunType.enum` from
`openapi-gen/requests/schemas.gen.ts`, which is generated from the backend
enum, the same way `RunTypeLegend.test.tsx` holds the grid legend.
Adding a run type to the backend now fails this test until the filter
catches up.
## Verification
Reverting the two lines fails the new test, and it names
`operator_triggered` and `asset_materialization` rather than something vague.
`oxfmt --check`, `oxlint`, `eslint --quiet` and `tsc` all pass. Every test
file that touches run types or filters passes: `src/constants/`, `src/i18n/`,
`RunTypeLegend.test.tsx`, `PausedDagOptions.test.tsx` and `Gantt.test.tsx`, 44
tests. The prek hooks that apply to the two files pass, including the license
header and i18n validity checks.
No newsfragment: this is an ordinary bug fix.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes - Claude Code (Opus 5)
--
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]