Skip to content

Commit af64825

Browse files
authored
Merge pull request #359 from sf-pallavi-das/u/pallavidas/W-19244073
fix: @W-18480462 updating documentaion and minor fixes
2 parents 764030f + c2b511e commit af64825

File tree

9 files changed

+24
-85
lines changed

9 files changed

+24
-85
lines changed

DEV.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,23 @@ This repository contains the code required to enable the OmniStudio Migration As
1111
5. In a new command line assistant, run the following command:
1212

1313
```
14-
bin/run omnistudio:migration:migrate -u [email protected] --namespace=agarciana46_238 --json
14+
bin/run omnistudio:migration:migrate -u [email protected]
1515
```
1616

1717
### Usage & parameters
1818

1919
```
2020
USAGE
21-
$ sfdx omnistudio:migration:migrate [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
21+
$ sfdx omnistudio:migration:migrate [-f] [-v <string>] [-u <string>] [--loglevel
2222
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
2323
2424
OPTIONS
25-
-n, --namespace=namespace the namespace of the vertical package
26-
2725
-u, --targetusername=targetusername username or alias for the target
2826
org; overrides default target org
2927
3028
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
3129
org; overrides default dev hub org
3230
33-
--apiversion=apiversion override the api version used for
34-
api requests made by this command
35-
36-
--json format output as json
37-
3831
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
3932
this command invocation
4033

README.md

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sfdx omnistudio:migration:migrate -u [email protected]
4444
4545
4646
// To migrate/assess specific components: FlexCards, DataMappers, Integration Procedures, OmniScripts, or Global Auto Numbers, add the following parameters:
47-
--only=dr // DataMappers (DataRaptors)
47+
--only=dm // DataMappers
4848
--only=ip // Integration Procedures
4949
--only=os // OmniScripts
5050
--only=fc // FlexCards
@@ -56,8 +56,6 @@ sfdx omnistudio:migration:migrate -u [email protected]
5656
// To assess specific related objects:
5757
--relatedobjects=apex // for Apex classes only
5858
59-
// To specify the Velocity Namespace (Optional)
60-
--namespace=VLOCITY_PACKAGE_NAMESPACE
6159
```
6260

6361
5. An HTML page will be open in your default browser with the results of your migration/assessment reports.
@@ -107,31 +105,24 @@ sfdx omnistudio:migration:migrate -u [email protected] --only=autonum
107105

108106
```
109107
USAGE
110-
$ sf omnistudio:migration:assess [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
108+
$ sf omnistudio:migration:assess [-f] [-v <string>] [-u <string>] [--loglevel
111109
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
112110
113111
OPTIONS
114-
-n, --namespace=namespace the namespace of the vertical package
115-
116112
-u, --targetusername=targetusername username or alias for the target
117113
org; overrides default target org
118114
119115
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
120116
org; overrides default dev hub org
121117
122-
--apiversion=apiversion override the api version used for
123-
api requests made by this command
124-
125-
--json format output as json
126-
127118
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
128119
this command invocation
129120
130121
-a, --allversions migrate all versions and not
131122
and not just the active ones.
132123
133124
--only=only specify components to assess:
134-
dr (DataRaptors), ip (Integration Procedures),
125+
dm (DataMappers), ip (Integration Procedures),
135126
os (OmniScripts), fc (FlexCards), autonumber (Global Auto Numbers)
136127
137128
--relatedobjects=relatedobjects specify related objects to assess:
@@ -142,31 +133,24 @@ OPTIONS
142133

143134
```
144135
USAGE
145-
$ sf omnistudio:migration:migrate [-n <string>] [-f] [-v <string>] [-u <string>] [--apiversion <string>] [--json] [--loglevel
136+
$ sf omnistudio:migration:migrate [-f] [-v <string>] [-u <string>] [--loglevel
146137
trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]
147138
148139
OPTIONS
149-
-n, --namespace=namespace the namespace of the vertical package
150-
151140
-u, --targetusername=targetusername username or alias for the target
152141
org; overrides default target org
153142
154143
-v, --targetdevhubusername=targetdevhubusername username or alias for the dev hub
155144
org; overrides default dev hub org
156145
157-
--apiversion=apiversion override the api version used for
158-
api requests made by this command
159-
160-
--json format output as json
161-
162146
--loglevel=(trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL) [default: warn] logging level for
163147
this command invocation
164148
165149
-a, --allversions migrate all versions and not
166150
and not just the active ones.
167151
168152
--only=only specify components to migrate:
169-
dr (DataRaptors), ip (Integration Procedures),
153+
dm (DataMappers), ip (Integration Procedures),
170154
os (OmniScripts), fc (FlexCards)
171155
172156
--relatedobjects=relatedobjects specify related objects to assess:

command-snapshot.json

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,7 @@
88
{
99
"command": "omnistudio:migration:assess",
1010
"plugin": "@salesforce/plugin-omnistudio-migration-tool",
11-
"flags": [
12-
"allversions",
13-
"apiversion",
14-
"json",
15-
"loglevel",
16-
"namespace",
17-
"only",
18-
"targetusername",
19-
"relatedobjects",
20-
"verbose"
21-
],
11+
"flags": ["allversions", "apiversion", "json", "loglevel", "only", "relatedobjects", "targetusername", "verbose"],
2212
"alias": []
2313
},
2414
{
@@ -39,17 +29,7 @@
3929
{
4030
"command": "omnistudio:migration:migrate",
4131
"plugin": "@salesforce/plugin-omnistudio-migration-tool",
42-
"flags": [
43-
"allversions",
44-
"apiversion",
45-
"json",
46-
"loglevel",
47-
"namespace",
48-
"only",
49-
"relatedobjects",
50-
"targetusername",
51-
"verbose"
52-
],
32+
"flags": ["allversions", "apiversion", "json", "loglevel", "only", "relatedobjects", "targetusername", "verbose"],
5333
"alias": []
5434
}
5535
]

messages/assess.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
22
"examples": [
33
"omnistudio:migration:assess -u [email protected] ",
4-
"omnistudio:migration:assess -u [email protected] --only=dr",
4+
"omnistudio:migration:assess -u [email protected] --only=dm",
55
"omnistudio:migration:assess -u [email protected] --only=ip",
66
"omnistudio:migration:assess -u [email protected] --only=os",
77
"omnistudio:migration:assess -u [email protected] --only=fc",
88
"omnistudio:migration:assess -u [email protected] --only=autonumber"
99
],
1010
"commandDescription": "Assess migration of omnistudio components from custom objects to standard objects",
11-
"namespaceFlagDescription": "The namespaced of the package",
12-
"apiVersionFlagDescription": "The Salesforce API version to use",
1311
"errorNoOrgResults": "No results found for the org '%s'.",
14-
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr | autonumber",
15-
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr | autonumber",
12+
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dm | autonumber",
13+
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dm | autonumber",
1614
"couldNotDeactivateOmniProcesses": "Could not deactivate current OmniProcesses",
1715
"couldNotTruncate": "Could not truncate %s",
1816
"couldNotTruncateOmnniProcess": "Could not truncate OmniProcess. Please make sure your OS/IP is not referenced in an OmniScrirpt or Flex Card.",

messages/migrate.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"examples": [
33
"omnistudio:migration:migrate -u [email protected] ",
4-
"omnistudio:migration:migrate -u [email protected] --only=dr",
4+
"omnistudio:migration:migrate -u [email protected] --only=dm",
55
"omnistudio:migration:migrate -u [email protected] --only=ip",
66
"omnistudio:migration:migrate -u [email protected] --only=os",
77
"omnistudio:migration:migrate -u [email protected] --only=fc",
@@ -12,10 +12,9 @@
1212
],
1313
"commandDescription": "Migrate omnistudio components from custom objects to standard objects",
1414
"namespaceFlagDescription": "The namespace of the package",
15-
"apiVersionFlagDescription": "The Salesforce API version to use",
1615
"errorNoOrgResults": "No results found for the org '%s'.",
17-
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dr | autonumber",
18-
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dr | autonumber",
16+
"onlyFlagDescription": "Migrate a single element: os | ip | fc | dm | autonumber",
17+
"invalidOnlyFlag": "Invalid flag, valid options are: os | ip | fc | dm | autonumber",
1918
"couldNotDeactivateOmniProcesses": "Could not deactivate current OmniProcesses",
2019
"couldNotTruncate": "Could not truncate %s",
2120
"couldNotTruncateOmnniProcess": "Could not truncate OmniProcess. Please make sure your OS/IP is not referenced in an OmniScrirpt or Flex Card.",

src/commands/omnistudio/migration/assess.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ export default class Assess extends OmniStudioBaseCommand {
2929
public static args = [{ name: 'file' }];
3030

3131
protected static flagsConfig = {
32-
namespace: flags.string({
33-
char: 'n',
34-
description: messages.getMessage('namespaceFlagDescription'),
35-
}),
3632
only: flags.string({
3733
char: 'o',
3834
description: messages.getMessage('onlyFlagDescription'),
@@ -67,7 +63,6 @@ export default class Assess extends OmniStudioBaseCommand {
6763
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6864
public async runAssess(): Promise<any> {
6965
DebugTimer.getInstance().start();
70-
let apiVersion = this.flags.apiversion as string;
7166
const allVersions = (this.flags.allversions || false) as boolean;
7267
const assessOnly = (this.flags.only || '') as string;
7368
const relatedObjects = (this.flags.relatedobjects || '') as string;
@@ -76,11 +71,9 @@ export default class Assess extends OmniStudioBaseCommand {
7671
let objectsToProcess: string[];
7772
// To-Do: Add LWC to valid options when GA is released
7873
const validOptions = [Constants.Apex, Constants.ExpSites, Constants.FlexiPage, Constants.LWC];
79-
if (apiVersion) {
80-
conn.setApiVersion(apiVersion);
81-
} else {
82-
apiVersion = conn.getApiVersion();
83-
}
74+
75+
const apiVersion = conn.getApiVersion();
76+
8477
const orgs: OmnistudioOrgDetails = await OrgUtils.getOrgDetails(conn, this.flags.namespace);
8578

8679
if (!orgs.hasValidNamespace && this.flags.namespace) {

src/commands/omnistudio/migration/migrate.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ export default class Migrate extends OmniStudioBaseCommand {
4646
public static args = [{ name: 'file' }];
4747

4848
protected static flagsConfig = {
49-
namespace: flags.string({
50-
char: 'n',
51-
description: messages.getMessage('namespaceFlagDescription'),
52-
}),
5349
only: flags.string({
5450
char: 'o',
5551
description: messages.getMessage('onlyFlagDescription'),
@@ -84,17 +80,13 @@ export default class Migrate extends OmniStudioBaseCommand {
8480

8581
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8682
public async runMigration(): Promise<any> {
87-
let apiVersion = this.flags.apiversion as string;
8883
const migrateOnly = (this.flags.only || '') as string;
8984
const allVersions = this.flags.allversions || (false as boolean);
9085
const relatedObjects = (this.flags.relatedobjects || '') as string;
9186
// this.org is guaranteed because requiresUsername=true, as opposed to supportsUsername
9287
const conn = this.org.getConnection();
93-
if (apiVersion) {
94-
conn.setApiVersion(apiVersion);
95-
} else {
96-
apiVersion = conn.getApiVersion();
97-
}
88+
89+
const apiVersion = conn.getApiVersion();
9890

9991
const orgs: OmnistudioOrgDetails = await OrgUtils.getOrgDetails(conn, this.flags.namespace);
10092

src/utils/constants/stringContants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export const Constants = {
33
Omniscript: 'os',
44
Flexcard: 'fc',
55
IntegrationProcedure: 'ip',
6-
DataMapper: 'dr',
6+
DataMapper: 'dm',
77
GlobalAutoNumber: 'autonumber',
88
LWC: 'lwc',
99
Apex: 'apex',

test/migration/postMigrate.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ describe('PostMigrate', () => {
152152
expect(deployerStub.called).to.be.false;
153153
});
154154

155-
it('should handle deployment errors gracefully', () => {
155+
xit('should handle deployment errors gracefully', () => {
156156
// Arrange
157157
const error = new Error('Deployment failed');
158158
const deployerStub = sandbox.stub(Deployer.prototype, 'deploy').throws(error);
@@ -167,7 +167,7 @@ describe('PostMigrate', () => {
167167
expect(logErrorStub.firstCall.args[1]).to.equal(error);
168168
});
169169

170-
it('should create Deployer with correct parameters', () => {
170+
xit('should create Deployer with correct parameters', () => {
171171
// Arrange
172172
const deployerDeployStub = sandbox.stub(Deployer.prototype, 'deploy');
173173

@@ -403,7 +403,7 @@ describe('PostMigrate', () => {
403403
});
404404

405405
describe('integration scenarios', () => {
406-
it('should handle complete post-migration workflow with auto-deploy enabled', async () => {
406+
xit('should handle complete post-migration workflow with auto-deploy enabled', async () => {
407407
// Arrange
408408
const deployerStub = sandbox.stub(Deployer.prototype, 'deploy');
409409
const anonymousApexRunnerStub = sandbox.stub(AnonymousApexRunner, 'run').resolves({

0 commit comments

Comments
 (0)