Skip to content

Commit

Permalink
Merge branch 'qa/873' into sh/qa/873
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Jan 16, 2024
2 parents 6163fe8 + 20cee7b commit 66b9268
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"command": "project:deploy:preview",
"flagAliases": [],
"flagChars": ["c", "d", "m", "o", "x"],
"flags": ["ignore-conflicts", "json", "manifest", "metadata", "source-dir", "target-org"],
"flags": ["ignore-conflicts", "json", "manifest", "metadata", "source-dir", "target-org", "concise"],
"plugin": "@salesforce/plugin-deploy-retrieve"
},
{
Expand Down
2 changes: 1 addition & 1 deletion messages/deploy.metadata.preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This flag applies only to orgs that allow source tracking. It has no effect on o

# flags.concise.summary

Omit ignored files.
Show only the changes that will be deployed; omits files that are forceignored.

# flags.api-version.summary

Expand Down
6 changes: 5 additions & 1 deletion src/commands/project/deploy/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export default class DeployMetadataPreview extends SfCommand<PreviewResult> {
summary: messages.getMessage('flags.target-org.summary'),
required: true,
}),
concise: Flags.boolean({
summary: messages.getMessage('flags.concise.summary'),
default: false,
}),
};

public async run(): Promise<PreviewResult> {
Expand Down Expand Up @@ -88,7 +92,7 @@ export default class DeployMetadataPreview extends SfCommand<PreviewResult> {
});

if (!this.jsonEnabled()) {
printTables(output, 'deploy');
printTables(output, 'deploy', flags.concise);
}
return output;
}
Expand Down
15 changes: 14 additions & 1 deletion test/nuts/tracking/forceIgnore.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,26 @@ describe('forceignore changes', () => {
expect(pullOutput?.files.length).to.equal(0);
});

it('will not display ignored files with --concise', () => {
it('will not display retrieved ignored files with --concise', () => {
// gets file into source tracking
const output = execCmd<PreviewResult>('project:retrieve:preview --concise', {
ensureExitCode: 0,
}).shellOutput.stdout;
expect(output).to.not.include("These files won't retrieve because they're ignored by your .forceignore file.");
expect(output).to.not.include('ApexClass CreatedClass');
});

it('will not display deployed ignored files with --concise', async () => {
const newForceIgnore = originalForceIgnore + '\n' + `${classdir}/IgnoreTest.cls*`;
await fs.promises.writeFile(path.join(session.project.dir, '.forceignore'), newForceIgnore);

const output = execCmd<DeployResultJson>(`project:deploy:preview -d ${classdir} --concise`, {
ensureExitCode: 0,
}).shellOutput.stdout;
expect(output).to.include('Will Deploy [1] files.');
expect(output).to.include('ApexClass UnIgnoreTest');
expect(output).to.not.include("These files won't deploy because they're ignored by your .forceignore file.");
expect(output).to.not.include('ApexClass IgnoreTest');
});
});
});

0 comments on commit 66b9268

Please sign in to comment.