Skip to content

Commit 879b47b

Browse files
Merge pull request #560 from salesforcecli/sm/no-org-on-report
fix: remove 2 flags from report
2 parents ff30da0 + e403397 commit 879b47b

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

command-snapshot.json

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,7 @@
7474
{
7575
"command": "project:deploy:report",
7676
"plugin": "@salesforce/plugin-deploy-retrieve",
77-
"flags": [
78-
"api-version",
79-
"coverage-formatters",
80-
"job-id",
81-
"json",
82-
"junit",
83-
"results-dir",
84-
"target-org",
85-
"use-most-recent"
86-
],
77+
"flags": ["coverage-formatters", "job-id", "json", "junit", "results-dir", "use-most-recent"],
8778
"alias": ["deploy:metadata:report"]
8879
},
8980
{

messages/deploy.metadata.report.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ Run this command by either passing it a job ID or specifying the --use-most-rece
1818

1919
<%= config.bin %> <%= command.id %> --use-most-recent
2020

21-
# flags.target-org.summary
22-
23-
Login username or alias for the target org.
24-
25-
# flags.api-version.summary
26-
27-
API version to use
28-
2921
# flags.job-id.summary
3022

3123
Job ID of the deploy operation you want to check the status of.

src/commands/project/deploy/report.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
2626
public static readonly deprecateAliases = true;
2727

2828
public static readonly flags = {
29-
'target-org': Flags.requiredOrg({
30-
summary: messages.getMessage('flags.target-org.summary'),
31-
required: true,
32-
}),
33-
'api-version': Flags.orgApiVersion(),
3429
'job-id': Flags.salesforceId({
3530
char: 'i',
3631
startsWith: '0Af',
@@ -63,14 +58,18 @@ export default class DeployMetadataReport extends SfCommand<DeployResultJson> {
6358

6459
const deployOpts = cache.get(jobId);
6560
const org = await Org.create({ aliasOrUsername: deployOpts['target-org'] });
66-
const deployStatus = await org.getConnection(flags['api-version']).metadata.checkDeployStatus(jobId, true);
61+
const [deployStatus, componentSet] = await Promise.all([
62+
// we'll use whatever the org supports since we can't specify the org
63+
// eslint-disable-next-line sf-plugin/get-connection-with-version
64+
org.getConnection().metadata.checkDeployStatus(jobId, true),
65+
buildComponentSet({ ...deployOpts, wait: Duration.minutes(deployOpts.wait) }),
66+
]);
6767

68-
const componentSet = await buildComponentSet({ ...deployOpts, wait: Duration.minutes(deployOpts.wait) });
6968
const result = new DeployResult(deployStatus as MetadataApiDeployStatus, componentSet);
7069

7170
const formatter = new DeployReportResultFormatter(result, {
7271
...deployOpts,
73-
...{ 'target-org': flags['target-org'] },
72+
...{ 'target-org': org },
7473
});
7574

7675
if (!this.jsonEnabled()) formatter.display();

0 commit comments

Comments
 (0)