Skip to content

Commit 9869596

Browse files
committed
Merge branch 'prerelease/develop-ga' into flexipage_fixes
2 parents 310de73 + 1252201 commit 9869596

29 files changed

+1223
-305
lines changed

messages/assess.json

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
"integrationProcedureNameChangeMessage": "Integration Procedure reference %s will be changed to %s during migration.",
103103
"integrationProcedureManualUpdateMessage": "Integration Procedure reference %s may need manual updates after migration.",
104104
"duplicateCardNameMessage": "Potential duplicate: Another card has the same name %s after name cleaning. This may cause conflicts during migration",
105-
"globalAutoNumberNameChangeMessage": "GlobalAutoNumber name will be changed from %s to %s to follow API naming standards",
106105
"duplicateGlobalAutoNumberNameMessage": "Potential duplicate: Another Global Auto Number has the same name %s after name cleaning. This may cause conflicts during migration",
107106
"existingApexPrompt": "Do you have a sfdc project that already contains the APEX classes retrieved from your org? [y/n]",
108107
"enterExistingProjectPath": "Enter the path to the project folder that contains the retrieved APEX classes:",
@@ -137,5 +136,52 @@
137136
"generatedDiffForFile": "Generated diff for file: %s",
138137
"errorProcessingFlexiPage": "Error processing flexipage file: %s, %s",
139138
"flexipagesWithChanges": "Found %s flexipage files with changes",
140-
"migratingFlexiPages": "Migrating FlexiPages"
139+
"migratingFlexiPages": "Migrating FlexiPages",
140+
"experienceSiteMetadataConsent": "The consent for exp site is %s",
141+
"experienceSiteConsentNotProvidedWarning": "Consent for experience sites is not provided. Experience sites will not be processed",
142+
"relatedObjectsToProcessAfterExpSitesRemoval": "Objects to process after removing expsite are",
143+
"experienceBundleMetadataAPIAlreadyEnabled": "ExperienceBundle metadata api is already enabled",
144+
"enableExperienceBundleMetadataAPIProgramatically": "ExperienceBundle metadata api needs to be programatically enabled",
145+
"unableToEnableExperienceBundleMetadataAPI": "Since the api could not able enabled the experience sites would not be processed",
146+
"relatedObjectsToProcess": "Objects to process are",
147+
"consentForExperienceSites": "'By proceeding further, you hereby consent to enable digital experience metadata api(y/n). If y sites will be processed, if n expsites will not be processed';",
148+
"failedToGetConsentError": "Failed to get user consent: %s",
149+
"settingDesignersToStandardModel": "Setting designers to use the standard data model",
150+
"errorSettingDesignersToStandardModel": "Error occurred while setting designers to use the standard data model",
151+
"designersSetToStandardModel": "Successfully executed setDesignersToUseStandardDataModel",
152+
"exceptionSettingDesignersToStandardModel": "Exception occurred while setting designers to use the standard data model",
153+
"noRelatedObjects": "No related objects to process",
154+
"turnOffExperienceBundleAPI": "Since ExperienceSiteMetadata API was programatically enabled, turing it off",
155+
"errorRevertingExperienceBundleMetadataAPI": "Exception occurred while reverting metadata API. Please do that manually",
156+
"processingExperienceSites": "Starting experience sites processing for %s",
157+
"experienceSitesProcessingStarted": "Started processing the experience sites",
158+
"experienceSiteSuccessfullyProcessed": "Successfully processed experience sites for %s",
159+
"readingFile": "Started reading the files",
160+
"totalFileCount": "The total count of files is %s",
161+
"skipNonJsonFile": "Skipping non-JSON file - %s",
162+
"experienceSiteWithOmniWrapperSuccessfullyProcessed": "Successfully processed experience site file having vlocity wrapper",
163+
"fileNotHavingWrapper": "File does not contain vlocity wrapper",
164+
"errorProcessingExperienceSite": "Error processing experience site file",
165+
"experienceSiteReportingDetails": "Only the files in which have vlocity wrapper will be shown in the assessment report",
166+
"processingFile": "Processing for file",
167+
"currentRegionOfExperienceSite": "The current region being processed is %s",
168+
"currentComponentOfExperienceSite": "The current component being processed is %s",
169+
"omniWrapperFound": "Omnistudio wrapper component found",
170+
"printUpdatedObject": "Now printing the updated object %s",
171+
"printDifference": "Printing the difference %s",
172+
"updatingFile": "Updating the file content",
173+
"processingFlexcardComponent": "Started processing FC component %s",
174+
"processingOmniscriptComponent": "Started processing OS component",
175+
"targetData": "The target data is %s",
176+
"manualInterventionForExperienceSite": "%s needs manual intervention as the migrated key does not exist",
177+
"manualInterventionForExperienceSiteAsFailure": "%s needs manual intervention as migration failed",
178+
"manualInterventionForExperienceSiteAsDuplicateKey": "%s needs manual intervention as duplicated key found in storage",
179+
"updatingStorageForOmniscipt": "Started updating storage for omniscript %s",
180+
"keyAlreadyInStorage": "Key %s already exists in storage",
181+
"flexcardStorageProcessingStarted": "Started preparing storage for flexcards",
182+
"errorWhileProcessingFlexcardStorage": "Error occurred while processing key for flexcard storage",
183+
"missingInfo": "Info is missing",
184+
"errorCheckingGlobalAutoNumber": "We couldn’t check whether the Global Auto Number setting is enabled: %s. Try again later.",
185+
"errorMigrationMessage": "Error migrating object: %s",
186+
"nameMappingUndefined": "Name Mapping is undefined"
141187
}

messages/migrate.json

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,59 @@
144144
"startingPostMigrationCleanup": "Starting post-migration cleanup for Global Auto Number...",
145145
"postMigrationCleanupCompleted": "Post-migration cleanup completed successfully.",
146146
"errorDuringPostMigrationCleanup": "We’ve encountered an error during the post-migration cleanup. Try again later.",
147-
"globalAutoNumberNameChangeMessage": "Global Auto Number name has been modified to fit naming rules: %s",
148147
"duplicatedGlobalAutoNumberName": "Duplicated Global Auto Number name",
149148
"errorWhileUploadingGlobalAutoNumber": "An error occurred while uploading Global Auto Number: ",
150149
"startingGlobalAutoNumberAssessment": "Starting Global Auto Number assessment...",
151150
"foundGlobalAutoNumbersToAssess": "Found %s Global Auto Numbers to assess",
152151
"unexpectedError": "An unexpected error occurred during processing",
153-
"migrationValidationFailed": "The post-migration validation has failed.",
152+
"migrationValidationFailed": "Post Migration validation failed.",
153+
"incompleteMigrationDetected": "Incomplete migration detected. Source objects: %s, Target objects: %s.",
154+
"experienceSiteMetadataConsent": "The consent for exp site is %s",
155+
"experienceSiteConsentNotProvidedWarning": "Consent for experience sites is not provided. Experience sites will not be processed",
156+
"relatedObjectsToProcessAfterExpSitesRemoval": "Objects to process after removing expsite are",
157+
"experienceBundleMetadataAPIAlreadyEnabled": "ExperienceBundle metadata api is already enabled",
158+
"enableExperienceBundleMetadataAPIProgramatically": "ExperienceBundle metadata api needs to be programatically enabled",
159+
"unableToEnableExperienceBundleMetadataAPI": "Since the api could not able enabled the experience sites would not be processed",
160+
"relatedObjectsToProcess": "Objects to process are",
161+
"consentForExperienceSites": "'By proceeding further, you hereby consent to enable digital experience metadata api(y/n). If y sites will be processed, if n expsites will not be processed';",
162+
"failedToGetConsentError": "Failed to get user consent: %s",
163+
"settingDesignersToStandardModel": "Setting designers to use the standard data model",
164+
"errorSettingDesignersToStandardModel": "Error occurred while setting designers to use the standard data model",
165+
"designersSetToStandardModel": "Successfully executed setDesignersToUseStandardDataModel",
166+
"exceptionSettingDesignersToStandardModel": "Exception occurred while setting designers to use the standard data model",
167+
"noRelatedObjects": "No related objects to process",
168+
"turnOffExperienceBundleAPI": "Since ExperienceSiteMetadata API was programatically enabled, turing it off",
169+
"errorRevertingExperienceBundleMetadataAPI": "Exception occurred while reverting metadata API. Please do that manually",
170+
"processingExperienceSites": "Starting experience sites processing for %s",
171+
"experienceSitesProcessingStarted": "Started processing the experience sites",
172+
"experienceSiteSuccessfullyProcessed": "Successfully processed experience sites for %s",
173+
"readingFile": "Started reading the files",
174+
"totalFileCount": "The total count of files is %s",
175+
"skipNonJsonFile": "Skipping non-JSON file - %s",
176+
"experienceSiteWithOmniWrapperSuccessfullyProcessed": "Successfully processed experience site file having vlocity wrapper",
177+
"fileNotHavingWrapper": "File does not contain vlocity wrapper",
178+
"errorProcessingExperienceSite": "Error processing experience site file",
179+
"experienceSiteReportingDetails": "Only the files in which have vlocity wrapper will be shown in the assessment report",
180+
"processingFile": "Processing for file",
181+
"currentRegionOfExperienceSite": "The current region being processed is %s",
182+
"currentComponentOfExperienceSite": "The current component being processed is %s",
183+
"omniWrapperFound": "Omnistudio wrapper component found",
184+
"printUpdatedObject": "Now printing the updated object %s",
185+
"printDifference": "Printing the difference %s",
186+
"updatingFile": "Updating the file content",
187+
"processingFlexcardComponent": "Started processing FC component %s",
188+
"processingOmniscriptComponent": "Started processing OS component",
189+
"targetData": "The target data is %s",
190+
"manualInterventionForExperienceSite": "%s needs manual intervention as the migrated key does not exist",
191+
"manualInterventionForExperienceSiteAsFailure": "%s needs manual intervention as migration failed",
192+
"manualInterventionForExperienceSiteAsDuplicateKey": "%s needs manual intervention as duplicated key found in storage",
193+
"updatingStorageForOmniscipt": "Started updating storage for omniscript %s",
194+
"keyAlreadyInStorage": "Key %s already exists in storage",
195+
"flexcardStorageProcessingStarted": "Started preparing storage for flexcards",
196+
"errorWhileProcessingFlexcardStorage": "Error occurred while processing key for flexcard storage",
197+
"missingInfo": "Info is missing",
154198
"incompleteMigrationDetected": "We couldn’t complete the migration process",
155199
"errorCheckingGlobalAutoNumber": "We couldn’t check whether the Global Auto Number setting is enabled: %s. Try again later.",
156-
"errorMigrationMessage": "Error migrating object: %s"
200+
"errorMigrationMessage": "Error migrating object: %s",
201+
"nameMappingUndefined": "Name Mapping is undefined"
157202
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/plugin-omnistudio-migration-tool",
33
"description": "This SFDX plugin migrates FlexCard, OmniScript, DataRaptor, and Integration Procedure custom objects to standard objects.",
4-
"version": "2.0.0-rc.5",
4+
"version": "2.0.0-rc.7",
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {

src/commands/omnistudio/migration/assess.ts

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { OmnistudioOrgDetails, OrgUtils } from '../../../utils/orgUtils';
1515
import { OrgPreferences } from '../../../utils/orgPreferences';
1616
import { Constants } from '../../../utils/constants/stringContants';
1717
import { ProjectPathUtil } from '../../../utils/projectPathUtil';
18+
import { PreMigrate } from '../../../migration/premigrate';
19+
import { PostMigrate } from '../../../migration/postMigrate';
1820

1921
Messages.importMessagesDirectory(__dirname);
2022
const messages = Messages.loadMessages('@salesforce/plugin-omnistudio-migration-tool', 'assess');
@@ -69,8 +71,11 @@ export default class Assess extends OmniStudioBaseCommand {
6971
const allVersions = (this.flags.allversions || false) as boolean;
7072
const assessOnly = (this.flags.only || '') as string;
7173
const relatedObjects = (this.flags.relatedobjects || '') as string;
74+
const isExperienceBundleMetadataAPIProgramaticallyEnabled: { value: boolean } = { value: false };
7275
const conn = this.org.getConnection();
73-
76+
let objectsToProcess: string[];
77+
// To-Do: Add LWC to valid options when GA is released
78+
const validOptions = [Constants.Apex, Constants.ExpSites, Constants.FlexiPage];
7479
if (apiVersion) {
7580
conn.setApiVersion(apiVersion);
7681
} else {
@@ -93,8 +98,16 @@ export default class Assess extends OmniStudioBaseCommand {
9398

9499
const namespace = orgs.packageDetails.namespace;
95100
let projectPath = '';
101+
const preMigrate: PreMigrate = new PreMigrate(this.org, namespace, conn, this.logger, messages, this.ux);
96102
if (relatedObjects) {
103+
objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
97104
projectPath = await ProjectPathUtil.getProjectPath(messages, true);
105+
106+
await preMigrate.handleExperienceSitePrerequisites(
107+
objectsToProcess,
108+
conn,
109+
isExperienceBundleMetadataAPIProgramaticallyEnabled
110+
);
98111
}
99112

100113
const assesmentInfo: AssessmentInfo = {
@@ -108,6 +121,7 @@ export default class Assess extends OmniStudioBaseCommand {
108121
ipAssessmentInfos: [],
109122
},
110123
flexipageAssessmentInfos: [],
124+
experienceSiteAssessmentInfos: [],
111125
};
112126

113127
Logger.log(messages.getMessage('assessmentInitialization', [String(namespace)]));
@@ -124,13 +138,8 @@ export default class Assess extends OmniStudioBaseCommand {
124138
process.exit(1);
125139
}
126140

127-
let objectsToProcess: string[];
128141
// Assess related objects if specified
129142
if (relatedObjects) {
130-
// To-Do: Add LWC to valid options when GA is released
131-
const validOptions = [Constants.Apex, Constants.FlexiPage];
132-
objectsToProcess = relatedObjects.split(',').map((obj) => obj.trim());
133-
134143
// Validate input
135144
for (const obj of objectsToProcess) {
136145
if (!validOptions.includes(obj)) {
@@ -150,14 +159,41 @@ export default class Assess extends OmniStudioBaseCommand {
150159
assesmentInfo.lwcAssessmentInfos = relatedObjectAssessmentResult.lwcAssessmentInfos;
151160
assesmentInfo.apexAssessmentInfos = relatedObjectAssessmentResult.apexAssessmentInfos;
152161
assesmentInfo.flexipageAssessmentInfos = relatedObjectAssessmentResult.flexipageAssessmentInfos;
162+
assesmentInfo.experienceSiteAssessmentInfos = relatedObjectAssessmentResult.experienceSiteAssessmentInfos;
153163
}
154164
try {
155165
orgs.rollbackFlags = await OrgPreferences.checkRollbackFlags(conn);
156166
} catch (error) {
157167
Logger.log((error as Error).message);
158168
Logger.log((error as Error).stack);
159169
}
160-
await AssessmentReporter.generate(assesmentInfo, conn.instanceUrl, orgs, assessOnly, objectsToProcess, messages);
170+
171+
// Post Assessment tasks
172+
const postMigrate: PostMigrate = new PostMigrate(
173+
this.org,
174+
namespace,
175+
conn,
176+
this.logger,
177+
messages,
178+
this.ux,
179+
objectsToProcess
180+
);
181+
182+
const userActionMessages: string[] = [];
183+
await postMigrate.restoreExperienceAPIMetadataSettings(
184+
isExperienceBundleMetadataAPIProgramaticallyEnabled,
185+
userActionMessages
186+
);
187+
188+
await AssessmentReporter.generate(
189+
assesmentInfo,
190+
conn.instanceUrl,
191+
orgs,
192+
assessOnly,
193+
objectsToProcess,
194+
messages,
195+
userActionMessages
196+
);
161197
return assesmentInfo;
162198
}
163199

0 commit comments

Comments
 (0)