From 2445a3c62519d40cae39d8d70abfe3fa42935f08 Mon Sep 17 00:00:00 2001 From: Manish Kumar <107841575+sondermanish@users.noreply.github.com> Date: Thu, 15 Dec 2022 16:17:03 +0700 Subject: [PATCH] chore: method signature changed for getCachedDatasourceForActtionExecution (#18950) ## Description > To accommodate for datasource context adaption for environments, Some datasourceService methods needs to be aware of `environment name` in order to evaluate the `datasource configuration` for the given environment > TL; DR : This Pr changes method signature for fetching datasource by actionId Fixes #18760 Ref #18762 ## Type of change > Chore ## How Has This Been Tested? - Manual - Jest ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag --- .../appsmith/server/services/ce/NewActionServiceCEImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/NewActionServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/NewActionServiceCEImpl.java index f4f020dca3..00447d4735 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/NewActionServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/NewActionServiceCEImpl.java @@ -682,7 +682,7 @@ public class NewActionServiceCEImpl extends BaseService getCachedDatasourceForActionExecution(Mono actionDTOMono) { + protected Mono getCachedDatasourceForActionExecution(Mono actionDTOMono, String environmentName) { return actionDTOMono .flatMap(actionDTO -> datasourceService.getValidDatasourceFromActionMono(actionDTO, @@ -976,7 +976,7 @@ public class NewActionServiceCEImpl extends BaseService actionDTOMono = getCachedActionDTOForActionExecution(actionMono, executeActionDTO, actionId); // 3. Instantiate the implementation class based on the query type - Mono datasourceMono = getCachedDatasourceForActionExecution(actionDTOMono); + Mono datasourceMono = getCachedDatasourceForActionExecution(actionDTOMono, environmentName); Mono pluginMono = getCachedPluginForActionExecution(datasourceMono, actionId); Mono pluginExecutorMono = pluginExecutorHelper.getPluginExecutor(pluginMono);