Skip to content

Commit

Permalink
chore: bump SDR version
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Dec 5, 2023
2 parents 5666141 + 0a0e2ae commit 30c43e9
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 68 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [2.2.2](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/2.2.1...2.2.2) (2023-12-02)

### Bug Fixes

- **deps:** bump @salesforce/sf-plugins-core from 5.0.3 to 5.0.5 ([de3e8f5](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/de3e8f5b5f96a557bd7a3d56d8072500747f0952))

## [2.2.1](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/2.2.0...2.2.1) (2023-12-02)

### Bug Fixes

- **deps:** bump @salesforce/source-deploy-retrieve from 10.0.2 to 10.0.3 ([34a913c](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/34a913cf140ca6c51f07ea1a0eb85cad068da9b6))

# [2.2.0](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/2.1.4...2.2.0) (2023-11-28)

### Features

- ui for tracking ([#819](https://github.com/salesforcecli/plugin-deploy-retrieve/issues/819)) ([a340a5a](https://github.com/salesforcecli/plugin-deploy-retrieve/commit/a340a5ab071e6b9b60c7549c810d1fc23dd274a3))

## [2.1.4](https://github.com/salesforcecli/plugin-deploy-retrieve/compare/2.1.3...2.1.4) (2023-11-27)

### Bug Fixes
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ FLAG DESCRIPTIONS
If you specify this parameter, don’t specify --metadata or --source-dir.
```

_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/convert/mdapi.ts)_
_See code: [src/commands/project/convert/mdapi.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/convert/mdapi.ts)_

## `sf project convert source`

Expand All @@ -153,7 +153,7 @@ USAGE
<value> | -m <value>]
FLAGS
-d, --output-dir=<value> [default: metadataPackage_1701116897216] Output directory to store the Metadata
-d, --output-dir=<value> [default: metadataPackage_1701517464173] Output directory to store the Metadata
API–formatted files in.
-m, --metadata=<value>... Metadata component names to convert.
-n, --package-name=<value> Name of the package to associate with the metadata-formatted files.
Expand Down Expand Up @@ -213,7 +213,7 @@ FLAG DESCRIPTIONS
Override the api version used for api requests made by this command
```

_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/convert/source.ts)_
_See code: [src/commands/project/convert/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/convert/source.ts)_

## `sf project delete source`

Expand Down Expand Up @@ -352,7 +352,7 @@ FLAG DESCRIPTIONS
- Separate the test names with spaces: --tests Test1 Test2 "Test With Space"
```

_See code: [src/commands/project/delete/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/delete/source.ts)_
_See code: [src/commands/project/delete/source.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/delete/source.ts)_

## `sf project delete tracking`

Expand Down Expand Up @@ -388,7 +388,7 @@ EXAMPLES
$ sf project delete tracking --target-org my-scratch
```

_See code: [src/commands/project/delete/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/delete/tracking.ts)_
_See code: [src/commands/project/delete/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/delete/tracking.ts)_

## `sf project deploy cancel`

Expand Down Expand Up @@ -458,7 +458,7 @@ FLAG DESCRIPTIONS
project deploy report".
```

_See code: [src/commands/project/deploy/cancel.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/cancel.ts)_
_See code: [src/commands/project/deploy/cancel.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/cancel.ts)_

## `sf project deploy preview`

Expand Down Expand Up @@ -541,7 +541,7 @@ FLAG DESCRIPTIONS
All child components are included. If you specify this flag, don’t specify --metadata or --source-dir.
```

_See code: [src/commands/project/deploy/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/preview.ts)_
_See code: [src/commands/project/deploy/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/preview.ts)_

## `sf project deploy quick`

Expand Down Expand Up @@ -625,7 +625,7 @@ FLAG DESCRIPTIONS
deploy report".
```

_See code: [src/commands/project/deploy/quick.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/quick.ts)_
_See code: [src/commands/project/deploy/quick.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/quick.ts)_

## `sf project deploy report`

Expand Down Expand Up @@ -720,7 +720,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/report.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/report.ts)_
_See code: [src/commands/project/deploy/report.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/report.ts)_

## `sf project deploy resume`

Expand Down Expand Up @@ -804,7 +804,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/resume.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/resume.ts)_
_See code: [src/commands/project/deploy/resume.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/resume.ts)_

## `sf project deploy start`

Expand Down Expand Up @@ -1016,7 +1016,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/start.ts)_
_See code: [src/commands/project/deploy/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/start.ts)_

## `sf project deploy validate`

Expand Down Expand Up @@ -1178,7 +1178,7 @@ FLAG DESCRIPTIONS
--coverage-formatters lcov --coverage-formatters clover
```

_See code: [src/commands/project/deploy/validate.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/deploy/validate.ts)_
_See code: [src/commands/project/deploy/validate.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/deploy/validate.ts)_

## `sf project generate manifest`

Expand Down Expand Up @@ -1253,7 +1253,7 @@ EXAMPLES
$ sf project generate manifest --from-org [email protected] --include-packages unlocked
```

_See code: [src/commands/project/generate/manifest.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/generate/manifest.ts)_
_See code: [src/commands/project/generate/manifest.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/generate/manifest.ts)_

## `sf project list ignored`

Expand Down Expand Up @@ -1294,7 +1294,7 @@ EXAMPLES
$ sf project list ignored --source-dir package.xml
```

_See code: [src/commands/project/list/ignored.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/list/ignored.ts)_
_See code: [src/commands/project/list/ignored.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/list/ignored.ts)_

## `sf project reset tracking`

Expand Down Expand Up @@ -1342,7 +1342,7 @@ EXAMPLES
$ sf project reset tracking --revision 30
```

_See code: [src/commands/project/reset/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/reset/tracking.ts)_
_See code: [src/commands/project/reset/tracking.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/reset/tracking.ts)_

## `sf project retrieve preview`

Expand Down Expand Up @@ -1397,7 +1397,7 @@ FLAG DESCRIPTIONS
Overrides your default org.
```

_See code: [src/commands/project/retrieve/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/retrieve/preview.ts)_
_See code: [src/commands/project/retrieve/preview.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/retrieve/preview.ts)_

## `sf project retrieve start`

Expand Down Expand Up @@ -1543,6 +1543,6 @@ FLAG DESCRIPTIONS
If you specify this parameter, don’t specify --metadata or --source-dir.
```

_See code: [src/commands/project/retrieve/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.1.4/src/commands/project/retrieve/start.ts)_
_See code: [src/commands/project/retrieve/start.ts](https://github.com/salesforcecli/plugin-deploy-retrieve/blob/2.2.2/src/commands/project/retrieve/start.ts)_

<!-- commandsstop -->
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "@salesforce/plugin-deploy-retrieve",
"description": "deploy and retrieve commands for sf",
"version": "2.1.4",
"version": "2.2.2",
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^3.12.0",
"@salesforce/apex-node": "^2.1.2",
"@salesforce/core": "^6.2.0",
"@salesforce/kit": "^3.0.15",
"@salesforce/sf-plugins-core": "^5.0.3",
"@salesforce/sf-plugins-core": "^5.0.5",
"@salesforce/source-deploy-retrieve": "^10.1.0",
"@salesforce/source-tracking": "^5.0.1",
"@salesforce/source-tracking": "^5.1.0",
"chalk": "^5.3.0"
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.0.2",
"@oclif/plugin-command-snapshot": "^5.0.3",
"@salesforce/cli-plugins-testkit": "^5.0.4",
"@salesforce/dev-scripts": "^7.1.1",
"@salesforce/plugin-command-reference": "^3.0.47",
"@salesforce/dev-scripts": "^8.0.0",
"@salesforce/plugin-command-reference": "^3.0.48",
"@salesforce/plugin-source": "^2.11.4",
"@salesforce/source-testkit": "^2.1.65",
"@salesforce/ts-sinon": "^1.4.19",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/deploy/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default class DeployMetadata extends SfCommand<DeployResultJson> {
}

protected catch(error: Error | SfError): Promise<SfCommand.Error> {
if (error instanceof SourceConflictError) {
if (error instanceof SourceConflictError && error.data) {
if (!this.jsonEnabled()) {
writeConflictTable(error.data);
// set the message and add plugin-specific actions
Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/retrieve/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export default class RetrieveMetadata extends SfCommand<RetrieveResultJson> {
}

protected catch(error: Error | SfError): Promise<SfCommand.Error> {
if (!this.jsonEnabled() && error instanceof SourceConflictError) {
if (!this.jsonEnabled() && error instanceof SourceConflictError && error.data) {
writeConflictTable(error.data);
// set the message and add plugin-specific actions
return super.catch({
Expand Down
36 changes: 27 additions & 9 deletions src/utils/progressBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
*/
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { envVars as env, EnvironmentVariable, Messages } from '@salesforce/core';
import { envVars as env, EnvironmentVariable, Lifecycle, Messages } from '@salesforce/core';
import { MetadataApiDeploy, MetadataApiDeployStatus } from '@salesforce/source-deploy-retrieve';
import { Progress } from '@salesforce/sf-plugins-core';
import { SourceMemberPollingEvent } from '@salesforce/source-tracking';

Messages.importMessagesDirectory(dirname(fileURLToPath(import.meta.url)));
const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer');
Expand All @@ -20,21 +21,27 @@ const showBar = Boolean(
export class DeployProgress extends Progress {
private static OPTIONS = {
title: 'Status',
format: `%s: {status} ${showBar ? '| {bar} ' : ''}| {value}/{total} Components (Errors:{errorCount}) {testInfo}`,
format: `%s: {status} ${showBar ? '| {bar} ' : ''}| {value}/{total} Components{errorInfo}{testInfo}{trackingInfo}`,
barCompleteChar: '\u2588',
barIncompleteChar: '\u2591',
linewrap: true,
// people really like to get text output in CI systems
// they won't get the "bar" but will get the remaining template bits this way
noTTYOutput: true,
};
private lifecycle = Lifecycle.getInstance();

public constructor(private deploy: MetadataApiDeploy, jsonEnabled = false) {
super(!jsonEnabled);
}

public start(): void {
super.start(0, { status: 'Waiting' }, DeployProgress.OPTIONS);
super.start(0, { status: 'Waiting', trackingInfo: '', testInfo: '' }, DeployProgress.OPTIONS);

// for sourceMember polling events
this.lifecycle.on<SourceMemberPollingEvent>('sourceMemberPollingEvent', (event: SourceMemberPollingEvent) =>
Promise.resolve(this.updateTrackingProgress(event))
);

this.deploy.onUpdate((data) => this.updateProgress(data));

Expand All @@ -52,21 +59,32 @@ export class DeployProgress extends Progress {
});
}

private updateTrackingProgress(data: SourceMemberPollingEvent): void {
const { remaining, original } = data;
this.update(0, {
status: 'Polling SourceMembers',
trackingInfo: ` | Tracking: ${original - remaining}/${original}`,
});
}

private updateProgress(data: MetadataApiDeployStatus): void {
// the numCompTot. isn't computed right away, wait to start until we know how many we have
const errorCount = data.numberComponentErrors ?? 0;
const testInfo = `| ${data.numberTestsCompleted ?? 0}/${data.numberTestsTotal ?? 0} Tests (Errors:${
data.numberTestErrors
})`;
const testInfo = data.numberTestsTotal
? ` | ${data.numberTestsCompleted ?? 0}/${data.numberTestsTotal ?? 0} Tests${
data.numberTestErrors ? `(Errors:${data.numberTestErrors})` : ''
}`
: '';
const errorInfo = data.numberComponentErrors > 0 ? ` | Errors: ${data.numberComponentErrors}` : '';

if (data.numberComponentsTotal) {
this.setTotal(data.numberComponentsTotal);
this.update(data.numberComponentsDeployed, {
errorCount,
errorInfo: data.numberComponentErrors > 0 ? ` | Errors: ${data.numberComponentErrors}` : '',
status: mdTransferMessages.getMessage(data.status),
testInfo,
});
} else {
this.update(0, { errorCount, testInfo, status: mdTransferMessages.getMessage(data.status) ?? 'Waiting' });
this.update(0, { errorInfo, testInfo, status: mdTransferMessages.getMessage(data.status) ?? 'Waiting' });
}
}
}
Loading

0 comments on commit 30c43e9

Please sign in to comment.