Skip to content

Commit

Permalink
fix: default for wait on mdapi:report commands (#804)
Browse files Browse the repository at this point in the history
* fix: default for wait on mdapi:report commands

* docs: suggest deploy start/report pair for deprecated report commands

---------

Co-authored-by: Willie Ruemmele <[email protected]>
  • Loading branch information
mshanemc and WillieRuemmele authored Apr 7, 2023
1 parent f28f2fb commit 63bd14d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion messages/md.deployreport.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ Using specified username %s.

# deprecation

We plan to deprecate this command in the future. Try using the "%s" command instead.
We plan to deprecate this command in the future. Try using the "%s" and "%s" pair instead.
2 changes: 1 addition & 1 deletion messages/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ The metadata deploy operation failed.

# deprecation

We plan to deprecate this command in the future. Try using the "%s" command instead.
We plan to deprecate this command in the future. Try using the "%s" and "%s" pair instead.
5 changes: 3 additions & 2 deletions src/commands/force/mdapi/deploy/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class Report extends DeployCommand {
public static readonly state = 'deprecated';
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
message: messages.getMessage('deprecation', ['project deploy start', replacement]),
};
public static readonly flags = {
'api-version': orgApiVersionFlagWithDeprecations,
Expand All @@ -43,6 +43,7 @@ export class Report extends DeployCommand {
wait: Flags.duration({
char: 'w',
defaultValue: 0,
default: Duration.minutes(0),
min: -1,
unit: 'minutes',
summary: messages.getMessage('flags.wait.summary'),
Expand Down Expand Up @@ -88,7 +89,7 @@ export class Report extends DeployCommand {
this.log(messages.getMessage('usernameOutput', [this.org.getUsername()]));
}
const waitFlag = this.flags.wait;
const waitDuration = waitFlag.minutes === -1 ? Duration.days(7) : waitFlag;
const waitDuration = waitFlag?.minutes === -1 ? Duration.days(7) : waitFlag;

this.isAsync = waitDuration.quantity === 0;

Expand Down
1 change: 1 addition & 0 deletions src/commands/force/mdapi/retrieve/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class Report extends SourceCommand {
unit: 'minutes',
summary: messages.getMessage('flags.wait.summary'),
min: -1,
default: Duration.minutes(1440),
defaultValue: 1440, // 24 hours is a reasonable default versus -1 (no timeout)
}),
verbose: Flags.boolean({
Expand Down
2 changes: 1 addition & 1 deletion src/commands/force/source/deploy/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class Report extends DeployCommand {
public static readonly state = 'deprecated';
public static readonly deprecationOptions = {
to: replacement,
message: messages.getMessage('deprecation', [replacement]),
message: messages.getMessage('deprecation', ['project deploy start', replacement]),
};
public static readonly flags = {
'api-version': orgApiVersionFlagWithDeprecations,
Expand Down

0 comments on commit 63bd14d

Please sign in to comment.