diff --git a/app/cdap/components/PipelineConfigurations/ConfigurationsContent/ConfigModelessActionButtons/index.tsx b/app/cdap/components/PipelineConfigurations/ConfigurationsContent/ConfigModelessActionButtons/index.tsx index 27eb82ad8ae..766edb018eb 100644 --- a/app/cdap/components/PipelineConfigurations/ConfigurationsContent/ConfigModelessActionButtons/index.tsx +++ b/app/cdap/components/PipelineConfigurations/ConfigurationsContent/ConfigModelessActionButtons/index.tsx @@ -89,7 +89,7 @@ export const ConfigModelessActionButtons = ({ ...props }: IConfigModelessActionB setSaveLoading(true); const observable = Observable.forkJoin( updatePipeline(lifecycleManagementEditEnabled), - updatePreferences() + updatePreferences(lifecycleManagementEditEnabled) ); observable.subscribe( () => { diff --git a/app/cdap/components/PipelineConfigurations/Store/ActionCreator.js b/app/cdap/components/PipelineConfigurations/Store/ActionCreator.js index 2c33fd504b6..1467e5742d2 100644 --- a/app/cdap/components/PipelineConfigurations/Store/ActionCreator.js +++ b/app/cdap/components/PipelineConfigurations/Store/ActionCreator.js @@ -133,7 +133,7 @@ const getMacrosResolvedByPrefs = (resolvedPrefs = {}, macrosMap = {}) => { return resolvedMacros; }; -const updatePreferences = () => { +const updatePreferences = (lifecycleManagementEditEnabled = false) => { const { runtimeArgs } = PipelineConfigurationsStore.getState(); let filteredRuntimeArgs = cloneDeep(runtimeArgs); filteredRuntimeArgs.pairs = filteredRuntimeArgs.pairs.filter( @@ -141,6 +141,9 @@ const updatePreferences = () => { ); let appId = PipelineDetailStore.getState().name; let prefObj = convertKeyValuePairsObjToMap(runtimeArgs); + if (lifecycleManagementEditEnabled) { + prefObj = { ...prefObj, 'app.pipeline.overwriteConfig': 'true' }; + } return MyPreferenceApi.setAppPreferences( { diff --git a/app/cdap/services/global-constants.js b/app/cdap/services/global-constants.js index 97446e32913..d4670a86f6f 100644 --- a/app/cdap/services/global-constants.js +++ b/app/cdap/services/global-constants.js @@ -358,6 +358,7 @@ const GENERATED_RUNTIMEARGS = { SYSTEM_DRIVER_RESOURCES_CORES: 'task.driver.system.resources.cores', SYSTEM_EXECUTOR_RESOURCES_MEMORY: 'task.executor.system.resources.memory', SYSTEM_EXECUTOR_RESOURCES_CORES: 'task.executor.system.resources.cores', + PIPELINE_CONFIG_OVERWRITE: 'app.pipeline.overwriteConfig', } const SCOPES = { diff --git a/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/CommonSteps.java b/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/CommonSteps.java index e4ee9d6eb9b..46b7f0527ef 100644 --- a/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/CommonSteps.java +++ b/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/CommonSteps.java @@ -280,6 +280,7 @@ public void toggleInstrumentation() { @Then("Save pipeline configure") public void savePipelineConfigure() { ElementHelper.clickOnElement(Helper.locateElementByTestId("config-apply-close")); + WaitHelper.waitForElementToBeHidden(Helper.locateElementByTestId("config-apply-close")); } @Then("Go to pipeline {string} details") diff --git a/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/PipelineEdit.java b/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/PipelineEdit.java index 5bec0636de9..83db510e330 100644 --- a/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/PipelineEdit.java +++ b/src/e2e-test/java/io/cdap/cdap/ui/stepsdesign/PipelineEdit.java @@ -204,6 +204,7 @@ public void checkRuntimeArgsEmpty() { .map(element -> element.findElement(By.tagName("input")).getAttribute("value")) .collect(Collectors.toList()); Assert.assertTrue(stringKeys.size() == 1); + Assert.assertTrue(!stringKeys.contains("app.pipeline.overwriteConfig")); Assert.assertTrue(!stringKeys.contains("app.pipeline.instrumentation")); ElementHelper.clickOnElement(Helper.locateElementByTestId("pipeline-modeless-close-btn")); } @@ -219,6 +220,7 @@ public void checkRuntimeArgsNotEmpty() { .map(element -> element.findElement(By.tagName("input")).getAttribute("value")) .collect(Collectors.toList()); Assert.assertTrue(stringKeys.size() > 1); + Assert.assertTrue(stringKeys.contains("app.pipeline.overwriteConfig")); Assert.assertTrue(stringKeys.contains("app.pipeline.instrumentation")); ElementHelper.clickOnElement(Helper.locateElementByTestId("pipeline-modeless-close-btn")); }