Skip to content

Commit f589d77

Browse files
committed
feat: add push migration flag
1 parent 5d86f29 commit f589d77

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

messages/package_pushupgrade_schedule.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ The filename of the .csv file that contains the list of orgs that need the packa
3535

3636
Comma-separated list of subscriber org IDs that need the package upgrade.
3737

38+
# flags.migrate-to-2gp.summary
39+
40+
Indicates the push upgrade request is a migration from 1GP to 2GP.
41+
42+
# flags.migrate-to-2gp.description
43+
44+
Include this flag to specify that the push upgrade request represents a migration from a 1GP package to a 2GP package. The command must be run against the Dev Hub that owns the 2GP package.
45+
3846
# error.invalid-package-version
3947

4048
Invalid package version.
@@ -67,6 +75,9 @@ Either org list file or org list input must be supplied.
6775
- Schedule a push upgrade that initiates as soon as possible:
6876
<%= config.bin %> <%= command.id %> --package 04txyz --org-file upgrade-orgs.csv
6977

78+
- Schedule a push migration from a 1GP package to a 2GP package:
79+
<%= config.bin %> <%= command.id %> --migrate-to-2gp --package 04txyz --start-time "2024-12-06T21:00:00" --org-file upgrade-orgs.csv --target-dev-hub myHub
80+
7081
# id
7182

7283
ID
@@ -85,4 +96,4 @@ Package Version Id
8596

8697
# output
8798

88-
Push upgrade has been scheduled. To check the status of this push upgrade, use push upgrade request ID [%s] with either package push-upgrade list or package push-upgrade report.
99+
Push upgrade has been scheduled. To check the status of this push upgrade, use push upgrade request ID [%s] with either "package push-upgrade list" or "package push-upgrade report".

src/commands/package/pushupgrade/schedule.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export class PackagePushScheduleCommand extends SfCommand<PackagePushScheduleRes
4848
exists: true,
4949
exclusive: ['org-list'],
5050
}),
51+
'migrate-to-2gp': Flags.boolean({
52+
summary: messages.getMessage('flags.migrate-to-2gp.summary'),
53+
description: messages.getMessage('flags.migrate-to-2gp.description'),
54+
default: false,
55+
}),
5156
};
5257

5358
public async run(): Promise<PackagePushScheduleResult> {
@@ -71,17 +76,21 @@ export class PackagePushScheduleCommand extends SfCommand<PackagePushScheduleRes
7176
if (!startTime) {
7277
throw new SfError('Missing required flag: --start-time');
7378
}
74-
79+
const isMigration = flags['migrate-to-2gp'];
80+
7581
logger.debug(
76-
`Scheduling push upgrade for package ${flags.package} with ${orgList.length} orgs, starting at ${startTime}.`
82+
`Scheduling push ${isMigration ? 'migration' : 'upgrade'} for package ${flags.package} with ${
83+
orgList.length
84+
} orgs, starting at ${startTime}.`
7785
);
7886

7987
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
8088
const result: PackagePushScheduleResult = await PackagePushUpgrade.schedule(
8189
conn,
8290
flags.package,
8391
startTime,
84-
orgList
92+
orgList,
93+
isMigration
8594
);
8695

8796
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access

0 commit comments

Comments
 (0)