Skip to content

Commit 23b20e1

Browse files
Merge pull request #437 from sf-aastha-paruthi/u/aparuthi/release260MergeFromPrereleaseIteration02
@W-19464609 Merge changes from prerelease iteration02
2 parents f65b65a + 27133bb commit 23b20e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2668
-493
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ oclif.manifest.json
4646
omnistudio_migration
4747

4848
assessment_reports/
49-
migration_report/
49+
migration_reports/
5050
.sfdx/
5151
package.xml

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ sfdx omnistudio:migration:migrate -u [email protected] --only=autonum
114114

115115
```
116116
USAGE
117-
$ sf omnistudio:migration:assess [-f] [-v <string>] [-u <string>] [--loglevel
117+
$ sf omnistudio:migration:assess [-v <string>] [-u <string>] [--loglevel
118118
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
119119
120120
OPTIONS
@@ -149,7 +149,7 @@ OPTIONS
149149

150150
```
151151
USAGE
152-
$ sf omnistudio:migration:migrate [-f] [-v <string>] [-u <string>] [--loglevel
152+
$ sf omnistudio:migration:migrate [-v <string>] [-u <string>] [--loglevel
153153
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
154154
155155
OPTIONS

messages/assess.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
"couldNotTruncate": "We couldn't clear all %s records.",
1717
"couldNotTruncateOmnniProcess": "We couldn't clear all records of your %s because the %s is referenced in an Omniscript or a Flexcard.",
1818
"invalidOrRepeatingOmniscriptElementNames": "Omniscript with invalid or duplicate element names found. Rename your Omniscript elements and try again.",
19-
"duplicatedCardName": "Flexcard with duplicate name, type, subtype, or language found in this org. Modify your Flexcard and try again.",
19+
"duplicatedCardName": "Flexcard with duplicate name found in this org. Modify your Flexcard and try again.",
2020
"duplicatedDrName": "Data Mapper with duplicate name found in this org. Rename your Data Mapper and try again.",
2121
"duplicatedOSName": "Omniscript with duplicate name, type, subtype, or language found in this org. Modify your Omniscript and try again.",
22-
"duplicatedName": "Duplicated name",
22+
"duplicatedName": "Duplicated name %s",
23+
"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.",
2324
"errorWhileActivatingOs": "We couldn't activate your %s:",
2425
"errorWhileActivatingCard": "We couldn't activate your Flexcard:",
2526
"errorWhileUploadingCard": "We couldn't deploy your Flexcard to your org. Review these errors:",
2627
"errorWhileCreatingElements": "We couldn't save elements in your Omniscript. Review these errors:",
2728
"allVersionsDescription": "Migrate all versions of a component",
28-
"changeMessage": "%s will be changed from %s to %s",
29+
"changeMessage": "The %s %s will be changed from %s to %s",
2930
"angularOSWarning": "We couldn't migrate Angular Omniscripts. Convert all Angular Omniscripts to LWC Omniscripts, and try again.",
3031
"relatedObjectGA": "Select the component type that you want to migrate: 'apex' for Apex classes, 'lwc' for Lightning Web Components, 'flexipage' for FlexiPages, 'expsites' for Experience Sites, or 'apex, lwc, flexipage, expsites' if you want to include all types.",
3132
"noPackageInstalled": "No managed package found in your org.",
@@ -92,11 +93,13 @@
9293
"methodCallBundleNameUpdated": "Method call bundle name will be updated in %s for the %s class and %s method.",
9394
"cardNameChangeMessage": "The Flexcard name will be changed from %s to %s to adhere to the API naming standards.",
9495
"authordNameChangeMessage": "The Flexcard author name will be changed from %s to %s to adhere to the naming rules: %s",
96+
"cardLWCNameChangeMessage": "The Flexcard generated LWC name will be changed from %s to %s to align with Flexcard name change.",
9597
"omniScriptNameChangeMessage": "The Omniscript reference name %s will be changed to %s during migration.",
96-
"dataRaptorNameChangeMessage": "The Data Mapper %s will be renamed to %s during migration.",
98+
"dataRaptorNameChangeMessage": "The Data Mapper name will be changed from %s to %s during migration.",
9799
"integrationProcedureNameChangeMessage": "The Integration Procedure %s will be renamed to %s during migration.",
98100
"integrationProcedureManualUpdateMessage": "All references to %s in this Integration Procedure must be manually updated after migration.",
99101
"duplicateCardNameMessage": "A Flexcard with the same name \"%s\" already exists after name cleaning, which could lead to conflicts during migration.",
102+
"lowerVersionDuplicateCardNameMessage": "A Flexcard with the name \"%s\" will not be migrated because lower version of same card will be marked as duplicate, which could lead to conflicts during migration.",
100103
"startingCustomLabelAssessment": "Starting Custom Label assessment",
101104
"assessedCustomLabelsCount": "Found %s labels that need attention out of %s total",
102105
"customLabelAssessmentCompleted": "Custom Label assessment completed",
@@ -193,11 +196,13 @@
193196
"generatedCustomLabelAssessmentReportPage": "Generated custom label assessment report page %s of %s with %s labels",
194197
"manualDeploymentSteps": "<a href='%s' target='_blank'>Please refer to this documentation for manual deployment process</a>",
195198
"varDeclarationUpdated": "Variable initialization will be updated for target name",
196-
"ipNameUpdateFailed": "IP reference %s can’t be updated",
197-
"dmNameUpdateFailed": "DM reference %s can’t be updated",
199+
"ipNameUpdateFailed": "Integration Procedure reference can’t be updated at line %s",
200+
"dmNameUpdateFailed": "Data Mapper reference can’t be updated at line %s",
201+
"ipNameReferenceNotFound": "Integration Procedure reference can’t be updated",
202+
"dmNameReferenceNotFound": "Data Mapper reference can’t be updated",
198203
"invalidTypeAssessErrorMessage": "We couldn't assess your Omnistudio components in the %s namespace. Select the correct namespace and try again",
199204
"assessmentSuccessfulMessage": "Migration assessment for org %s is complete and reports are ready for review in the folder %s",
200205
"errorCheckingOmniStudioMetadata": "Error while checking the Omnistudio settings metadata status: %s.",
201-
"omniStudioSettingsMetadataAlreadyEnabled": "The Omnistudio Metadata setting is already enabled with standard data model. No need for migration."
206+
"omniStudioSettingsMetadataAlreadyEnabled": "The Omnistudio Metadata setting is already enabled with standard data model. No need for migration.",
202207
"missingMandatoryField": "Missing mandatory field: %s for %s"
203208
}

messages/migrate.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"couldNotTruncate": "We couldn't clear all %s records.",
2020
"couldNotTruncateOmnniProcess": "We couldn't clear all records of your %s because the %s is referenced in an Omniscript or a Flexcard.",
2121
"invalidOrRepeatingOmniscriptElementNames": "Omniscript with invalid or duplicate element names found. Rename your Omniscript elements and try again.",
22-
"duplicatedCardName": "Flexcard with duplicate name, type, subtype, or language found in this org. Modify your Flexcard and try again.",
22+
"lowerVersionDuplicateCardName": "Flexcard with name %s can't be migrated because lower version of same card is probable duplicate. Rename your Flexcard and try again.",
23+
"duplicatedCardName": "Flexcard with duplicate name %s found in this org. Rename your Flexcard and try again.",
2324
"duplicatedDrName": "Data Mapper with duplicate name found in this org. Rename your Data Mapper and try again.",
2425
"duplicatedOSName": "Omniscript with duplicate name, type, subtype, or language found in this org. Modify your Omniscript and try again.",
26+
"lowerVersionDuplicateOSName": "%s with name %s can't be migrated because lower version of same %s is probable duplicate. Rename your %s and try again.",
2527
"errorWhileActivatingOs": "We couldn't activate your %s:",
2628
"errorWhileActivatingCard": "We couldn't activate your Flexcard:",
2729
"errorWhileUploadingCard": "We couldn't deploy your Flexcard to your org. Review these errors:",
@@ -84,13 +86,13 @@
8486
"packageSelectionPrompt": "Enter the number of the package to use (1-%s):",
8587
"invalidPackageSelection": "Invalid selection. Please enter a number between 1 and %s.",
8688
"selectedPackage": "Selected package: %s (Version: %s)",
87-
"dataRaptorNameChangeMessage": "The Data Mapper %s will be renamed to %s during migration.",
89+
"dataRaptorNameChangeMessage": "The Data Mapper name %s will be renamed to %s during migration.",
8890
"integrationProcedureNameChangeMessage": "The Integration Procedure %s will be renamed to %s during migration.",
8991
"integrationProcedureManualUpdateMessage": "All references to %s in this Integration Procedure must be manually updated after migration.",
9092
"cardAuthorNameChangeMessage": "We've modified the name of this Flexcard author to adhere to the naming rules: %s",
9193
"cardNameChangeMessage": "We've modified the name of this Flexcard to adhere to the naming rules: %s",
9294
"duplicateCardNameMessage": "A Flexcard with the same name \"%s\" already exists after name cleaning, which could lead to conflicts during migration.",
93-
"angularOmniscriptWarningMessage": "We couldn't migrate Angular Omniscripts. Convert all Angular Omniscripts to LWC Omniscripts, and try again.",
95+
"angularOmniscriptWarningMessage": "We couldn't migrate Angular Omniscripts.",
9496
"apexFileChangesApplied": "Applied changes to the %s Apex class.",
9597
"generatingComponentReports": "Generating report for components",
9698
"generatingRelatedObjectReports": "Generating report for related objects",
@@ -137,7 +139,7 @@
137139
"enableExperienceBundleMetadataAPIProgramatically": "Enabling ExperienceBundle metadata API programmatically.",
138140
"unableToEnableExperienceBundleMetadataAPI": "We couldn’t enable the ExperienceBundle metadata API. Experience Cloud sites won’t be processed.",
139141
"relatedObjectsToProcess": "These objects will be processed: %s",
140-
"consentForExperienceSites": "By proceeding further, you hereby consent to enable the ExperienceBundle metadata API and migrate Experience Cloud sites. Do you want to proceed?",
142+
"consentForExperienceSites": "By proceeding further, you hereby consent to enable the ExperienceBundle metadata API and migrate Experience Cloud sites. Do you want to proceed? [y/n]",
141143
"noRelatedObjects": "No related objects to process",
142144
"turnOffExperienceBundleAPI": "Turning off the ExperienceBundle metadata API as it was enabled programmatically.",
143145
"errorRevertingExperienceBundleMetadataAPI": "We couldn’t revert the ExperienceBundle metadata API. Manually revert it in your org.",
@@ -193,7 +195,7 @@
193195
"completeComponentMappingMessage": "Registered name mappings for %s components",
194196
"componentMappingNotFound": "No registry mapping found for %s component: %s, using fallback cleaning",
195197
"integrationProcedureInvalidUnderscoreFormat": "Integration Procedure reference '%s' contains underscores in Type/SubType names. Skipping reference update to avoid incorrect parsing.",
196-
"flexCardWithAngularOmniScriptWarning": "Flexcard has dependencies on Angular Omniscript(s) which are not migrated. Please convert Omniscript(s) to LWC before migrating this Flexcard.",
198+
"flexCardWithAngularOmniScriptWarning": "We couldn't migrate Flexcards with dependencies on Angular Omniscripts.",
197199
"angularOmniScriptDependencyWarning": "Element '%s' references Angular Omniscript '%s' which will not be migrated. Consider converting the referenced Omniscript to LWC",
198200
"skipFlexcardAngularOmniScriptDependencyWarning": "Skipping Flexcard %s due to Angular Omniscript dependencies",
199201
"flexCardMigrationProcessingMessage": "Processing %s Flexcards for migration",
@@ -205,7 +207,7 @@
205207
"integrationProcedureTypeEmptyAfterCleaning": "Integration Procedure Type '%s' becomes empty after name cleaning. Please provide a valid Type value.",
206208
"integrationProcedureSubtypeEmptyAfterCleaning": "Integration Procedure SubType '%s' becomes empty after name cleaning. Please provide a valid SubType value.",
207209
"manifestDeployementStarted": "Manifest deployment started with ID: %s",
208-
"migrationConsentMessage": "Make sure that all records listed in the Assessment Status column in the Assessment Report are marked as Ready for Migration before proceeding with the migration. Do you want to proceed? Yes or No?",
210+
"migrationConsentMessage": "Make sure that all records listed in the Assessment Status column in the Assessment Report are marked as either Ready for Migration or Warnings before proceeding with the migration. Do you want to proceed? [y/n]",
209211
"truncationFailed": "Truncation failed for %s: %s",
210212
"invalidTypeMigrateErrorMessage": "We couldn't migrate your Omnistudio components in the %s namespace. Select the correct namespace and try again",
211213
"errorCheckingStandardRuntime": "We couldn't check whether the Standard OmniStudio Runtime setting is enabled: %s. Try again later.",
@@ -305,5 +307,6 @@
305307
"enablingOmniStudioSettingsMetadataStatus": "Enabling Omnistudio Metadata setting…",
306308
"omniStudioAllVersionsMigrationConsent": "Org uses the standard data model. All versions of Omnistudio components such as Omniscripts, Data Mappers, Integration Procedures, and Flexcards must be migrated to enable the Omnistudio Metadata API setting. But you’ve not specified -a or allversions flag in the command. Proceed to migrate all versions of the Omnistudio components? [y/n]",
307309
"omniStudioAllVersionsMigrationConsentNotGiven": "You've not consented to migrate all versions of the Omnistudio components. We cannot proceed with the migration.",
308-
"omniStudioAllVersionsMigrationConsentGiven": "You've consented to migrate all versions of the Omnistudio components."
310+
"omniStudioAllVersionsMigrationConsentGiven": "You've consented to migrate all versions of the Omnistudio components.",
311+
"customLWCFlexCardReferenceUpdated": "Updated Custom LWC FlexCard reference: %s -> cf%s"
309312
}

src/commands/omnistudio/migration/migrate.ts

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ export default class Migrate extends OmniStudioBaseCommand {
399399
name: r.name,
400400
data: this.mergeRecordAndUploadResults(r, cls),
401401
errors: r.errors,
402+
totalCount: r.totalCount, // Preserve totalCount for custom labels
402403
};
403404
})
404405
);
@@ -690,38 +691,59 @@ export default class Migrate extends OmniStudioBaseCommand {
690691
const mergedResults: MigratedRecordInfo[] = [];
691692

692693
for (const record of Array.from(migrationResults.records.values())) {
693-
const obj: MigratedRecordInfo = {
694-
id: record['Id'],
695-
name: migrationTool.getRecordName(record),
696-
status: 'Skipped',
697-
errors: record['errors'],
698-
migratedId: undefined,
699-
warnings: [],
700-
migratedName: '',
701-
localizationStatus: record['localizationStatus'] || {},
702-
};
703-
704-
if (migrationResults.results.has(record['Id'])) {
705-
const recordResults = migrationResults.results.get(record['Id']);
706-
707-
let errors: any[] = obj.errors || [];
708-
errors = errors.concat(recordResults.errors || []);
709-
710-
if (recordResults?.skipped) {
711-
obj.status = 'Skipped';
712-
} else if (!recordResults || recordResults.hasErrors) {
713-
obj.status = 'Failed';
714-
} else {
715-
obj.status = 'Successfully migrated';
694+
// For custom labels, preserve all the custom fields
695+
if (migrationTool.getName().toLowerCase().includes(Constants.CustomLabelPluralName.toLowerCase())) {
696+
// Use the record as-is for custom labels since it already has all the needed fields
697+
const customLabelRecord = record;
698+
mergedResults.push({
699+
id: customLabelRecord.id || customLabelRecord.name,
700+
name: customLabelRecord.name || customLabelRecord.labelName,
701+
status: customLabelRecord.status || 'Skipped',
702+
errors: customLabelRecord.errors || [],
703+
migratedId: customLabelRecord.migratedId || customLabelRecord.id,
704+
warnings: customLabelRecord.warnings || [],
705+
migratedName: customLabelRecord.migratedName || customLabelRecord.name,
706+
// Preserve custom fields for custom labels
707+
coreInfo: customLabelRecord.coreInfo,
708+
packageInfo: customLabelRecord.packageInfo,
709+
message: customLabelRecord.message,
710+
cloneStatus: customLabelRecord.cloneStatus,
711+
labelName: customLabelRecord.labelName,
712+
});
713+
} else {
714+
// Original logic for other components
715+
const obj: MigratedRecordInfo = {
716+
id: record['Id'],
717+
name: migrationTool.getRecordName(record),
718+
status: 'Skipped',
719+
errors: record['errors'],
720+
migratedId: undefined,
721+
warnings: [],
722+
migratedName: '',
723+
};
724+
725+
if (migrationResults.results.has(record['Id'])) {
726+
const recordResults = migrationResults.results.get(record['Id']);
727+
728+
let errors: any[] = obj.errors || [];
729+
errors = errors.concat(recordResults.errors || []);
730+
731+
if (recordResults?.skipped) {
732+
obj.status = 'Skipped';
733+
} else if (!recordResults || recordResults.hasErrors) {
734+
obj.status = 'Failed';
735+
} else {
736+
obj.status = 'Successfully migrated';
737+
}
738+
739+
obj.errors = errors;
740+
obj.migratedId = recordResults.id;
741+
obj.warnings = recordResults.warnings;
742+
obj.migratedName = recordResults.newName;
716743
}
717744

718-
obj.errors = errors;
719-
obj.migratedId = recordResults.id;
720-
obj.warnings = recordResults.warnings;
721-
obj.migratedName = recordResults.newName;
745+
mergedResults.push(obj);
722746
}
723-
724-
mergedResults.push(obj);
725747
}
726748

727749
return mergedResults;

0 commit comments

Comments
 (0)