diff --git a/src/formatters/deployResultFormatter.ts b/src/formatters/deployResultFormatter.ts index ef2e1c3e..c52f7601 100644 --- a/src/formatters/deployResultFormatter.ts +++ b/src/formatters/deployResultFormatter.ts @@ -270,6 +270,22 @@ export class DeployResultFormatter extends TestResultsFormatter implements Forma if (this.result.response.status === RequestStatus.Succeeded) return; const failures = this.relativeFiles.filter(isSdrFailure); + const deployMessages = ensureArray(this.result.response.details?.componentFailures); + if (deployMessages.length > failures.length) { + const failureKeySet = new Set(failures.map((f) => makeKey(f.type, f.fullName))); + // if there's additional failures in the API response, find the failure and add it to the output + deployMessages + .filter((m) => !m.componentType || !failureKeySet.has(makeKey(m.componentType, m.fullName))) + .map((deployMessage) => { + failures.push({ + fullName: deployMessage.fullName, + type: deployMessage.componentType ?? 'UNKNOWN', + state: ComponentStatus.Failed, + error: deployMessage.problem ?? 'UNKNOWN', + problemType: deployMessage.problemType ?? 'Error', + }); + }); + } if (!failures.length) return; const columns = { @@ -309,3 +325,5 @@ export class DeployResultFormatter extends TestResultsFormatter implements Forma ux.table(getFileResponseSuccessProps(deletions), columns, options); } } + +const makeKey = (type: string, name: string): string => `${type}#${name}`;