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
This commit is contained in:
Manish Kumar 2022-12-15 16:17:03 +07:00 committed by GitHub
parent 051444f221
commit 2445a3c625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -682,7 +682,7 @@ public class NewActionServiceCEImpl extends BaseService<NewActionRepository, New
* @param actionDTOMono
* @return datasourceMono
*/
protected Mono<Datasource> getCachedDatasourceForActionExecution(Mono<ActionDTO> actionDTOMono) {
protected Mono<Datasource> getCachedDatasourceForActionExecution(Mono<ActionDTO> actionDTOMono, String environmentName) {
return actionDTOMono
.flatMap(actionDTO -> datasourceService.getValidDatasourceFromActionMono(actionDTO,
@ -976,7 +976,7 @@ public class NewActionServiceCEImpl extends BaseService<NewActionRepository, New
Mono<ActionDTO> actionDTOMono = getCachedActionDTOForActionExecution(actionMono, executeActionDTO, actionId);
// 3. Instantiate the implementation class based on the query type
Mono<Datasource> datasourceMono = getCachedDatasourceForActionExecution(actionDTOMono);
Mono<Datasource> datasourceMono = getCachedDatasourceForActionExecution(actionDTOMono, environmentName);
Mono<Plugin> pluginMono = getCachedPluginForActionExecution(datasourceMono, actionId);
Mono<PluginExecutor> pluginExecutorMono = pluginExecutorHelper.getPluginExecutor(pluginMono);