This is an automated email from the ASF dual-hosted git repository.

uranusjr 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 6c649aefd2 Clarify new_state in OpenAPI spec (#34056)
6c649aefd2 is described below

commit 6c649aefd2dccbc1765c077c5154c7edf384caeb
Author: Pierre Jeambrun <pierrejb...@gmail.com>
AuthorDate: Mon Sep 4 08:56:19 2023 +0200

    Clarify new_state in OpenAPI spec (#34056)
---
 airflow/api_connexion/openapi/v1.yaml        | 27 +++++++++++++++------------
 airflow/www/static/js/types/api-generated.ts | 23 +++++++++++++----------
 2 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/airflow/api_connexion/openapi/v1.yaml 
b/airflow/api_connexion/openapi/v1.yaml
index 918b802594..af9d0cf8a4 100644
--- a/airflow/api_connexion/openapi/v1.yaml
+++ b/airflow/api_connexion/openapi/v1.yaml
@@ -4292,12 +4292,7 @@ components:
           type: boolean
 
         new_state:
-          description: Expected new state.
-          type: string
-          enum:
-            - success
-            - failed
-            - skipped
+          $ref: '#/components/schemas/UpdateTaskState'
 
     UpdateTaskInstance:
       type: object
@@ -4310,12 +4305,7 @@ components:
           default: false
 
         new_state:
-          description: Expected new state.
-          type: string
-          enum:
-            - success
-            - failed
-            - skipped
+          $ref: '#/components/schemas/UpdateTaskState'
 
     SetTaskInstanceNote:
       type: object
@@ -4696,6 +4686,19 @@ components:
         - removed
         - restarting
 
+
+    UpdateTaskState:
+      description: |
+        Expected new state. Only a subset of TaskState are available.
+
+        Other states are managed directly by the scheduler or the workers and 
cannot be updated manually through the REST API.
+
+      type: string
+      enum:
+        - success
+        - failed
+        - skipped
+
     DagState:
       description: |
         DAG State.
diff --git a/airflow/www/static/js/types/api-generated.ts 
b/airflow/www/static/js/types/api-generated.ts
index 8dead88fc7..9b86f9c575 100644
--- a/airflow/www/static/js/types/api-generated.ts
+++ b/airflow/www/static/js/types/api-generated.ts
@@ -1897,11 +1897,7 @@ export interface components {
       include_future?: boolean;
       /** @description If set to True, also tasks from past DAG Runs are 
affected. */
       include_past?: boolean;
-      /**
-       * @description Expected new state.
-       * @enum {string}
-       */
-      new_state?: "success" | "failed" | "skipped";
+      new_state?: components["schemas"]["UpdateTaskState"];
     };
     UpdateTaskInstance: {
       /**
@@ -1911,11 +1907,7 @@ export interface components {
        * @default false
        */
       dry_run?: boolean;
-      /**
-       * @description Expected new state.
-       * @enum {string}
-       */
-      new_state?: "success" | "failed" | "skipped";
+      new_state?: components["schemas"]["UpdateTaskState"];
     };
     SetTaskInstanceNote: {
       /** @description The custom note to set for this Task Instance. */
@@ -2181,6 +2173,14 @@ export interface components {
           | "restarting"
         )
       | null;
+    /**
+     * @description Expected new state. Only a subset of TaskState are 
available.
+     *
+     * Other states are managed directly by the scheduler or the workers and 
cannot be updated manually through the REST API.
+     *
+     * @enum {string}
+     */
+    UpdateTaskState: "success" | "failed" | "skipped";
     /**
      * @description DAG State.
      *
@@ -4882,6 +4882,9 @@ export type CollectionInfo = CamelCasedPropertiesDeep<
 export type TaskState = CamelCasedPropertiesDeep<
   components["schemas"]["TaskState"]
 >;
+export type UpdateTaskState = CamelCasedPropertiesDeep<
+  components["schemas"]["UpdateTaskState"]
+>;
 export type DagState = CamelCasedPropertiesDeep<
   components["schemas"]["DagState"]
 >;

Reply via email to