Skip to content

Commit

Permalink
fix: bump mso
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Sep 4, 2024
1 parent 7da036f commit 15685e5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^4.0.17",
"@oclif/multi-stage-output": "^0.3.0",
"@oclif/multi-stage-output": "^0.4.1-dev.0",
"@salesforce/apex-node": "^8.1.3",
"@salesforce/core": "^8.4.0",
"@salesforce/kit": "^3.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/delete/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class Source extends SfCommand<DeleteSourceJson> {
this.deployResult = await deploy.pollStatus({ timeout: this.flags.wait });
if (!deploy.id) {
const err = new SfError('The deploy id is not available.');
stages.stop(err);
stages.error();
throw err;
}
await DeployCache.update(deploy.id, { status: this.deployResult.response.status });
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 @@ -279,7 +279,7 @@ export default class DeployMetadata extends SfCommand<DeployResultJson> {
if (error instanceof SourceConflictError && error.data) {
if (!this.jsonEnabled()) {
this.stages?.update({ status: 'Failed' });
this.stages?.stop(error);
this.stages?.error();
writeConflictTable(error.data);
// set the message and add plugin-specific actions
return super.catch({
Expand Down
8 changes: 4 additions & 4 deletions src/commands/project/retrieve/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ export default class RetrieveMetadata extends SfCommand<RetrieveResultJson> {
});
retrieve.onCancel((data) => {
this.ms.updateData({ status: mdTransferMessages.getMessage(data?.status ?? 'Canceled') });
this.ms.stop(new Error('Retrieve canceled'));
this.ms.error();
});
retrieve.onError((error: Error) => {
if (error.message.includes('client has timed out')) {
this.ms.updateData({ status: 'Client Timeout' });
}

this.ms.stop(error);
this.ms.error();
throw error;
});

Expand Down Expand Up @@ -301,7 +301,7 @@ export default class RetrieveMetadata extends SfCommand<RetrieveResultJson> {
protected catch(error: Error | SfError): Promise<never> {
if (!this.jsonEnabled() && error instanceof SourceConflictError && error.data) {
this.ms.updateData({ status: 'Failed' });
this.ms.stop(error);
this.ms.error();
writeConflictTable(error.data);
// set the message and add plugin-specific actions
return super.catch({
Expand All @@ -310,7 +310,7 @@ export default class RetrieveMetadata extends SfCommand<RetrieveResultJson> {
actions: messages.getMessages('error.Conflicts.Actions'),
});
} else {
this.ms.stop(error);
this.ms.error();
}

return super.catch(error);
Expand Down
36 changes: 23 additions & 13 deletions src/utils/deployStages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class DeployStages {
label: 'Deploy ID',
get: (data): string | undefined => data?.id,
type: 'static-key-value',
neverCollapse: true,
// neverCollapse: true,
},
{
label: 'Target Org',
Expand Down Expand Up @@ -105,7 +105,10 @@ export class DeployStages {
label: 'Members',
get: (data): string | undefined =>
data?.sourceMemberPolling?.original
? formatProgress(data.sourceMemberPolling.remaining, data.sourceMemberPolling.original)
? formatProgress(
data.sourceMemberPolling.original - data.sourceMemberPolling.remaining,
data.sourceMemberPolling.original
)
: undefined,
stage: 'Updating Source Tracking',
type: 'dynamic-key-value',
Expand All @@ -120,12 +123,12 @@ export class DeployStages {
): void {
const lifecycle = Lifecycle.getInstance();
if (initialData) this.ms.updateData(initialData);
this.ms.goto('Preparing', { username, id: deploy.id });
this.ms.skipTo('Preparing', { username, id: deploy.id });

// for sourceMember polling events
lifecycle.on<SourceMemberPollingEvent>('sourceMemberPollingEvent', (event: SourceMemberPollingEvent) => {
if (event.original > 0) {
return Promise.resolve(this.ms.goto('Updating Source Tracking', { sourceMemberPolling: event }));
return Promise.resolve(this.ms.skipTo('Updating Source Tracking', { sourceMemberPolling: event }));
}

return Promise.resolve();
Expand All @@ -137,39 +140,42 @@ export class DeployStages {
data.numberTestsTotal > 0 &&
data.numberComponentsDeployed > 0
) {
this.ms.goto('Running Tests', { mdapiDeploy: data, status: mdTransferMessages.getMessage(data?.status) });
this.ms.skipTo('Running Tests', { mdapiDeploy: data, status: mdTransferMessages.getMessage(data?.status) });
} else if (data.status === RequestStatus.Pending) {
this.ms.goto('Waiting for the org to respond', {
this.ms.skipTo('Waiting for the org to respond', {
mdapiDeploy: data,
status: mdTransferMessages.getMessage(data?.status),
});
} else {
this.ms.goto('Deploying Metadata', { mdapiDeploy: data, status: mdTransferMessages.getMessage(data?.status) });
this.ms.skipTo('Deploying Metadata', {
mdapiDeploy: data,
status: mdTransferMessages.getMessage(data?.status),
});
}
});

deploy.onFinish((data) => {
this.ms.updateData({ mdapiDeploy: data.response, status: mdTransferMessages.getMessage(data.response.status) });
if (data.response.status === RequestStatus.Failed) {
this.ms.stop(new Error('Failed to deploy metadata'));
this.ms.error();
} else {
this.ms.goto('Done');
this.ms.skipTo('Done');
this.ms.stop();
}
});

deploy.onCancel((data) => {
this.ms.updateData({ mdapiDeploy: data, status: mdTransferMessages.getMessage(data?.status ?? 'Canceled') });

this.ms.stop(new Error('Deploy canceled'));
this.ms.error();
});

deploy.onError((error: Error) => {
if (error.message.includes('client has timed out')) {
this.ms.updateData({ status: 'Client Timeout' });
}

this.ms.stop(error);
this.ms.error();
throw error;
});
}
Expand All @@ -178,8 +184,12 @@ export class DeployStages {
this.ms.updateData(data);
}

public stop(error?: Error): void {
this.ms.stop(error);
public stop(): void {
this.ms.stop();
}

public error(): void {
this.ms.error();
}

public done(data?: Partial<Data>): void {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1528,13 +1528,13 @@
wordwrap "^1.0.0"
wrap-ansi "^7.0.0"

"@oclif/multi-stage-output@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@oclif/multi-stage-output/-/multi-stage-output-0.3.0.tgz#2d74763bd2215c61ec1cd53faf3138328d50122d"
integrity sha512-7pMD3CoXfS9/hEWzZ1b8GZb3leSNWENsMJS7uYTX0XqTXlrzh+eYvFHYcJh9bEkIw67LKjFfGGIwXbotdhtZKg==
"@oclif/multi-stage-output@^0.4.1-dev.0":
version "0.4.2"
resolved "https://registry.yarnpkg.com/@oclif/multi-stage-output/-/multi-stage-output-0.4.2.tgz#2a2b9e46b828ed72775cc7616db97e48aacfab7c"
integrity sha512-wS+58pirRbXc34xTJjXsX/MjQHWa/P2B/tYe/5USfpW8Yj2l07rcFVeJwbh/NnuYb8JkGvqGYi/fP+0I4FKwow==
dependencies:
"@oclif/core" "^4"
"@types/react" "^18.3.3"
"@types/react" "^18.3.5"
change-case "^5.4.4"
cli-spinners "^2"
figures "^6.1.0"
Expand Down Expand Up @@ -2581,10 +2581,10 @@
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==

"@types/react@^18.3.3":
version "18.3.3"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3.tgz#9679020895318b0915d7a3ab004d92d33375c45f"
integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==
"@types/react@^18.3.5":
version "18.3.5"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.5.tgz#5f524c2ad2089c0ff372bbdabc77ca2c4dbadf8f"
integrity sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==
dependencies:
"@types/prop-types" "*"
csstype "^3.0.2"
Expand Down

0 comments on commit 15685e5

Please sign in to comment.