This is an automated email from the ASF dual-hosted git repository.
choo121600 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 8a1cef4242f UI: Offer every run type the API accepts in the run type
filter (#77473)
8a1cef4242f is described below
commit 8a1cef4242f0577126ea0035d49d41292b5460a0
Author: Pushkal Gupta <[email protected]>
AuthorDate: Wed Nov 25 19:48:31 2026 +0530
UI: Offer every run type the API accepts in the run type filter (#77473)
---
.../airflow/ui/src/constants/stateOptions.test.ts | 35 ++++++++++++++++++++++
.../src/airflow/ui/src/constants/stateOptions.ts | 2 ++
2 files changed, 37 insertions(+)
diff --git a/airflow-core/src/airflow/ui/src/constants/stateOptions.test.ts
b/airflow-core/src/airflow/ui/src/constants/stateOptions.test.ts
new file mode 100644
index 00000000000..b99035ea7e2
--- /dev/null
+++ b/airflow-core/src/airflow/ui/src/constants/stateOptions.test.ts
@@ -0,0 +1,35 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { describe, expect, it } from "vitest";
+
+import { $DagRunType } from "openapi/requests/schemas.gen";
+
+import { dagRunTypeOptions } from "./stateOptions";
+
+describe("dagRunTypeOptions", () => {
+ it("offers every run type the API accepts as a filter", () => {
+ // The run_type filter sends these values straight to the API, which
validates them against
+ // DagRunType. A run type missing here is one nobody can filter for, even
though the list it
+ // filters shows those runs. `Array<...>` is not exhaustive on its own, so
tsc cannot see this.
+ const offered = dagRunTypeOptions.items.map((option) => option.value);
+ const missing = $DagRunType.enum.filter((runType) =>
!offered.includes(runType));
+
+ expect(missing).toEqual([]);
+ });
+});
diff --git a/airflow-core/src/airflow/ui/src/constants/stateOptions.ts
b/airflow-core/src/airflow/ui/src/constants/stateOptions.ts
index f9237e1f221..63e3903039a 100644
--- a/airflow-core/src/airflow/ui/src/constants/stateOptions.ts
+++ b/airflow-core/src/airflow/ui/src/constants/stateOptions.ts
@@ -78,6 +78,8 @@ export const dagRunTypeOptions = createListCollection({
{ label: "common:runTypes.backfill", value: "backfill" },
{ label: "common:runTypes.manual", value: "manual" },
{ label: "common:runTypes.scheduled", value: "scheduled" },
+ { label: "common:runTypes.operator_triggered", value: "operator_triggered"
},
{ label: "common:runTypes.asset_triggered", value: "asset_triggered" },
+ { label: "common:runTypes.asset_materialization", value:
"asset_materialization" },
],
});