diff --git a/backend/Cargo.lock b/backend/Cargo.lock index ed96910bb0..a8d925377a 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -9293,6 +9293,7 @@ dependencies = [ name = "windmill-git-sync" version = "1.265.3" dependencies = [ + "regex", "rsmq_async", "serde", "serde_json", diff --git a/backend/migrations/20240209144358_git_sync_regexp_and_type.down.sql b/backend/migrations/20240209144358_git_sync_regexp_and_type.down.sql new file mode 100644 index 0000000000..d2f607c5b8 --- /dev/null +++ b/backend/migrations/20240209144358_git_sync_regexp_and_type.down.sql @@ -0,0 +1 @@ +-- Add down migration script here diff --git a/backend/migrations/20240209144358_git_sync_regexp_and_type.up.sql b/backend/migrations/20240209144358_git_sync_regexp_and_type.up.sql new file mode 100644 index 0000000000..825222b778 --- /dev/null +++ b/backend/migrations/20240209144358_git_sync_regexp_and_type.up.sql @@ -0,0 +1,13 @@ +-- Add up migration script here +UPDATE workspace_settings SET git_sync = ( + CASE + WHEN git_sync is null THEN null + WHEN git_sync = '[]'::jsonb THEN null + ELSE jsonb_build_object( + 'repositories', git_sync, + 'include_path', '["f/**"]'::jsonb, + 'include_type', '["script", "flow", "app", "folder"]'::jsonb + + ) + END +); diff --git a/backend/windmill-api/openapi-deref.yaml b/backend/windmill-api/openapi-deref.yaml index f01b3b9c8c..5c608c0968 100644 --- a/backend/windmill-api/openapi-deref.yaml +++ b/backend/windmill-api/openapi-deref.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 1.259.1 + version: 1.265.3 title: Windmill API contact: name: Windmill Team @@ -87,7 +87,7 @@ paths: - name: id in: path required: true - schema: &ref_25 + schema: &ref_24 type: integer responses: '200': @@ -231,34 +231,34 @@ paths: - name: before description: filter on created before (exclusive) timestamp in: query - schema: &ref_103 + schema: &ref_102 type: string format: date-time - name: after description: filter on created after (exclusive) timestamp in: query - schema: &ref_102 + schema: &ref_101 type: string format: date-time - name: username description: filter on exact username of user in: query - schema: &ref_104 + schema: &ref_103 type: string - name: operation description: filter on exact or prefix name of operation in: query - schema: &ref_105 + schema: &ref_104 type: string - name: resource description: filter on exact or prefix name of resource in: query - schema: &ref_106 + schema: &ref_105 type: string - name: action_kind description: filter on type of operation in: query - schema: &ref_107 + schema: &ref_106 type: string enum: - Create @@ -290,12 +290,12 @@ paths: application/json: schema: type: object - properties: &ref_120 + properties: &ref_119 email: type: string password: type: string - required: &ref_121 + required: &ref_120 - email - password responses: @@ -351,14 +351,14 @@ paths: application/json: schema: type: object - properties: &ref_122 + properties: &ref_121 email: type: string username: type: string is_admin: type: boolean - required: &ref_123 + required: &ref_122 - email - username - is_admin @@ -393,7 +393,7 @@ paths: application/json: schema: type: object - properties: &ref_124 + properties: &ref_123 is_admin: type: boolean operator: @@ -421,7 +421,7 @@ paths: - name: path in: path required: true - schema: &ref_18 + schema: &ref_17 type: string responses: '200': @@ -616,7 +616,7 @@ paths: application/json: schema: type: object - properties: &ref_152 + properties: &ref_151 email: type: string workspaces: @@ -634,7 +634,7 @@ paths: - id - name - username - required: &ref_153 + required: &ref_152 - email - workspaces /workspaces/list_as_superadmin: @@ -676,14 +676,14 @@ paths: application/json: schema: type: object - properties: &ref_154 + properties: &ref_153 id: type: string name: type: string username: type: string - required: &ref_155 + required: &ref_154 - id - name - username @@ -1124,7 +1124,7 @@ paths: type: string usage: type: object - properties: &ref_119 + properties: &ref_118 executions: type: number required: &ref_9 @@ -1532,19 +1532,35 @@ paths: public_resource: type: boolean git_sync: - type: array - items: - type: object - properties: &ref_16 - script_path: + type: object + properties: &ref_16 + include_path: + type: array + items: type: string - git_repo_resource_path: + include_type: + type: array + items: type: string - use_individual_branch: - type: boolean - required: &ref_17 - - script_path - - git_repo_resource_path + enum: + - script + - flow + - app + - folder + repositories: + type: array + items: + type: object + properties: &ref_174 + script_path: + type: string + git_repo_resource_path: + type: string + use_individual_branch: + type: boolean + required: &ref_175 + - script_path + - git_repo_resource_path default_app: type: string required: @@ -1904,11 +1920,8 @@ paths: type: object properties: git_sync_settings: - type: array - items: - type: object - properties: *ref_16 - required: *ref_17 + type: object + properties: *ref_16 responses: '200': description: status @@ -2038,7 +2051,7 @@ paths: application/json: schema: type: object - properties: &ref_127 + properties: &ref_126 label: type: string expiration: @@ -2068,7 +2081,7 @@ paths: application/json: schema: type: object - properties: &ref_128 + properties: &ref_127 label: type: string expiration: @@ -2076,7 +2089,7 @@ paths: format: date-time impersonate_email: type: string - required: &ref_129 + required: &ref_128 - impersonate_email responses: '201': @@ -2124,7 +2137,7 @@ paths: type: array items: type: object - properties: &ref_125 + properties: &ref_124 label: type: string expiration: @@ -2142,7 +2155,7 @@ paths: type: array items: type: string - required: &ref_126 + required: &ref_125 - token_prefix - created_at - last_used_at @@ -2191,7 +2204,7 @@ paths: application/json: schema: type: object - properties: &ref_132 + properties: &ref_131 path: type: string value: @@ -2204,7 +2217,7 @@ paths: type: integer is_oauth: type: boolean - required: &ref_133 + required: &ref_132 - path - value - is_secret @@ -2255,7 +2268,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: variable deleted @@ -2277,7 +2290,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: already_encrypted in: query schema: @@ -2289,7 +2302,7 @@ paths: application/json: schema: type: object - properties: &ref_134 + properties: &ref_133 path: type: string value: @@ -2319,7 +2332,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: decrypt_secret description: | ask to decrypt secret if this variable is secret @@ -2341,7 +2354,7 @@ paths: application/json: schema: type: object - properties: &ref_19 + properties: &ref_18 workspace_id: type: string path: @@ -2368,7 +2381,7 @@ paths: type: boolean is_refreshed: type: boolean - required: &ref_20 + required: &ref_19 - workspace_id - path - is_secret @@ -2387,7 +2400,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: variable @@ -2409,7 +2422,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: variable @@ -2437,8 +2450,8 @@ paths: type: array items: type: object - properties: *ref_19 - required: *ref_20 + properties: *ref_18 + required: *ref_19 /w/{workspace}/variables/list_contextual: get: summary: list contextual variables @@ -2459,14 +2472,14 @@ paths: type: array items: type: object - properties: &ref_130 + properties: &ref_129 name: type: string value: type: string description: type: string - required: &ref_131 + required: &ref_130 - name - value - description @@ -2481,7 +2494,7 @@ paths: - name: client_name in: path required: true - schema: &ref_21 + schema: &ref_20 type: string requestBody: description: Partially filled script @@ -2554,7 +2567,7 @@ paths: - name: client_name in: path required: true - schema: *ref_21 + schema: *ref_20 requestBody: description: code endpoint required: true @@ -2577,7 +2590,7 @@ paths: application/json: schema: type: object - properties: &ref_168 + properties: &ref_167 access_token: type: string expires_in: @@ -2588,7 +2601,7 @@ paths: type: array items: type: string - required: &ref_169 + required: &ref_168 - access_token /w/{workspace}/oauth/create_account: post: @@ -2639,7 +2652,7 @@ paths: - name: id in: path required: true - schema: &ref_22 + schema: &ref_21 type: integer requestBody: description: variable path @@ -2674,7 +2687,7 @@ paths: - name: id in: path required: true - schema: *ref_22 + schema: *ref_21 responses: '200': description: disconnected client @@ -2766,7 +2779,7 @@ paths: application/json: schema: type: object - properties: &ref_137 + properties: &ref_136 path: type: string value: {} @@ -2774,7 +2787,7 @@ paths: type: string resource_type: type: string - required: &ref_138 + required: &ref_137 - path - value - resource_type @@ -2799,7 +2812,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: resource deleted @@ -2821,7 +2834,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 requestBody: description: updated resource required: true @@ -2829,7 +2842,7 @@ paths: application/json: schema: type: object - properties: &ref_139 + properties: &ref_138 path: type: string description: @@ -2856,7 +2869,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 requestBody: description: updated resource required: true @@ -2887,7 +2900,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: resource @@ -2895,7 +2908,7 @@ paths: application/json: schema: type: object - properties: &ref_140 + properties: &ref_139 workspace_id: type: string path: @@ -2911,7 +2924,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_141 + required: &ref_140 - path - resource_type - is_oauth @@ -2929,7 +2942,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: job_id description: job id in: query @@ -2956,7 +2969,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: resource value @@ -2977,7 +2990,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: does resource exists @@ -3023,7 +3036,7 @@ paths: type: array items: type: object - properties: &ref_142 + properties: &ref_141 workspace_id: type: string path: @@ -3049,7 +3062,7 @@ paths: type: boolean account: type: number - required: &ref_143 + required: &ref_142 - path - resource_type - is_oauth @@ -3096,7 +3109,7 @@ paths: - name: name in: path required: true - schema: &ref_81 + schema: &ref_80 type: string responses: '200': @@ -3133,7 +3146,7 @@ paths: application/json: schema: type: object - properties: &ref_23 + properties: &ref_22 workspace_id: type: string name: @@ -3141,7 +3154,7 @@ paths: schema: {} description: type: string - required: &ref_24 + required: &ref_23 - name responses: '201': @@ -3164,7 +3177,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: resource_type deleted @@ -3186,7 +3199,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 requestBody: description: updated resource_type required: true @@ -3194,7 +3207,7 @@ paths: application/json: schema: type: object - properties: &ref_144 + properties: &ref_143 schema: {} description: type: string @@ -3219,7 +3232,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: resource_type deleted @@ -3227,8 +3240,8 @@ paths: application/json: schema: type: object - properties: *ref_23 - required: *ref_24 + properties: *ref_22 + required: *ref_23 /w/{workspace}/resources/type/exists/{path}: get: summary: does resource_type exists @@ -3243,7 +3256,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: does resource_type exist @@ -3271,8 +3284,8 @@ paths: type: array items: type: object - properties: *ref_23 - required: *ref_24 + properties: *ref_22 + required: *ref_23 /w/{workspace}/resources/type/listnames: get: summary: list resource_types names @@ -3411,7 +3424,7 @@ paths: - name: id in: path required: true - schema: *ref_25 + schema: *ref_24 responses: '200': description: flow @@ -3422,51 +3435,51 @@ paths: properties: flow: type: object - properties: &ref_44 + properties: &ref_43 summary: type: string description: type: string value: type: object - properties: &ref_51 + properties: &ref_50 modules: type: array items: type: object - properties: &ref_28 + properties: &ref_27 id: type: string value: - oneOf: &ref_207 + oneOf: &ref_206 - type: object - properties: &ref_191 + properties: &ref_192 input_transforms: type: object additionalProperties: - oneOf: &ref_26 + oneOf: &ref_25 - type: object - properties: &ref_187 + properties: &ref_188 value: {} type: type: string enum: - javascript - required: &ref_188 + required: &ref_189 - expr - type - type: object - properties: &ref_189 + properties: &ref_190 expr: type: string type: type: string enum: - javascript - required: &ref_190 + required: &ref_191 - expr - type - discriminator: &ref_27 + discriminator: &ref_26 propertyName: type mapping: static: '#/components/schemas/StaticTransform' @@ -3503,18 +3516,18 @@ paths: type: number concurrency_time_window_s: type: number - required: &ref_192 + required: &ref_193 - type - content - language - input_transforms - type: object - properties: &ref_193 + properties: &ref_194 input_transforms: type: object additionalProperties: - oneOf: *ref_26 - discriminator: *ref_27 + oneOf: *ref_25 + discriminator: *ref_26 path: type: string hash: @@ -3523,40 +3536,40 @@ paths: type: string enum: - script - required: &ref_194 + required: &ref_195 - type - path - input_transforms - type: object - properties: &ref_195 + properties: &ref_196 input_transforms: type: object additionalProperties: - oneOf: *ref_26 - discriminator: *ref_27 + oneOf: *ref_25 + discriminator: *ref_26 path: type: string type: type: string enum: - flow - required: &ref_196 + required: &ref_197 - type - path - input_transforms - type: object - properties: &ref_197 + properties: &ref_198 modules: type: array items: type: object - properties: *ref_28 - required: &ref_29 + properties: *ref_27 + required: &ref_28 - value - id iterator: - oneOf: *ref_26 - discriminator: *ref_27 + oneOf: *ref_25 + discriminator: *ref_26 skip_failures: type: boolean type: @@ -3567,13 +3580,13 @@ paths: type: boolean parallelism: type: integer - required: &ref_198 + required: &ref_199 - modules - iterator - skip_failures - type - type: object - properties: &ref_199 + properties: &ref_200 branches: type: array items: @@ -3587,8 +3600,8 @@ paths: type: array items: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_27 + required: *ref_28 required: - modules - expr @@ -3596,20 +3609,20 @@ paths: type: array items: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_27 + required: *ref_28 required: - modules type: type: string enum: - branchone - required: &ref_200 + required: &ref_201 - branches - default - type - type: object - properties: &ref_201 + properties: &ref_202 branches: type: array items: @@ -3623,8 +3636,8 @@ paths: type: array items: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_27 + required: *ref_28 required: - modules - expr @@ -3634,28 +3647,20 @@ paths: - branchall parallel: type: boolean - required: &ref_202 + required: &ref_203 - branches - type - type: object - properties: &ref_203 + properties: &ref_204 type: type: string enum: - identity flow: type: boolean - required: &ref_204 + required: &ref_205 - type - - type: object - properties: &ref_205 - type: - type: string - enum: - - graphql - required: &ref_206 - - type - discriminator: &ref_208 + discriminator: &ref_207 propertyName: type mapping: rawscript: '#/components/schemas/RawScript' @@ -3665,7 +3670,6 @@ paths: branchone: '#/components/schemas/BranchOne' branchall: '#/components/schemas/BranchAll' identity: '#/components/schemas/Identity' - graphql: '#/components/schemas/Graphql' stop_after_if: type: object properties: @@ -3676,8 +3680,8 @@ paths: required: - expr sleep: - oneOf: *ref_26 - discriminator: *ref_27 + oneOf: *ref_25 + discriminator: *ref_26 cache_ttl: type: number timeout: @@ -3707,13 +3711,15 @@ paths: user_auth_required: type: boolean user_groups_required: - oneOf: *ref_26 - discriminator: *ref_27 + oneOf: *ref_25 + discriminator: *ref_26 + self_approval_disabled: + type: boolean priority: type: number retry: type: object - properties: &ref_78 + properties: &ref_77 constant: type: object properties: @@ -3734,11 +3740,11 @@ paths: type: integer minimum: 0 maximum: 100 - required: *ref_29 + required: *ref_28 failure_module: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_27 + required: *ref_28 same_worker: type: boolean concurrent_limit: @@ -3753,11 +3759,11 @@ paths: type: number early_return: type: string - required: &ref_52 + required: &ref_51 - modules schema: type: object - required: &ref_45 + required: &ref_44 - summary - value /apps/hub/list: @@ -3810,7 +3816,7 @@ paths: - name: id in: path required: true - schema: *ref_25 + schema: *ref_24 responses: '200': description: app @@ -3840,7 +3846,7 @@ paths: - name: path in: path required: true - schema: &ref_30 + schema: &ref_29 type: string responses: '200': @@ -3859,7 +3865,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script details @@ -3930,7 +3936,7 @@ paths: type: number kind: name: kind - schema: &ref_31 + schema: &ref_30 type: string enum: - script @@ -4003,7 +4009,7 @@ paths: type: string kind: name: kind - schema: *ref_31 + schema: *ref_30 score: type: number required: @@ -4064,12 +4070,12 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: &ref_42 + schema: &ref_41 type: boolean - name: created_by description: mask to filter exact matching user creator in: query - schema: &ref_43 + schema: &ref_42 type: string - name: path_start description: mask to filter matching starting path @@ -4162,7 +4168,7 @@ paths: type: array items: type: object - properties: &ref_32 + properties: &ref_31 workspace_id: type: string hash: @@ -4257,7 +4263,7 @@ paths: type: integer delete_after_use: type: boolean - required: &ref_33 + required: &ref_32 - hash - path - summary @@ -4353,7 +4359,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: draft deleted @@ -4379,7 +4385,7 @@ paths: application/json: schema: type: object - properties: &ref_35 + properties: &ref_34 path: type: string parent_hash: @@ -4450,7 +4456,7 @@ paths: type: string concurrency_key: type: string - required: &ref_36 + required: &ref_35 - path - summary - description @@ -4477,7 +4483,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: Workspace error handler enabled required: true @@ -4526,7 +4532,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script archived @@ -4548,7 +4554,7 @@ paths: - name: hash in: path required: true - schema: &ref_34 + schema: &ref_33 type: string responses: '200': @@ -4557,8 +4563,8 @@ paths: application/json: schema: type: object - properties: *ref_32 - required: *ref_33 + properties: *ref_31 + required: *ref_32 /w/{workspace}/scripts/delete/h/{hash}: post: summary: delete script by hash (erase content but keep hash, require admin) @@ -4573,7 +4579,7 @@ paths: - name: hash in: path required: true - schema: *ref_34 + schema: *ref_33 responses: '200': description: script details @@ -4581,8 +4587,8 @@ paths: application/json: schema: type: object - properties: *ref_32 - required: *ref_33 + properties: *ref_31 + required: *ref_32 /w/{workspace}/scripts/delete/p/{path}: post: summary: delete all scripts at a given path (require admin) @@ -4597,7 +4603,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script path @@ -4619,7 +4625,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script details @@ -4627,8 +4633,8 @@ paths: application/json: schema: type: object - properties: *ref_32 - required: *ref_33 + properties: *ref_31 + required: *ref_32 /w/{workspace}/scripts/get/draft/{path}: get: summary: get script by path with draft @@ -4643,23 +4649,23 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script details content: application/json: schema: - allOf: &ref_111 + allOf: &ref_110 - type: object - properties: *ref_35 - required: *ref_36 + properties: *ref_34 + required: *ref_35 - type: object properties: draft: type: object - properties: *ref_35 - required: *ref_36 + properties: *ref_34 + required: *ref_35 hash: type: string required: @@ -4678,7 +4684,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script history @@ -4688,12 +4694,12 @@ paths: type: array items: type: object - properties: &ref_112 + properties: &ref_111 script_hash: type: string deployment_msg: type: string - required: &ref_113 + required: &ref_112 - script_hash /w/{workspace}/scripts/history_update/h/{hash}/p/{path}: post: @@ -4709,11 +4715,11 @@ paths: - name: hash in: path required: true - schema: *ref_34 + schema: *ref_33 - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: Script deployment message required: true @@ -4745,7 +4751,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script content @@ -4769,12 +4775,12 @@ paths: - name: token in: path required: true - schema: &ref_97 + schema: &ref_96 type: string - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script content @@ -4796,7 +4802,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: does it exists @@ -4818,7 +4824,7 @@ paths: - name: hash in: path required: true - schema: *ref_34 + schema: *ref_33 responses: '200': description: script details @@ -4826,8 +4832,8 @@ paths: application/json: schema: type: object - properties: *ref_32 - required: *ref_33 + properties: *ref_31 + required: *ref_32 /w/{workspace}/scripts/raw/h/{path}: get: summary: raw script by hash @@ -4842,7 +4848,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: script content @@ -4864,7 +4870,7 @@ paths: - name: hash in: path required: true - schema: *ref_34 + schema: *ref_33 responses: '200': description: script details @@ -4891,7 +4897,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: scheduled_for description: when to schedule this job (leave empty for immediate run) in: query @@ -4908,13 +4914,13 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: &ref_37 + schema: &ref_36 type: string format: uuid - name: tag description: Override the tag to use in: query - schema: &ref_39 + schema: &ref_38 type: string - name: job_id description: >- @@ -4923,7 +4929,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: &ref_38 + schema: &ref_37 type: string format: uuid - name: invisible_to_owner @@ -4961,13 +4967,13 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -4975,7 +4981,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -4984,14 +4990,14 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: &ref_40 + schema: &ref_39 type: string - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: &ref_41 + schema: &ref_40 type: string requestBody: description: script args @@ -5021,17 +5027,17 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: tag description: Override the tag to use in: query - schema: *ref_39 + schema: *ref_38 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -5039,7 +5045,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -5048,13 +5054,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_41 + schema: *ref_40 requestBody: description: script args required: true @@ -5082,17 +5088,17 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: tag description: Override the tag to use in: query - schema: *ref_39 + schema: *ref_38 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -5100,7 +5106,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -5109,13 +5115,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_41 + schema: *ref_40 - name: payload description: > The base64 encoded payload that has been encoded as a JSON. e.g how @@ -5123,7 +5129,7 @@ paths: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: &ref_77 + schema: &ref_76 type: string responses: '200': @@ -5145,7 +5151,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -5154,13 +5160,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_41 + schema: *ref_40 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -5168,7 +5174,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 requestBody: description: script args required: true @@ -5197,7 +5203,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -5206,13 +5212,13 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_41 + schema: *ref_40 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -5220,7 +5226,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 requestBody: description: script args required: true @@ -5331,11 +5337,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_42 + schema: *ref_41 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 - name: path_start description: mask to filter matching starting path in: query @@ -5375,12 +5381,12 @@ paths: type: array items: allOf: - - allOf: &ref_46 + - allOf: &ref_45 - type: object - properties: *ref_44 - required: *ref_45 + properties: *ref_43 + required: *ref_44 - type: object - properties: &ref_156 + properties: &ref_155 workspace_id: type: string path: @@ -5410,7 +5416,7 @@ paths: type: boolean timeout: type: number - required: &ref_157 + required: &ref_156 - path - edited_by - edited_at @@ -5436,14 +5442,14 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: flow details content: application/json: schema: - allOf: *ref_46 + allOf: *ref_45 /w/{workspace}/flows/toggle_workspace_error_handler/{path}: post: summary: Toggle ON and OFF the workspace error handler for a given flow @@ -5458,7 +5464,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: Workspace error handler enabled required: true @@ -5490,7 +5496,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: flow details with draft @@ -5498,11 +5504,11 @@ paths: application/json: schema: allOf: - - allOf: *ref_46 + - allOf: *ref_45 - type: object properties: draft: - allOf: *ref_46 + allOf: *ref_45 /w/{workspace}/flows/exists/{path}: get: summary: exists flow by path @@ -5517,7 +5523,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: flow details @@ -5543,10 +5549,10 @@ paths: application/json: schema: allOf: - - allOf: &ref_47 + - allOf: &ref_46 - type: object - properties: *ref_44 - required: *ref_45 + properties: *ref_43 + required: *ref_44 - type: object properties: path: @@ -5590,7 +5596,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: Partially filled flow required: true @@ -5598,7 +5604,7 @@ paths: application/json: schema: allOf: - - allOf: *ref_47 + - allOf: *ref_46 - type: object properties: deployment_message: @@ -5624,7 +5630,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: archiveFlow required: true @@ -5656,7 +5662,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: flow delete @@ -5678,7 +5684,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: page description: which page to return (start at 1, default 1) in: query @@ -5696,7 +5702,7 @@ paths: type: array items: type: object - properties: &ref_88 + properties: &ref_87 id: type: string name: @@ -5712,7 +5718,7 @@ paths: type: boolean success: type: boolean - required: &ref_89 + required: &ref_88 - id - name - args @@ -5741,11 +5747,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_42 + schema: *ref_41 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 - name: path_start description: mask to filter matching starting path in: query @@ -5772,7 +5778,7 @@ paths: type: array items: type: object - properties: &ref_163 + properties: &ref_162 workspace_id: type: string path: @@ -5790,7 +5796,7 @@ paths: edited_at: type: string format: date-time - required: &ref_164 + required: &ref_163 - workspace_id - path - summary @@ -5811,7 +5817,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: app exists @@ -5833,12 +5839,12 @@ paths: - name: version in: path required: true - schema: &ref_96 + schema: &ref_95 type: number - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: app details @@ -5895,11 +5901,11 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_42 + schema: *ref_41 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 - name: path_start description: mask to filter matching starting path in: query @@ -5926,7 +5932,7 @@ paths: type: array items: type: object - properties: &ref_161 + properties: &ref_160 id: type: integer workspace_id: @@ -5952,7 +5958,7 @@ paths: - viewer - publisher - anonymous - required: &ref_162 + required: &ref_161 - id - workspace_id - path @@ -5987,7 +5993,7 @@ paths: type: string policy: type: object - properties: &ref_48 + properties: &ref_47 triggerables: type: object additionalProperties: @@ -6032,7 +6038,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: app exists @@ -6054,7 +6060,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: app details @@ -6062,7 +6068,7 @@ paths: application/json: schema: type: object - properties: &ref_49 + properties: &ref_48 id: type: integer workspace_id: @@ -6083,7 +6089,7 @@ paths: value: {} policy: type: object - properties: *ref_48 + properties: *ref_47 execution_mode: type: string enum: @@ -6094,7 +6100,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_50 + required: &ref_49 - id - workspace_id - path @@ -6120,17 +6126,17 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: app details with draft content: application/json: schema: - allOf: &ref_165 + allOf: &ref_164 - type: object - properties: *ref_49 - required: *ref_50 + properties: *ref_48 + required: *ref_49 - type: object properties: draft_only: @@ -6150,7 +6156,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 responses: '200': description: app history @@ -6160,12 +6166,12 @@ paths: type: array items: type: object - properties: &ref_166 + properties: &ref_165 version: type: integer deployment_msg: type: string - required: &ref_167 + required: &ref_166 - version /w/{workspace}/apps/history_update/a/{id}/v/{version}: post: @@ -6181,11 +6187,11 @@ paths: - name: id in: path required: true - schema: *ref_25 + schema: *ref_24 - name: version in: path required: true - schema: &ref_98 + schema: &ref_97 type: integer requestBody: description: App deployment message @@ -6218,7 +6224,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: app details @@ -6226,8 +6232,8 @@ paths: application/json: schema: type: object - properties: *ref_49 - required: *ref_50 + properties: *ref_48 + required: *ref_49 /w/{workspace}/apps_u/public_resource/{path}: get: summary: get public resource @@ -6242,7 +6248,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: resource value @@ -6263,7 +6269,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: app secret @@ -6285,7 +6291,7 @@ paths: - name: id in: path required: true - schema: *ref_25 + schema: *ref_24 responses: '200': description: app details @@ -6293,8 +6299,8 @@ paths: application/json: schema: type: object - properties: *ref_49 - required: *ref_50 + properties: *ref_48 + required: *ref_49 /w/{workspace}/raw_apps/create: post: summary: create raw app @@ -6345,7 +6351,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: updateraw app required: true @@ -6381,7 +6387,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: app deleted @@ -6403,7 +6409,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: app deleted @@ -6425,7 +6431,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: update app required: true @@ -6441,7 +6447,7 @@ paths: value: {} policy: type: object - properties: *ref_48 + properties: *ref_47 deployment_message: type: string responses: @@ -6465,7 +6471,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 requestBody: description: update app required: true @@ -6519,7 +6525,7 @@ paths: - name: path in: path required: true - schema: *ref_30 + schema: *ref_29 - name: scheduled_for description: when to schedule this job (leave empty for immediate run) in: query @@ -6536,11 +6542,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: tag description: Override the tag to use in: query - schema: *ref_39 + schema: *ref_38 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6548,7 +6554,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6557,7 +6563,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: invisible_to_owner description: make the run invisible to the the flow owner (default false) in: query @@ -6593,7 +6599,7 @@ paths: - name: id in: path required: true - schema: &ref_74 + schema: &ref_73 type: string format: uuid - name: step_id @@ -6626,11 +6632,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: tag description: Override the tag to use in: query - schema: *ref_39 + schema: *ref_38 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6638,7 +6644,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6647,7 +6653,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: invisible_to_owner description: make the run invisible to the the flow owner (default false) in: query @@ -6683,7 +6689,7 @@ paths: - name: hash in: path required: true - schema: *ref_34 + schema: *ref_33 - name: scheduled_for description: when to schedule this job (leave empty for immediate run) in: query @@ -6700,11 +6706,11 @@ paths: The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: tag description: Override the tag to use in: query - schema: *ref_39 + schema: *ref_38 - name: job_id description: >- The job id to assign to the created job. if missing, job is chosen @@ -6712,7 +6718,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 - name: include_header description: > List of headers's keys (separated with ',') whove value are added to @@ -6721,7 +6727,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -6761,7 +6767,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -6774,7 +6780,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 requestBody: description: preview required: true @@ -6782,7 +6788,7 @@ paths: application/json: schema: type: object - properties: &ref_135 + properties: &ref_134 content: type: string path: @@ -6818,7 +6824,7 @@ paths: type: boolean lock: type: string - required: &ref_136 + required: &ref_135 - args responses: '201': @@ -6851,7 +6857,7 @@ paths: type: array items: type: object - properties: &ref_183 + properties: &ref_184 raw_code: type: string path: @@ -6872,7 +6878,7 @@ paths: - graphql - nativets - bun - required: &ref_184 + required: &ref_185 - raw_code - path - language @@ -6912,7 +6918,7 @@ paths: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 - name: invisible_to_owner description: make the run invisible to the the script owner (default false) in: query @@ -6925,7 +6931,7 @@ paths: queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 requestBody: description: preview required: true @@ -6933,11 +6939,11 @@ paths: application/json: schema: type: object - properties: &ref_158 + properties: &ref_157 value: type: object - properties: *ref_51 - required: *ref_52 + properties: *ref_50 + required: *ref_51 path: type: string args: @@ -6947,7 +6953,7 @@ paths: type: string restarted_from: type: object - properties: &ref_160 + properties: &ref_159 flow_job_id: type: string format: uuid @@ -6955,7 +6961,7 @@ paths: type: string branch_or_iteration_n: type: integer - required: &ref_159 + required: &ref_158 - value - content - args @@ -6981,94 +6987,94 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_42 + schema: *ref_41 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: script_path_exact description: mask to filter exact matching path in: query - schema: &ref_55 + schema: &ref_54 type: string - name: script_path_start description: mask to filter matching starting path in: query - schema: &ref_56 + schema: &ref_55 type: string - name: schedule_path description: mask to filter by schedule path in: query - schema: &ref_57 + schema: &ref_56 type: string - name: script_hash description: mask to filter exact matching path in: query - schema: &ref_58 + schema: &ref_57 type: string - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: &ref_59 + schema: &ref_58 type: string format: date-time - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: &ref_60 + schema: &ref_59 type: string format: date-time - name: success description: filter on successful jobs in: query - schema: &ref_61 + schema: &ref_60 type: boolean - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: &ref_69 + schema: &ref_68 type: boolean - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: &ref_62 + schema: &ref_61 type: string - name: suspended description: filter on suspended jobs in: query - schema: &ref_101 + schema: &ref_100 type: boolean - name: running description: filter on running jobs in: query - schema: &ref_68 + schema: &ref_67 type: boolean - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: &ref_63 + schema: &ref_62 type: string - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: &ref_64 + schema: &ref_63 type: string - name: tag description: filter on jobs with a given tag/worker group in: query - schema: &ref_65 + schema: &ref_64 type: string responses: '200': @@ -7079,7 +7085,7 @@ paths: type: array items: type: object - properties: &ref_72 + properties: &ref_71 workspace_id: type: string id: @@ -7146,14 +7152,14 @@ paths: by extension its DT_TOKEN. flow_status: type: object - properties: &ref_66 + properties: &ref_65 step: type: integer modules: type: array items: type: object - properties: &ref_53 + properties: &ref_52 type: type: string enum: @@ -7217,13 +7223,13 @@ paths: required: - resume_id - approver - required: &ref_54 + required: &ref_53 - type failure_module: allOf: - type: object - properties: *ref_53 - required: *ref_54 + properties: *ref_52 + required: *ref_53 - type: object properties: parent_module: @@ -7238,14 +7244,14 @@ paths: items: type: string format: uuid - required: &ref_67 + required: &ref_66 - step - modules - failure_module raw_flow: type: object - properties: *ref_51 - required: *ref_52 + properties: *ref_50 + required: *ref_51 is_flow_step: type: boolean language: @@ -7274,7 +7280,7 @@ paths: type: string priority: type: integer - required: &ref_73 + required: &ref_72 - id - running - canceled @@ -7364,67 +7370,67 @@ paths: - name: order_desc description: order by desc order (default true) in: query - schema: *ref_42 + schema: *ref_41 - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_55 + schema: *ref_54 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_56 + schema: *ref_55 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_57 + schema: *ref_56 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_58 + schema: *ref_57 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_59 + schema: *ref_58 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_60 + schema: *ref_59 - name: success description: filter on successful jobs in: query - schema: *ref_61 + schema: *ref_60 - name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_62 + schema: *ref_61 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_63 + schema: *ref_62 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_64 + schema: *ref_63 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_65 + schema: *ref_64 - name: is_skipped description: is the job skipped in: query @@ -7444,7 +7450,7 @@ paths: type: array items: type: object - properties: &ref_70 + properties: &ref_69 workspace_id: type: string id: @@ -7510,12 +7516,12 @@ paths: by extension its DT_TOKEN. flow_status: type: object - properties: *ref_66 - required: *ref_67 + properties: *ref_65 + required: *ref_66 raw_flow: type: object - properties: *ref_51 - required: *ref_52 + properties: *ref_50 + required: *ref_51 is_flow_step: type: boolean language: @@ -7546,7 +7552,7 @@ paths: type: string priority: type: integer - required: &ref_71 + required: &ref_70 - id - created_by - duration_ms @@ -7575,59 +7581,59 @@ paths: - name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 - name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 - name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_55 + schema: *ref_54 - name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_56 + schema: *ref_55 - name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_57 + schema: *ref_56 - name: script_hash description: mask to filter exact matching path in: query - schema: *ref_58 + schema: *ref_57 - name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_59 + schema: *ref_58 - name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_60 + schema: *ref_59 - name: created_or_started_before description: >- filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: &ref_100 + schema: &ref_99 type: string format: date-time - name: running description: filter on running jobs in: query - schema: *ref_68 + schema: *ref_67 - name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_69 + schema: *ref_68 - name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: &ref_99 + schema: &ref_98 type: string format: date-time - name: job_kinds @@ -7635,23 +7641,23 @@ paths: filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_62 + schema: *ref_61 - name: args description: >- filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_63 + schema: *ref_62 - name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_65 + schema: *ref_64 - name: result description: >- filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_64 + schema: *ref_63 - name: is_skipped description: is the job skipped in: query @@ -7675,14 +7681,14 @@ paths: schema: type: array items: - allOf: &ref_75 + allOf: &ref_74 - oneOf: - type: object - properties: *ref_70 - required: *ref_71 + properties: *ref_69 + required: *ref_70 - type: object - properties: *ref_72 - required: *ref_73 + properties: *ref_71 + required: *ref_72 - type: object properties: type: @@ -7690,7 +7696,7 @@ paths: enum: - CompletedJob - QueuedJob - discriminator: &ref_76 + discriminator: &ref_75 propertyName: type /jobs/db_clock: get: @@ -7719,15 +7725,37 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 responses: '200': description: job details content: application/json: schema: - allOf: *ref_75 - discriminator: *ref_76 + allOf: *ref_74 + discriminator: *ref_75 + /w/{workspace}/jobs_u/get_root_job_id/{id}: + get: + summary: get root job id + operationId: getRootJobId + tags: + - job + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: id + in: path + required: true + schema: *ref_73 + responses: + '200': + description: get root job id + content: + application/json: + schema: + type: string /w/{workspace}/jobs_u/get_logs/{id}: get: summary: get job logs @@ -7742,7 +7770,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 responses: '200': description: job details @@ -7764,7 +7792,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: running in: query schema: @@ -7789,6 +7817,27 @@ paths: type: string mem_peak: type: integer + /w/{workspace}/jobs_u/get_flow_debug_info/{id}: + get: + summary: get flow debug info + operationId: getFlowDebugInfo + tags: + - job + parameters: + - name: workspace + in: path + required: true + schema: *ref_0 + - name: id + in: path + required: true + schema: *ref_73 + responses: + '200': + description: flow debug info details + content: + application/json: + schema: {} /w/{workspace}/jobs_u/completed/get/{id}: get: summary: get completed job @@ -7803,7 +7852,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 responses: '200': description: job details @@ -7811,8 +7860,8 @@ paths: application/json: schema: type: object - properties: *ref_70 - required: *ref_71 + properties: *ref_69 + required: *ref_70 /w/{workspace}/jobs_u/completed/get_result/{id}: get: summary: get completed job result @@ -7827,7 +7876,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 responses: '200': description: result @@ -7848,10 +7897,10 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: get_started in: query - schema: &ref_109 + schema: &ref_108 type: boolean responses: '200': @@ -7885,7 +7934,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 responses: '200': description: job details @@ -7893,8 +7942,8 @@ paths: application/json: schema: type: object - properties: *ref_70 - required: *ref_71 + properties: *ref_69 + required: *ref_70 /w/{workspace}/jobs_u/queue/cancel/{id}: post: summary: cancel queued job @@ -7909,7 +7958,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 requestBody: description: reason required: true @@ -7941,7 +7990,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 requestBody: description: reason required: true @@ -7973,7 +8022,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 requestBody: description: reason required: true @@ -8005,7 +8054,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: resume_id in: path required: true @@ -8036,7 +8085,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: resume_id in: path required: true @@ -8078,7 +8127,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: payload description: > The base64 encoded payload that has been encoded as a JSON. e.g how @@ -8086,7 +8135,7 @@ paths: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: *ref_77 + schema: *ref_76 - name: resume_id in: path required: true @@ -8121,7 +8170,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: resume_id in: path required: true @@ -8163,7 +8212,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 requestBody: required: true content: @@ -8191,7 +8240,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: resume_id in: path required: true @@ -8226,7 +8275,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: resume_id in: path required: true @@ -8268,7 +8317,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 - name: resume_id in: path required: true @@ -8292,8 +8341,8 @@ paths: type: object properties: job: - allOf: *ref_75 - discriminator: *ref_76 + allOf: *ref_74 + discriminator: *ref_75 approvers: type: array items: @@ -8358,7 +8407,7 @@ paths: application/json: schema: type: object - properties: &ref_146 + properties: &ref_145 path: type: string schedule: @@ -8394,14 +8443,14 @@ paths: type: boolean retry: type: object - properties: *ref_78 + properties: *ref_77 no_flow_overlap: type: boolean summary: type: string tag: type: string - required: &ref_147 + required: &ref_146 - path - schedule - timezone @@ -8429,7 +8478,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 requestBody: description: updated schedule required: true @@ -8437,7 +8486,7 @@ paths: application/json: schema: type: object - properties: &ref_148 + properties: &ref_147 schedule: type: string timezone: @@ -8465,14 +8514,14 @@ paths: type: boolean retry: type: object - properties: *ref_78 + properties: *ref_77 no_flow_overlap: type: boolean summary: type: string tag: type: string - required: &ref_149 + required: &ref_148 - schedule - timezone - script_path @@ -8499,7 +8548,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 requestBody: description: updated schedule enable required: true @@ -8533,7 +8582,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: schedule deleted @@ -8555,7 +8604,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: schedule deleted @@ -8563,7 +8612,7 @@ paths: application/json: schema: type: object - properties: &ref_79 + properties: &ref_78 path: type: string edited_by: @@ -8612,14 +8661,14 @@ paths: type: boolean retry: type: object - properties: *ref_78 + properties: *ref_77 summary: type: string no_flow_overlap: type: boolean tag: type: string - required: &ref_80 + required: &ref_79 - path - edited_by - edited_at @@ -8644,7 +8693,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: schedule exists @@ -8689,8 +8738,8 @@ paths: type: array items: type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_78 + required: *ref_79 /w/{workspace}/schedules/list_with_jobs: get: summary: list schedules with last 20 jobs @@ -8718,10 +8767,10 @@ paths: schema: type: array items: - allOf: &ref_145 + allOf: &ref_144 - type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_78 + required: *ref_79 - type: object properties: jobs: @@ -8796,7 +8845,7 @@ paths: type: array items: type: object - properties: &ref_82 + properties: &ref_81 name: type: string summary: @@ -8805,7 +8854,7 @@ paths: type: array items: type: string - required: &ref_83 + required: &ref_82 - name /groups/get/{name}: get: @@ -8817,7 +8866,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: instance group @@ -8825,8 +8874,8 @@ paths: application/json: schema: type: object - properties: *ref_82 - required: *ref_83 + properties: *ref_81 + required: *ref_82 /groups/create: post: summary: create instance group @@ -8864,7 +8913,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: update instance group required: true @@ -8894,7 +8943,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: instance group deleted @@ -8912,7 +8961,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: user to add to instance group required: true @@ -8942,7 +8991,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: user to remove from instance group required: true @@ -8990,7 +9039,7 @@ paths: type: array items: type: object - properties: &ref_84 + properties: &ref_83 name: type: string summary: @@ -9003,7 +9052,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_85 + required: &ref_84 - name /w/{workspace}/groups/listnames: get: @@ -9076,7 +9125,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: updated group required: true @@ -9108,7 +9157,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: group deleted @@ -9130,7 +9179,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: group @@ -9138,8 +9187,8 @@ paths: application/json: schema: type: object - properties: *ref_84 - required: *ref_85 + properties: *ref_83 + required: *ref_84 /w/{workspace}/groups/adduser/{name}: post: summary: add user to group @@ -9154,7 +9203,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: added user to group required: true @@ -9186,7 +9235,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: added user to group required: true @@ -9232,7 +9281,7 @@ paths: type: array items: type: object - properties: &ref_86 + properties: &ref_85 name: type: string owners: @@ -9243,7 +9292,7 @@ paths: type: object additionalProperties: type: boolean - required: &ref_87 + required: &ref_86 - name - owners - extra_perms @@ -9323,7 +9372,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: update folder required: true @@ -9360,7 +9409,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: folder deleted @@ -9382,7 +9431,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: folder @@ -9390,8 +9439,8 @@ paths: application/json: schema: type: object - properties: *ref_86 - required: *ref_87 + properties: *ref_85 + required: *ref_86 /w/{workspace}/folders/getusage/{name}: get: summary: get folder usage @@ -9406,7 +9455,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: folder @@ -9448,7 +9497,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: owner user to folder required: true @@ -9480,7 +9529,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: added owner to folder required: true @@ -9513,6 +9562,14 @@ paths: description: number of items to return for a given page (default 30, max 100) in: query schema: *ref_4 + - name: ping_since + in: query + required: false + description: >- + number of seconds the worker must have had a last ping more recent + of (default to 300) + schema: + type: integer responses: '200': description: a list of workers @@ -9522,7 +9579,7 @@ paths: type: array items: type: object - properties: &ref_150 + properties: &ref_149 worker: type: string worker_instance: @@ -9544,7 +9601,7 @@ paths: type: string wm_version: type: string - required: &ref_151 + required: &ref_150 - worker - worker_instance - ping_at @@ -9604,7 +9661,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: a config @@ -9621,7 +9678,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 requestBody: description: worker group required: true @@ -9644,7 +9701,7 @@ paths: - name: name in: path required: true - schema: *ref_81 + schema: *ref_80 responses: '200': description: Delete config @@ -9666,7 +9723,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: kind in: path required: true @@ -9705,7 +9762,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: kind in: path required: true @@ -9756,7 +9813,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: kind in: path required: true @@ -9805,7 +9862,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '204': description: flow preview captured @@ -9823,7 +9880,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '201': description: flow preview capture created @@ -9840,7 +9897,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 responses: '200': description: captured flow preview @@ -9920,13 +9977,13 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: &ref_90 + schema: &ref_89 type: string - name: runnable_type in: query - schema: &ref_91 + schema: &ref_90 type: string - enum: &ref_118 + enum: &ref_117 - ScriptHash - ScriptPath - FlowPath @@ -9947,8 +10004,8 @@ paths: type: array items: type: object - properties: *ref_88 - required: *ref_89 + properties: *ref_87 + required: *ref_88 /w/{workspace}/inputs/list: get: summary: List saved Inputs for a Runnable @@ -9962,10 +10019,10 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: *ref_90 + schema: *ref_89 - name: runnable_type in: query - schema: *ref_91 + schema: *ref_90 - name: page description: which page to return (start at 1, default 1) in: query @@ -9983,8 +10040,8 @@ paths: type: array items: type: object - properties: *ref_88 - required: *ref_89 + properties: *ref_87 + required: *ref_88 /w/{workspace}/inputs/create: post: summary: Create an Input for future use in a script or flow @@ -9998,10 +10055,10 @@ paths: schema: *ref_0 - name: runnable_id in: query - schema: *ref_90 + schema: *ref_89 - name: runnable_type in: query - schema: *ref_91 + schema: *ref_90 requestBody: description: Input required: true @@ -10009,12 +10066,12 @@ paths: application/json: schema: type: object - properties: &ref_114 + properties: &ref_113 name: type: string args: type: object - required: &ref_115 + required: &ref_114 - name - args - created_by @@ -10044,14 +10101,14 @@ paths: application/json: schema: type: object - properties: &ref_116 + properties: &ref_115 id: type: string name: type: string is_public: type: boolean - required: &ref_117 + required: &ref_116 - id - name - is_public @@ -10077,7 +10134,7 @@ paths: - name: input in: path required: true - schema: &ref_108 + schema: &ref_107 type: string responses: '200': @@ -10110,7 +10167,7 @@ paths: properties: s3_resource: type: object - properties: &ref_92 + properties: &ref_91 bucket: type: string region: @@ -10125,7 +10182,7 @@ paths: type: string pathStyle: type: boolean - required: &ref_93 + required: &ref_92 - bucket - region - endPoint @@ -10201,8 +10258,8 @@ paths: properties: s3_resource: type: object - properties: *ref_92 - required: *ref_93 + properties: *ref_91 + required: *ref_92 responses: '200': description: Connection settings @@ -10223,10 +10280,10 @@ paths: type: boolean client_kwargs: type: object - properties: &ref_94 + properties: &ref_93 region_name: type: string - required: &ref_95 + required: &ref_94 - region_name required: - endpoint_url @@ -10281,8 +10338,8 @@ paths: type: boolean client_kwargs: type: object - properties: *ref_94 - required: *ref_95 + properties: *ref_93 + required: *ref_94 required: - endpoint_url - use_ssl @@ -10340,8 +10397,8 @@ paths: application/json: schema: type: object - properties: *ref_92 - required: *ref_93 + properties: *ref_91 + required: *ref_92 /w/{workspace}/job_helpers/test_connection: get: summary: Test connection to the workspace datasets storage @@ -10397,10 +10454,10 @@ paths: type: array items: type: object - properties: &ref_170 + properties: &ref_169 s3: type: string - required: &ref_171 + required: &ref_170 - s3 restricted_access: type: boolean @@ -10429,7 +10486,7 @@ paths: application/json: schema: type: object - properties: &ref_172 + properties: &ref_171 mime_type: type: string size_in_bytes: @@ -10489,7 +10546,7 @@ paths: application/json: schema: type: object - properties: &ref_173 + properties: &ref_172 msg: type: string content: @@ -10501,7 +10558,7 @@ paths: - Csv - Parquet - Unknown - required: &ref_174 + required: &ref_173 - content_type /w/{workspace}/job_helpers/load_parquet_preview/{path}: get: @@ -10517,7 +10574,7 @@ paths: - name: path in: path required: true - schema: *ref_18 + schema: *ref_17 - name: offset in: query schema: @@ -10696,7 +10753,7 @@ paths: - name: id in: path required: true - schema: *ref_74 + schema: *ref_73 requestBody: description: parameters for statistics retrieval required: true @@ -10725,46 +10782,46 @@ paths: type: array items: type: object - properties: &ref_175 + properties: &ref_176 id: type: string name: type: string - required: &ref_176 + required: &ref_177 - id scalar_metrics: type: array items: type: object - properties: &ref_177 + properties: &ref_178 metric_id: type: string value: type: number - required: &ref_178 + required: &ref_179 - id - value timeseries_metrics: type: array items: type: object - properties: &ref_179 + properties: &ref_180 metric_id: type: string values: type: array items: type: object - properties: &ref_181 + properties: &ref_182 timestamp: type: string format: date-time value: type: number - required: &ref_182 + required: &ref_183 - timestamp - value - required: &ref_180 + required: &ref_181 - id - values /concurrency_groups/list: @@ -10782,14 +10839,14 @@ paths: type: array items: type: object - properties: &ref_185 + properties: &ref_186 concurrency_id: type: string job_uuids: type: array items: type: string - required: &ref_186 + required: &ref_187 - concurrency_id - job_uuids /concurrency_groups/{concurrency_id}: @@ -10802,7 +10859,7 @@ paths: - name: concurrency_id in: path required: true - schema: &ref_110 + schema: &ref_109 type: string responses: '200': @@ -10836,57 +10893,57 @@ components: name: version in: path required: true - schema: *ref_96 + schema: *ref_95 Token: name: token in: path required: true - schema: *ref_97 + schema: *ref_96 AccountId: name: id in: path required: true - schema: *ref_22 + schema: *ref_21 ClientName: name: client_name in: path required: true - schema: *ref_21 + schema: *ref_20 ScriptPath: name: path in: path required: true - schema: *ref_30 + schema: *ref_29 ScriptHash: name: hash in: path required: true - schema: *ref_34 + schema: *ref_33 JobId: name: id in: path required: true - schema: *ref_74 + schema: *ref_73 Path: name: path in: path required: true - schema: *ref_18 + schema: *ref_17 PathId: name: id in: path required: true - schema: *ref_25 + schema: *ref_24 PathVersion: name: version in: path required: true - schema: *ref_98 + schema: *ref_97 Name: name: name in: path required: true - schema: *ref_81 + schema: *ref_80 Page: name: page description: which page to return (start at 1, default 1) @@ -10901,24 +10958,24 @@ components: name: order_desc description: order by desc order (default true) in: query - schema: *ref_42 + schema: *ref_41 CreatedBy: name: created_by description: mask to filter exact matching user creator in: query - schema: *ref_43 + schema: *ref_42 ParentJob: name: parent_job description: >- The parent job that is at the origin and responsible for the execution of this script if any in: query - schema: *ref_37 + schema: *ref_36 WorkerTag: name: tag description: Override the tag to use in: query - schema: *ref_39 + schema: *ref_38 NewJobId: name: job_id description: >- @@ -10926,7 +10983,7 @@ components: randomly using the ULID scheme. If a job id already exists in the queue or as a completed job, the request to create one will fail (Bad Request) in: query - schema: *ref_38 + schema: *ref_37 IncludeHeader: name: include_header description: > @@ -10936,14 +10993,14 @@ components: Header's key lowercased and '-'' replaced to '_' such that 'Content-Type' becomes the 'content_type' arg key in: query - schema: *ref_40 + schema: *ref_39 QueueLimit: name: queue_limit description: > The maximum size of the queue for which the request would get rejected if that job would push it above that limit in: query - schema: *ref_41 + schema: *ref_40 Payload: name: payload description: > @@ -10952,233 +11009,233 @@ components: `encodeURIComponent(btoa(JSON.stringify({a: 2})))` in: query - schema: *ref_77 + schema: *ref_76 ScriptStartPath: name: script_path_start description: mask to filter matching starting path in: query - schema: *ref_56 + schema: *ref_55 SchedulePath: name: schedule_path description: mask to filter by schedule path in: query - schema: *ref_57 + schema: *ref_56 ScriptExactPath: name: script_path_exact description: mask to filter exact matching path in: query - schema: *ref_55 + schema: *ref_54 ScriptExactHash: name: script_hash description: mask to filter exact matching path in: query - schema: *ref_58 + schema: *ref_57 StartedBefore: name: started_before description: filter on started before (inclusive) timestamp in: query - schema: *ref_59 + schema: *ref_58 StartedAfter: name: started_after description: filter on started after (exclusive) timestamp in: query - schema: *ref_60 + schema: *ref_59 CreatedOrStartedAfter: name: created_or_started_after description: >- filter on created_at for non non started job and started_at otherwise after (exclusive) timestamp in: query - schema: *ref_99 + schema: *ref_98 CreatedOrStartedBefore: name: created_or_started_before description: >- filter on created_at for non non started job and started_at otherwise before (inclusive) timestamp in: query - schema: *ref_100 + schema: *ref_99 Success: name: success description: filter on successful jobs in: query - schema: *ref_61 + schema: *ref_60 ScheduledForBeforeNow: name: scheduled_for_before_now description: filter on jobs scheduled_for before now (hence waitinf for a worker) in: query - schema: *ref_69 + schema: *ref_68 Suspended: name: suspended description: filter on suspended jobs in: query - schema: *ref_101 + schema: *ref_100 Running: name: running description: filter on running jobs in: query - schema: *ref_68 + schema: *ref_67 ArgsFilter: name: args description: filter on jobs containing those args as a json subset (@> in postgres) in: query - schema: *ref_63 + schema: *ref_62 Tag: name: tag description: filter on jobs with a given tag/worker group in: query - schema: *ref_65 + schema: *ref_64 ResultFilter: name: result description: filter on jobs containing those result as a json subset (@> in postgres) in: query - schema: *ref_64 + schema: *ref_63 After: name: after description: filter on created after (exclusive) timestamp in: query - schema: *ref_102 + schema: *ref_101 Before: name: before description: filter on created before (exclusive) timestamp in: query - schema: *ref_103 + schema: *ref_102 Username: name: username description: filter on exact username of user in: query - schema: *ref_104 + schema: *ref_103 Operation: name: operation description: filter on exact or prefix name of operation in: query - schema: *ref_105 + schema: *ref_104 ResourceName: name: resource description: filter on exact or prefix name of resource in: query - schema: *ref_106 + schema: *ref_105 ActionKind: name: action_kind description: filter on type of operation in: query - schema: *ref_107 + schema: *ref_106 JobKinds: name: job_kinds description: >- filter on job kind (values 'preview', 'script', 'dependencies', 'flow') separated by, in: query - schema: *ref_62 + schema: *ref_61 RunnableId: name: runnable_id in: query - schema: *ref_90 + schema: *ref_89 RunnableTypeQuery: name: runnable_type in: query - schema: *ref_91 + schema: *ref_90 InputId: name: input in: path required: true - schema: *ref_108 + schema: *ref_107 GetStarted: name: get_started in: query - schema: *ref_109 + schema: *ref_108 ConcurrencyId: name: concurrency_id in: path required: true - schema: *ref_110 + schema: *ref_109 schemas: Script: type: object - properties: *ref_32 - required: *ref_33 + properties: *ref_31 + required: *ref_32 NewScript: type: object - properties: *ref_35 - required: *ref_36 + properties: *ref_34 + required: *ref_35 NewScriptWithDraft: - allOf: *ref_111 + allOf: *ref_110 ScriptHistory: type: object - properties: *ref_112 - required: *ref_113 + properties: *ref_111 + required: *ref_112 ScriptArgs: type: object additionalProperties: *ref_14 Input: type: object - properties: *ref_88 - required: *ref_89 + properties: *ref_87 + required: *ref_88 CreateInput: type: object - properties: *ref_114 - required: *ref_115 + properties: *ref_113 + required: *ref_114 UpdateInput: type: object - properties: *ref_116 - required: *ref_117 + properties: *ref_115 + required: *ref_116 RunnableType: type: string - enum: *ref_118 + enum: *ref_117 QueuedJob: type: object - properties: *ref_72 - required: *ref_73 + properties: *ref_71 + required: *ref_72 CompletedJob: type: object - properties: *ref_70 - required: *ref_71 + properties: *ref_69 + required: *ref_70 Job: - allOf: *ref_75 - discriminator: *ref_76 + allOf: *ref_74 + discriminator: *ref_75 User: type: object properties: *ref_8 required: *ref_9 Usage: type: object - properties: *ref_119 + properties: *ref_118 Login: type: object - properties: *ref_120 - required: *ref_121 + properties: *ref_119 + required: *ref_120 NewUser: type: object - properties: *ref_122 - required: *ref_123 + properties: *ref_121 + required: *ref_122 EditWorkspaceUser: type: object - properties: *ref_124 + properties: *ref_123 TruncatedToken: type: object - properties: *ref_125 - required: *ref_126 + properties: *ref_124 + required: *ref_125 NewToken: type: object - properties: *ref_127 + properties: *ref_126 NewTokenImpersonate: type: object - properties: *ref_128 - required: *ref_129 + properties: *ref_127 + required: *ref_128 ListableVariable: type: object - properties: *ref_19 - required: *ref_20 + properties: *ref_18 + required: *ref_19 ContextualVariable: type: object - properties: *ref_130 - required: *ref_131 + properties: *ref_129 + required: *ref_130 CreateVariable: type: object - properties: *ref_132 - required: *ref_133 + properties: *ref_131 + required: *ref_132 EditVariable: type: object - properties: *ref_134 + properties: *ref_133 AuditLog: type: object properties: *ref_1 @@ -11302,68 +11359,68 @@ components: - error Preview: type: object - properties: *ref_135 - required: *ref_136 + properties: *ref_134 + required: *ref_135 CreateResource: type: object - properties: *ref_137 - required: *ref_138 + properties: *ref_136 + required: *ref_137 EditResource: type: object - properties: *ref_139 + properties: *ref_138 Resource: type: object - properties: *ref_140 - required: *ref_141 + properties: *ref_139 + required: *ref_140 ListableResource: type: object - properties: *ref_142 - required: *ref_143 + properties: *ref_141 + required: *ref_142 ResourceType: type: object - properties: *ref_23 - required: *ref_24 + properties: *ref_22 + required: *ref_23 EditResourceType: type: object - properties: *ref_144 + properties: *ref_143 Schedule: type: object - properties: *ref_79 - required: *ref_80 + properties: *ref_78 + required: *ref_79 ScheduleWJobs: - allOf: *ref_145 + allOf: *ref_144 NewSchedule: type: object - properties: *ref_146 - required: *ref_147 + properties: *ref_145 + required: *ref_146 EditSchedule: type: object - properties: *ref_148 - required: *ref_149 + properties: *ref_147 + required: *ref_148 Group: type: object - properties: *ref_84 - required: *ref_85 + properties: *ref_83 + required: *ref_84 InstanceGroup: type: object - properties: *ref_82 - required: *ref_83 + properties: *ref_81 + required: *ref_82 Folder: type: object - properties: *ref_86 - required: *ref_87 + properties: *ref_85 + required: *ref_86 WorkerPing: type: object - properties: *ref_150 - required: *ref_151 + properties: *ref_149 + required: *ref_150 UserWorkspaceList: type: object - properties: *ref_152 - required: *ref_153 + properties: *ref_151 + required: *ref_152 CreateWorkspace: type: object - properties: *ref_154 - required: *ref_155 + properties: *ref_153 + required: *ref_154 Workspace: type: object properties: *ref_5 @@ -11377,41 +11434,41 @@ components: properties: *ref_10 required: *ref_11 Flow: - allOf: *ref_46 + allOf: *ref_45 FlowMetadata: type: object - properties: *ref_156 - required: *ref_157 + properties: *ref_155 + required: *ref_156 OpenFlowWPath: - allOf: *ref_47 + allOf: *ref_46 FlowPreview: type: object - properties: *ref_158 - required: *ref_159 + properties: *ref_157 + required: *ref_158 RestartedFrom: type: object - properties: *ref_160 + properties: *ref_159 Policy: type: object - properties: *ref_48 + properties: *ref_47 ListableApp: type: object - properties: *ref_161 - required: *ref_162 + properties: *ref_160 + required: *ref_161 ListableRawApp: type: object - properties: *ref_163 - required: *ref_164 + properties: *ref_162 + required: *ref_163 AppWithLastVersion: type: object - properties: *ref_49 - required: *ref_50 + properties: *ref_48 + required: *ref_49 AppWithLastVersionWDraft: - allOf: *ref_165 + allOf: *ref_164 AppHistory: type: object - properties: *ref_166 - required: *ref_167 + properties: *ref_165 + required: *ref_166 SlackToken: type: object properties: @@ -11433,37 +11490,40 @@ components: - bot TokenResponse: type: object - properties: *ref_168 - required: *ref_169 + properties: *ref_167 + required: *ref_168 HubScriptKind: name: kind - schema: *ref_31 + schema: *ref_30 PolarsClientKwargs: type: object - properties: *ref_94 - required: *ref_95 + properties: *ref_93 + required: *ref_94 LargeFileStorage: type: object properties: *ref_15 WindmillLargeFile: type: object - properties: *ref_170 - required: *ref_171 + properties: *ref_169 + required: *ref_170 WindmillFileMetadata: type: object - properties: *ref_172 + properties: *ref_171 WindmillFilePreview: type: object - properties: *ref_173 - required: *ref_174 + properties: *ref_172 + required: *ref_173 S3Resource: type: object - properties: *ref_92 - required: *ref_93 - WorkspaceGitSync: + properties: *ref_91 + required: *ref_92 + WorkspaceGitSyncSettings: type: object properties: *ref_16 - required: *ref_17 + GitRepositorySettings: + type: object + properties: *ref_174 + required: *ref_175 UploadFilePart: type: object properties: @@ -11476,103 +11536,90 @@ components: - tag MetricMetadata: type: object - properties: *ref_175 - required: *ref_176 + properties: *ref_176 + required: *ref_177 ScalarMetric: type: object - properties: *ref_177 - required: *ref_178 + properties: *ref_178 + required: *ref_179 TimeseriesMetric: type: object - properties: *ref_179 - required: *ref_180 + properties: *ref_180 + required: *ref_181 MetricDataPoint: type: object - properties: *ref_181 - required: *ref_182 + properties: *ref_182 + required: *ref_183 RawScriptForDependencies: type: object - properties: *ref_183 - required: *ref_184 + properties: *ref_184 + required: *ref_185 ConcurrencyGroup: type: object - properties: *ref_185 - required: *ref_186 + properties: *ref_186 + required: *ref_187 StaticTransform: type: object - properties: *ref_187 - required: *ref_188 + properties: *ref_188 + required: *ref_189 JavascriptTransform: type: object - properties: *ref_189 - required: *ref_190 + properties: *ref_190 + required: *ref_191 InputTransform: - oneOf: *ref_26 - discriminator: *ref_27 + oneOf: *ref_25 + discriminator: *ref_26 RawScript: type: object - properties: *ref_191 - required: *ref_192 + properties: *ref_192 + required: *ref_193 PathScript: type: object - properties: *ref_193 - required: *ref_194 + properties: *ref_194 + required: *ref_195 PathFlow: type: object - properties: *ref_195 - required: *ref_196 + properties: *ref_196 + required: *ref_197 FlowModule: type: object - properties: *ref_28 - required: *ref_29 + properties: *ref_27 + required: *ref_28 ForloopFlow: type: object - properties: *ref_197 - required: *ref_198 + properties: *ref_198 + required: *ref_199 BranchOne: type: object - properties: *ref_199 - required: *ref_200 + properties: *ref_200 + required: *ref_201 BranchAll: type: object - properties: *ref_201 - required: *ref_202 + properties: *ref_202 + required: *ref_203 Identity: type: object - properties: *ref_203 - required: *ref_204 - Graphql: - type: object - properties: *ref_205 - required: *ref_206 + properties: *ref_204 + required: *ref_205 FlowModuleValue: - oneOf: *ref_207 - discriminator: *ref_208 + oneOf: *ref_206 + discriminator: *ref_207 Retry: type: object - properties: *ref_78 + properties: *ref_77 FlowValue: type: object - properties: *ref_51 - required: *ref_52 + properties: *ref_50 + required: *ref_51 OpenFlow: type: object - properties: *ref_44 - required: *ref_45 + properties: *ref_43 + required: *ref_44 FlowStatusModule: type: object - properties: *ref_53 - required: *ref_54 + properties: *ref_52 + required: *ref_53 FlowStatus: type: object - properties: *ref_66 - required: *ref_67 - Http: - type: object - properties: - type: - type: string - enum: - - http - required: - - type + properties: *ref_65 + required: *ref_66 diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index 635c259f94..118b18b816 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -1195,9 +1195,7 @@ paths: large_file_storage: $ref: "#/components/schemas/LargeFileStorage" git_sync: - type: array - items: - $ref: "#/components/schemas/WorkspaceGitSync" + $ref: "#/components/schemas/WorkspaceGitSyncSettings" default_app: type: string required: @@ -1540,9 +1538,7 @@ paths: type: object properties: git_sync_settings: - type: array - items: - $ref: "#/components/schemas/WorkspaceGitSync" + $ref: "#/components/schemas/WorkspaceGitSyncSettings" responses: "200": @@ -9508,7 +9504,28 @@ components: - useSSL - pathStyle - WorkspaceGitSync: + WorkspaceGitSyncSettings: + type: object + properties: + include_path: + type: array + items: + type: string + include_type: + type: array + items: + type: string + enum: + - script + - flow + - app + - folder + repositories: + type: array + items: + $ref: "#/components/schemas/GitRepositorySettings" + + GitRepositorySettings: type: object properties: script_path: diff --git a/backend/windmill-api/src/folders.rs b/backend/windmill-api/src/folders.rs index 7d8d14269a..03b3d43994 100644 --- a/backend/windmill-api/src/folders.rs +++ b/backend/windmill-api/src/folders.rs @@ -212,7 +212,7 @@ async fn create_folder( &authed.username, &db, &w_id, - DeployedObject::Folder { path: format!("f/{}/folder.meta.*", ng.name) }, + DeployedObject::Folder { path: format!("f/{}", ng.name) }, Some(format!("Folder '{}' created", ng.name)), rsmq, true, @@ -500,7 +500,7 @@ async fn delete_folder( &authed.username, &db, &w_id, - DeployedObject::Folder { path: format!("f/{}/folder.meta.*", name) }, + DeployedObject::Folder { path: format!("f/{}", name) }, Some(format!("Folder '{}' deleted", name)), rsmq, true, diff --git a/backend/windmill-api/src/granular_acls.rs b/backend/windmill-api/src/granular_acls.rs index 6b7892aa74..f7c984d0e7 100644 --- a/backend/windmill-api/src/granular_acls.rs +++ b/backend/windmill-api/src/granular_acls.rs @@ -88,7 +88,7 @@ async fn add_granular_acl( &authed.username, &db, &w_id, - DeployedObject::Folder { path: format!("f/{}/folder.meta.*", path) }, + DeployedObject::Folder { path: format!("f/{}", path) }, Some(format!("Folder '{}' changed permissions", path)), rsmq, true, @@ -201,7 +201,7 @@ async fn remove_granular_acl( &authed.username, &db, &w_id, - DeployedObject::Folder { path: format!("f/{}/folder.meta.*", path) }, + DeployedObject::Folder { path: format!("f/{}", path) }, Some(format!("Folder '{}' changed permissions", path)), rsmq, true, diff --git a/backend/windmill-api/src/workspaces.rs b/backend/windmill-api/src/workspaces.rs index 71a2d87c94..fd51681e01 100644 --- a/backend/windmill-api/src/workspaces.rs +++ b/backend/windmill-api/src/workspaces.rs @@ -45,7 +45,7 @@ use windmill_common::schedule::Schedule; use windmill_common::users::username_to_permissioned_as; use windmill_common::variables::build_crypt; use windmill_common::worker::CLOUD_HOSTED; -use windmill_common::workspaces::WorkspaceGitRepo; +use windmill_common::workspaces::WorkspaceGitSyncSettings; use windmill_common::{ error::{to_anyhow, Error, JsonResult, Result}, flows::Flow, @@ -165,7 +165,7 @@ pub struct WorkspaceSettings { pub error_handler_extra_args: Option, pub error_handler_muted_on_cancel: Option, pub large_file_storage: Option, // effectively: DatasetsStorage - pub git_sync: Option, // effectively: WorkspaceGitRepo + pub git_sync: Option, // effectively: WorkspaceGitSyncSettings pub default_app: Option, } @@ -1143,7 +1143,7 @@ async fn edit_large_file_storage_config( #[derive(Deserialize)] struct EditGitSyncConfig { - git_sync_settings: Option>, + git_sync_settings: Option, } async fn edit_git_sync_config( @@ -1177,7 +1177,7 @@ async fn edit_git_sync_config( .await?; if let Some(git_sync_settings) = new_config.git_sync_settings { - let serialized_config = serde_json::to_value::>(git_sync_settings) + let serialized_config = serde_json::to_value::(git_sync_settings) .map_err(|err| Error::InternalErr(err.to_string()))?; sqlx::query!( diff --git a/backend/windmill-common/src/workspaces.rs b/backend/windmill-common/src/workspaces.rs index 0a5a99bb03..33ff3a0fb3 100644 --- a/backend/windmill-common/src/workspaces.rs +++ b/backend/windmill-common/src/workspaces.rs @@ -1,7 +1,23 @@ use serde::{Deserialize, Serialize}; +#[derive(Serialize, Deserialize, Debug, Default)] +pub struct WorkspaceGitSyncSettings { + pub include_path: Vec, + pub include_type: Vec, + pub repositories: Vec, +} + +#[derive(Serialize, Deserialize, PartialEq, Debug)] +#[serde(rename_all(serialize = "lowercase", deserialize = "lowercase"))] +pub enum ObjectType { + Script, + Flow, + App, + Folder, +} + #[derive(Serialize, Deserialize, Debug)] -pub struct WorkspaceGitRepo { +pub struct GitRepositorySettings { pub script_path: String, pub git_repo_resource_path: String, pub use_individual_branch: Option, diff --git a/backend/windmill-git-sync/Cargo.toml b/backend/windmill-git-sync/Cargo.toml index e3de11bcc6..a6971ad45c 100644 --- a/backend/windmill-git-sync/Cargo.toml +++ b/backend/windmill-git-sync/Cargo.toml @@ -20,4 +20,5 @@ serde_json.workspace = true tracing.workspace = true windmill-common = { workspace = true, features = ["axum"] } windmill-queue.workspace = true -rsmq_async.workspace = true \ No newline at end of file +rsmq_async.workspace = true +regex = "1.10.3" \ No newline at end of file diff --git a/backend/windmill-git-sync/src/lib.rs b/backend/windmill-git-sync/src/lib.rs index 94aee30db4..8ae1f5f759 100644 --- a/backend/windmill-git-sync/src/lib.rs +++ b/backend/windmill-git-sync/src/lib.rs @@ -11,8 +11,9 @@ use std::collections::HashMap; use sqlx::{Pool, Postgres}; use uuid::Uuid; use windmill_common::users::SUPERADMIN_SYNC_EMAIL; -use windmill_common::workspaces::WorkspaceGitRepo; +use windmill_common::workspaces::{ObjectType, WorkspaceGitSyncSettings}; +use regex::Regex; use serde_json::json; use windmill_common::error::{Error, Result}; use windmill_common::jobs::JobPayload; @@ -59,23 +60,44 @@ pub async fn handle_deployment_metadata<'c, R: rsmq_async::RsmqConnection + Send rsmq: Option, skip_db_insert: bool, ) -> Result<()> { - let exclude_path_prefix = "u/"; - let obj_path = if obj.get_path().starts_with(exclude_path_prefix) { - None - } else { + let workspace_git_repo_setting = sqlx::query_scalar!( + "SELECT git_sync FROM workspace_settings WHERE workspace_id = $1", + w_id + ) + .fetch_one(db) + .await + .map_err(|err| { + Error::BadRequest(format!( + "No workspace settings found for workspace ID: {} - Error: {}", + w_id, + err.to_string() + )) + })?; + + let workspace_git_sync_settings = workspace_git_repo_setting + .map(|conf| serde_json::from_value::(conf).ok()) + .flatten() + .unwrap_or_default(); + + let obj_path = if one_regexp_match( + obj.get_path(), + workspace_git_sync_settings.include_path.clone(), + ) { Some(obj.get_path()) + } else { + None }; let obj_parent_path = if obj .get_parent_path() - .unwrap_or(exclude_path_prefix.to_string()) - .starts_with(exclude_path_prefix) + .map(|p| one_regexp_match(p.as_str(), workspace_git_sync_settings.include_path)) + .unwrap_or(false) { - None - } else { obj.get_parent_path() + } else { + None }; - let skip_git_sync = if obj_path.is_none() && obj_parent_path.is_none() { + let mut skip_git_sync = if obj_path.is_none() && obj_parent_path.is_none() { tracing::debug!( "Ignoring {} from git sync as it's in a private user folder", obj.get_path() @@ -85,28 +107,31 @@ pub async fn handle_deployment_metadata<'c, R: rsmq_async::RsmqConnection + Send false }; - let workspace_git_repo_setting = sqlx::query_scalar!( - "SELECT git_sync FROM workspace_settings WHERE workspace_id = $1", - w_id - ) - .fetch_optional(db) - .await?; + skip_git_sync = skip_git_sync + || match obj { + DeployedObject::Script { .. } => !workspace_git_sync_settings + .include_type + .iter() + .any(|element| *element == ObjectType::Script), + DeployedObject::Flow { .. } => !workspace_git_sync_settings + .include_type + .iter() + .any(|element| *element == ObjectType::Flow), + DeployedObject::App { .. } => !workspace_git_sync_settings + .include_type + .iter() + .any(|element| *element == ObjectType::App), + DeployedObject::Folder { .. } => !workspace_git_sync_settings + .include_type + .iter() + .any(|element| *element == ObjectType::Folder), + }; - if workspace_git_repo_setting.is_none() { - return Err(Error::InternalErr( - "No workspace settings found for workspace ID".to_string(), - )); - } - - let workspace_git_repos = workspace_git_repo_setting - .unwrap() - .map(|conf| serde_json::from_value::>(conf).ok()) - .flatten() - .unwrap_or_default(); + tracing::debug!("Skipping git sync for {:?} -> {}", obj_path, skip_git_sync); let mut git_sync_job_uuids: Vec = vec![]; if !skip_git_sync { - for workspace_git_repo in workspace_git_repos { + for workspace_git_repo in workspace_git_sync_settings.repositories { let mut args: HashMap = HashMap::new(); args.insert( "repo_url_resource_path".to_string(), @@ -236,3 +261,43 @@ pub async fn handle_deployment_metadata<'c, R: rsmq_async::RsmqConnection + Send return Ok(()); } + +fn one_regexp_match(path: &str, regexps: Vec) -> bool { + let has_match = regexps + .iter() + .map(|regexp| transform_regexp(regexp.to_owned())) + .filter(|regexp| regexp.is_some()) + .map(|regexp| regexp.unwrap()) + .any(|regexp| regexp.is_match(path)); + tracing::debug!( + "{} matches the set of regexps {:?} -> {}", + path, + regexps, + has_match + ); + return has_match; +} + +fn transform_regexp(user_regexp: String) -> Option { + // this is annoying b/c we want to replace ** with [a-zA-Z0-9_.*/]* AND THEN * with [a-zA-Z0-9_.*]* - but b/c the + // first replacement string contains itself '*', we can't do it naively. So, the hack is to use a different + // character in the replacement string, instead of '*' we use here '%', and finally we replace all '%' with '*' + let mut regexp = user_regexp + .replace("**", "[a-zA-Z0-9_.%/]%") + .replace("*", "[a-zA-Z0-9_.%]%"); + regexp = regexp.replace("%", "*"); + // Then we add ^ at the beginning and '$' at the end to match the entire string, not just a substring + regexp = if regexp.starts_with("^") { + regexp + } else { + format!("^{}", regexp) + }; + regexp = if regexp.ends_with("$") { + regexp + } else { + format!("{}$", regexp) + }; + let compiled_regexp = Regex::new(regexp.as_str()).ok(); + tracing::debug!("Compiled regexp: {:?}", compiled_regexp); + return compiled_regexp; +} diff --git a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte index 9c82e87a0d..f61708828a 100644 --- a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte @@ -33,13 +33,14 @@ } from '$lib/stores' import { sendUserToast } from '$lib/toast' import { setQueryWithoutLoad, emptyString, tryEvery } from '$lib/utils' - import { Scroll, Slack, XCircle, RotateCw, CheckCircle2 } from 'lucide-svelte' + import { Scroll, Slack, XCircle, RotateCw, CheckCircle2, X, Plus } from 'lucide-svelte' import BarsStaggered from '$lib/components/icons/BarsStaggered.svelte' import PremiumInfo from '$lib/components/settings/PremiumInfo.svelte' import Toggle from '$lib/components/Toggle.svelte' import TestOpenaiKey from '$lib/components/copilot/TestOpenaiKey.svelte' import Portal from 'svelte-portal' + import { fade } from 'svelte/transition' let s3FileViewer: S3FilePicker @@ -64,10 +65,19 @@ publicResource: boolean | undefined } let gitSyncSettings: { - script_path: string - git_repo_resource_path: string - use_individual_branch: boolean - }[] + include_path: string[] + repositories: { + script_path: string + git_repo_resource_path: string + use_individual_branch: boolean + }[] + include_type: { + scripts: boolean + flows: boolean + apps: boolean + folders: boolean + } + } let gitSyncTestJobs: { jobId: string | undefined status: 'running' | 'success' | 'failure' | undefined @@ -208,7 +218,7 @@ async function editWindmillGitSyncSettings(): Promise { let alreadySeenResource: string[] = [] - let finalSettings = gitSyncSettings.map((elmt) => { + let repositories = gitSyncSettings.repositories.map((elmt) => { alreadySeenResource.push(elmt.git_repo_resource_path) return { script_path: elmt.script_path, @@ -216,15 +226,38 @@ use_individual_branch: elmt.use_individual_branch } }) + + let include_path = gitSyncSettings.include_path.filter((elmt) => { + return !emptyString(elmt) + }) + + let include_type: ('script' | 'flow' | 'app' | 'folder')[] = [] + if (gitSyncSettings.include_type.scripts) { + include_type.push('script') + } + if (gitSyncSettings.include_type.flows) { + include_type.push('flow') + } + if (gitSyncSettings.include_type.apps) { + include_type.push('app') + } + if (gitSyncSettings.include_type.folders) { + include_type.push('folder') + } + if (alreadySeenResource.some((res, index) => alreadySeenResource.indexOf(res) !== index)) { sendUserToast('Same Git resource used more than once', true) return } - if (finalSettings.length > 0) { + if (repositories.length > 0 || include_path.length > 1 || include_path[0] !== 'f/**') { await WorkspaceService.editWorkspaceGitSyncConfig({ workspace: $workspaceStore!, requestBody: { - git_sync_settings: finalSettings + git_sync_settings: { + repositories: repositories, + include_path: include_path, + include_type: include_type + } } }) sendUserToast('Workspace Git sync settings updated') @@ -310,28 +343,45 @@ publicResource: undefined } } - if ( - settings.git_sync !== undefined && - settings.git_sync !== null && - settings.git_sync.length > 0 - ) { - gitSyncSettings = settings.git_sync.map((settings) => { - return { - git_repo_resource_path: settings.git_repo_resource_path.replace('$res:', ''), - script_path: settings.script_path, - use_individual_branch: settings.use_individual_branch ?? false + if (settings.git_sync !== undefined && settings.git_sync !== null) { + gitSyncTestJobs = [] + gitSyncSettings = { + include_path: + settings.git_sync.include_path?.length ?? 0 > 0 + ? settings.git_sync.include_path ?? [] + : ['f/**'], + repositories: (settings.git_sync.repositories ?? []).map((settings) => { + gitSyncTestJobs.push({ + jobId: undefined, + status: undefined + }) + return { + git_repo_resource_path: settings.git_repo_resource_path.replace('$res:', ''), + script_path: settings.script_path, + use_individual_branch: settings.use_individual_branch ?? false + } + }), + include_type: { + scripts: (settings.git_sync.include_type?.indexOf('script') ?? -1) >= 0, + flows: (settings.git_sync.include_type?.indexOf('flow') ?? -1) >= 0, + apps: (settings.git_sync.include_type?.indexOf('app') ?? -1) >= 0, + folders: (settings.git_sync.include_type?.indexOf('folder') ?? -1) >= 0 } - }) - gitSyncTestJobs = settings.git_sync.map((settings) => { - return { - jobId: undefined, - status: undefined - } - }) + } } else { - gitSyncSettings = [] + gitSyncSettings = { + include_path: ['f/**'], + repositories: [], + include_type: { + scripts: true, + flows: true, + apps: true, + folders: true + } + } gitSyncTestJobs = [] } + console.log(gitSyncSettings) // check openai_client_credentials_oauth usingOpenaiClientCredentialsOauth = await ResourceService.existsResourceType({ @@ -381,15 +431,15 @@ } async function runGitSyncTestJob(settingsIdx: number) { - let gitSyncSettingsElmt = gitSyncSettings[settingsIdx] - if (emptyString(gitSyncSettingsElmt.script_path)) { + let gitSyncRepository = gitSyncSettings.repositories[settingsIdx] + if (emptyString(gitSyncRepository.script_path)) { return } let jobId = await JobService.runScriptByPath({ workspace: $workspaceStore!, path: 'hub/7925/git-repo-test-read-write-windmill', requestBody: { - repo_url_resource_path: gitSyncSettingsElmt.git_repo_resource_path.replace('$res:', '') + repo_url_resource_path: gitSyncRepository.git_repo_resource_path.replace('$res:', '') } }) gitSyncTestJobs[settingsIdx] = { @@ -852,28 +902,19 @@ scripts, flows and apps to the repository on each deploy. -
{#if !$enterpriseLicense} Automatically saving scripts to a Git repository on each deploy is a Windmill EE feature.
{/if} - - All scripts, flows and apps located in the workspace will be pushed to the Git repository, - except the ones that are saved in private user folders (i.e. where the path starts with - `u/`, use those with `f/` instead). -
- Filtering out certain sensitive folders from the sync will be available soon. -
{#if $enterpriseLicense}
{/if} - {#if Array.isArray(gitSyncSettings)} - {#each gitSyncSettings as gitSyncSettingsElmt, idx} -
-
Repository #{idx + 1}
+ +
+
+ {#if Array.isArray(gitSyncSettings.include_path)} +

Filter on path + Only scripts, flows and apps with their path matching one of those filters will be + synced to the Git repositories below. The filters allow '*'' and '**' characters, + with '*'' matching any character allowed in paths until the next slash (/) and '**' + matching anything including slashes. +
By default everything in folders will be synced. +

+ {#each gitSyncSettings.include_path as gitSyncRegexpPath, idx} +
+ + +
+ {/each} + {/if} +
+
+
+ +
+

Filter on type + On top of the filter path above, you can include only certain type of object to be + synced with the Git repository. +
By default everything is synced. +

+
+ + + +
+
+
+ +

Repositories to sync + The changes will be deployed to all the repositories set below. +

+ {#if Array.isArray(gitSyncSettings.repositories)} + {#each gitSyncSettings.repositories as gitSyncRepository, idx} +
+
Repository #{idx + 1}
+ +
- {#key gitSyncSettingsElmt} + {#key gitSyncRepository} { - gitSyncSettingsElmt.git_repo_resource_path = ev.detail + gitSyncRepository.git_repo_resource_path = ev.detail }} />
- {#if gitSyncSettings.filter((settings) => settings.git_repo_resource_path === gitSyncSettingsElmt.git_repo_resource_path).length > 1} + {#if gitSyncSettings.repositories.filter((settings) => settings.git_repo_resource_path === gitSyncRepository.git_repo_resource_path).length > 1} Using the same resource twice is not allowed. {/if} {#if gitSyncTestJobs[idx].status !== undefined} @@ -939,12 +1059,12 @@
{#if gitSyncSettings} {/if} @@ -956,11 +1076,13 @@ - + Add connection +