Skip to content

Commit

Permalink
Merge pull request #1083 from cdapio/revert-CDAP-20641
Browse files Browse the repository at this point in the history
Revert "remove overwriteConfig"
  • Loading branch information
sumengwang authored Aug 2, 2023
2 parents ca51aec + ca01761 commit 66fae23
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const ConfigModelessActionButtons = ({ ...props }: IConfigModelessActionB
setSaveLoading(true);
const observable = Observable.forkJoin(
updatePipeline(lifecycleManagementEditEnabled),
updatePreferences()
updatePreferences(lifecycleManagementEditEnabled)
);
observable.subscribe(
() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,17 @@ 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(
(runtimeArg) => !runtimeArg.provided
);
let appId = PipelineDetailStore.getState().name;
let prefObj = convertKeyValuePairsObjToMap(runtimeArgs);
if (lifecycleManagementEditEnabled) {
prefObj = { ...prefObj, 'app.pipeline.overwriteConfig': 'true' };
}

return MyPreferenceApi.setAppPreferences(
{
Expand Down
1 change: 1 addition & 0 deletions app/cdap/services/global-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
Expand All @@ -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"));
}
Expand Down

0 comments on commit 66fae23

Please sign in to comment.