Skip to content

Commit ff95046

Browse files
Merge pull request #452 from sf-aastha-paruthi/u/aparuthi/release260OmnistudioPackageBlitzFixes
chore: blitz fixes
2 parents e199533 + 7581ef9 commit ff95046

File tree

8 files changed

+331
-25
lines changed

8 files changed

+331
-25
lines changed

messages/assess.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"invalidOrRepeatingOmniscriptElementNames": "Omniscript with invalid or duplicate element names found. Rename your Omniscript elements and try again.",
2020
"duplicatedCardName": "Flexcard with duplicate name found in this org. Modify your Flexcard and try again.",
2121
"duplicatedDrName": "Data Mapper with duplicate name found in this org. Rename your Data Mapper and try again.",
22-
"duplicatedOSName": "Omniscript with duplicate name, type, subtype, or language found in this org. Modify your Omniscript and try again.",
22+
"duplicatedOSName": "%s with duplicate name, type, subtype, or language found in this org. Modify your %s and try again.",
2323
"duplicatedName": "Duplicated name %s",
2424
"lowerVersionDuplicateOmniscriptName": "A %s with name \"%s\" will not be migrated because lower version of same %s will be marked as duplicate, which could lead to conflicts during migration.",
2525
"errorWhileActivatingOs": "We couldn't activate your %s:",
@@ -174,7 +174,7 @@
174174
"manualInterventionForExperienceSite": "We couldn’t process the %s component because no key was found.",
175175
"manualInterventionForExperienceSiteAsFailure": "We couldn’t process the %s component. ",
176176
"manualInterventionForExperienceSiteAsDuplicateKey": "We couldn’t process the %s component because a duplicate key was found. ",
177-
"manualInterventionForExperienceSiteConfiguration": "We couldn’t process the %s Experience site because of the error %s in the Experience Cloud site configuration.",
177+
"manualInterventionForExperienceSiteConfiguration": "We couldn’t process the %s Experience site because of error in the Experience Cloud site configuration.",
178178
"updatingStorageForOmniscipt": "Preparing storage for Omniscripts",
179179
"keyAlreadyInStorage": "The %s %s name already exists in storage.",
180180
"flexcardStorageProcessingStarted": "Preparing storage for Flexcards.",

messages/migrate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"lowerVersionDuplicateCardName": "Flexcard with name %s can't be migrated because lower version of same card is probable duplicate. Rename your Flexcard and try again.",
2323
"duplicatedCardName": "Flexcard with duplicate name %s found in this org. Rename your Flexcard and try again.",
2424
"duplicatedDrName": "Data Mapper with duplicate name found in this org. Rename your Data Mapper and try again.",
25-
"duplicatedOSName": "Omniscript with duplicate name, type, subtype, or language found in this org. Modify your Omniscript and try again.",
25+
"duplicatedOSName": "%s with duplicate name, type, subtype, or language found in this org. Modify your %s and try again.",
2626
"lowerVersionDuplicateOSName": "%s with name %s can't be migrated because lower version of same %s is probable duplicate. Rename your %s and try again.",
2727
"errorWhileActivatingOs": "We couldn't activate your %s:",
2828
"errorWhileActivatingCard": "We couldn't activate your Flexcard:",
@@ -166,7 +166,7 @@
166166
"emptyTargetData": "The Target Name is empty. Check your Experience Cloud site configuration",
167167
"manualInterventionForExperienceSiteAsFailure": "We couldn’t process the %s component.",
168168
"manualInterventionForExperienceSiteAsDuplicateKey": "We couldn’t process the %s component because a duplicate key was found.",
169-
"manualInterventionForExperienceSiteConfiguration": "We couldn’t process the %s Experience site because of the error %s in the Experience Cloud site configuration.",
169+
"manualInterventionForExperienceSiteConfiguration": "We couldn’t process the %s Experience site because of error in the Experience Cloud site configuration.",
170170
"updatingStorageForOmniscipt": "Preparing storage for Omniscripts %s",
171171
"keyAlreadyInStorage": "The %s %s name already exists in storage.",
172172
"flexcardStorageProcessingStarted": "Preparing storage for Flexcards.",

src/commands/omnistudio/migration/migrate.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,6 @@ export default class Migrate extends OmniStudioBaseCommand {
227227
if (!migrateOnly) {
228228
await postMigrate.executeTasks(namespace, actionItems);
229229
}
230-
// From here also actionItems need to be collected
231-
await postMigrate.restoreExperienceAPIMetadataSettings(
232-
isExperienceBundleMetadataAPIProgramaticallyEnabled,
233-
actionItems
234-
);
235230

236231
const migrationActionItems = this.collectActionItems(objectMigrationResults);
237232
actionItems = [...actionItems, ...migrationActionItems];

src/error/errorInterfaces.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,14 @@ export class TargetPropertyNotFoundError extends Error {
2828
this.componentName = componentName;
2929
}
3030
}
31+
32+
export class ProcessingError extends Error {
33+
public componentType: string;
34+
public key: string;
35+
36+
public constructor(key: string, componentType: string) {
37+
super(`Key ${key} can not be processed`);
38+
this.key = key;
39+
this.componentType = componentType;
40+
}
41+
}

src/migration/related/ExperienceSiteMigration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ export class ExperienceSiteMigration extends BaseRelatedObjectMigration {
441441
// Look up in osStandardStorage using the object key
442442
const targetDataFromStorage: OmniScriptStorage = StorageUtil.getStandardOmniScript(storage, lookupKey);
443443

444-
if (this.shouldAddWarning(targetDataFromStorage)) {
444+
if (targetDataFromStorage === undefined || targetDataFromStorage.migrationSuccess === false) {
445+
// For the standard wrapper we only need to check the storage empty and migrationSuccess status
445446
const originalKey = `${currentType}_${currentSubType}_${currentLanguage}`;
446447
const warningMsg: string = this.getWarningMessage(originalKey, targetDataFromStorage);
447448
experienceSiteAssessmentInfo.warnings.push(warningMsg);

src/migration/related/FlexipageMigration.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ import { XMLUtil } from '../../utils/XMLUtil';
1616
import { FileDiffUtil } from '../../utils/lwcparser/fileutils/FileDiffUtil';
1717
import { transformFlexipageBundle } from '../../utils/flexipage/flexiPageTransformer';
1818
import { Flexipage } from '../interfaces';
19-
import { DuplicateKeyError, KeyNotFoundInStorageError, TargetPropertyNotFoundError } from '../../error/errorInterfaces';
19+
import {
20+
DuplicateKeyError,
21+
KeyNotFoundInStorageError,
22+
ProcessingError,
23+
TargetPropertyNotFoundError,
24+
} from '../../error/errorInterfaces';
2025
import { BaseRelatedObjectMigration } from './BaseRealtedObjectMigration';
2126

2227
/**
@@ -129,7 +134,7 @@ export class FlexipageMigration extends BaseRelatedObjectMigration {
129134
if (error instanceof KeyNotFoundInStorageError) {
130135
errors.add(`${error.componentType} ${error.key} can't be migrated`);
131136
status = mode === 'assess' ? 'Needs manual intervention' : 'Skipped';
132-
} else if (error instanceof TargetPropertyNotFoundError) {
137+
} else if (error instanceof TargetPropertyNotFoundError || error instanceof ProcessingError) {
133138
errors.add(error.message);
134139
status = mode === 'assess' ? 'Needs manual intervention' : 'Skipped';
135140
} else if (error instanceof DuplicateKeyError) {

src/utils/flexipage/flexiPageTransformer.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { DuplicateKeyError, KeyNotFoundInStorageError, TargetPropertyNotFoundError } from '../../error/errorInterfaces';
8+
import {
9+
DuplicateKeyError,
10+
KeyNotFoundInStorageError,
11+
ProcessingError,
12+
TargetPropertyNotFoundError,
13+
} from '../../error/errorInterfaces';
914
import {
1015
Flexipage,
1116
FlexiComponentInstanceProperty,
@@ -177,6 +182,10 @@ function createNewPropsForOmniScript(
177182
throw new KeyNotFoundInStorageError(nameKey, 'Omniscript');
178183
}
179184

185+
if (!migratedScriptName.migrationSuccess) {
186+
throw new ProcessingError(nameKey, 'Omniscript');
187+
}
188+
180189
if (migratedScriptName.isDuplicate) {
181190
throw new DuplicateKeyError(nameKey, 'Omniscript');
182191
}
@@ -215,6 +224,10 @@ function createNewPropsForFlexCard(
215224
throw new KeyNotFoundInStorageError(nameKey, 'Flexcard');
216225
}
217226

227+
if (!migratedCardName.migrationSuccess) {
228+
throw new ProcessingError(nameKey, 'Flexcard');
229+
}
230+
218231
if (migratedCardName.isDuplicate) {
219232
throw new DuplicateKeyError(nameKey, 'Flexcard');
220233
}
@@ -253,8 +266,14 @@ function createNewPropsForStandardOmniScript(
253266
// Look up in osStandardStorage using the object key
254267
const targetDataFromStorage: OmniScriptStorage | undefined = StorageUtil.getStandardOmniScript(storage, lookupKey);
255268

269+
const nameKey = `${currentType}_${currentSubType}_${currentLanguage}`;
270+
256271
if (!targetDataFromStorage) {
257-
throw new KeyNotFoundInStorageError(`${currentType}_${currentSubType}_${currentLanguage}`, 'Omniscript');
272+
throw new KeyNotFoundInStorageError(nameKey, 'Omniscript');
273+
}
274+
275+
if (!targetDataFromStorage.migrationSuccess) {
276+
throw new ProcessingError(nameKey, 'Omniscript');
258277
}
259278

260279
// Return the new properties
@@ -287,6 +306,10 @@ function createNewPropsForStandardFlexCard(
287306
throw new DuplicateKeyError(currentFlexCardName, 'Flexcard');
288307
}
289308

309+
if (!targetDataFromStorage.migrationSuccess) {
310+
throw new ProcessingError(currentFlexCardName, 'Flexcard');
311+
}
312+
290313
if (targetDataFromStorage.error) {
291314
throw new Error(targetDataFromStorage.error.join('\n\n'));
292315
}

0 commit comments

Comments
 (0)