Check datasource validity on loading. #966
Labels
bug
Something isn't working
current
current sprint
gs_service
gs_service
in progress
team is currently working on this feature
P0
Highest priority
The Problem
Currently the dynamic fn [in case of datasource as fn] script of task is not evaluated/compiled beforehand, when it uses
inputs
oroutputs
like references which are available during a workflow call (runtime only).But for other cases where datasource name is statically given or the dynamic fn uses
mappings
orconfig
we can evaluate and check validaity of those in the load time itself. generating the fn in functionloader to check if datasource is available or not.The Solution
Evaluate script beforehand and check if datasource is present in fn as datasource of tasks of a workflow.
How will we solve
fn: <js% datasource.<% config.hello %>.dynamodb.listTables %>
fn: datasource.<% config.hello %>.dynamodb.listTables
fn: <% mappings.datasourcename.for.dbcall %>
fn: <% config.datasourcename.for.dbcall %>
fn: datasource.<%mappings[outputs.create_lender_api_request.data.request_data.headers['pl-product']][outputs.create_lender_api_request.data.request_data.headers['pl-lender']].lender_api_suit[outputs.create_lender_api_request.data.request_data.params?.wrapper_event].datasource%>.get.<%outputs.path_params_url.data.updated_url%>
outputs.
orinputs.
don't log this - because this will be evaluated in runtime. Otherwise process.exit(1) with a fatal log message.The text was updated successfully, but these errors were encountered: