-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wr/add missing local components #959
Changes from all commits
c7b2eb0
dd224bc
c54a696
0f71116
88ab441
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ import { | |
JUnitReporter, | ||
TestResult, | ||
} from '@salesforce/apex-node'; | ||
import { getState } from '@salesforce/source-deploy-retrieve/lib/src/client/deployMessages.js'; | ||
import { | ||
DeployResultJson, | ||
isSdrFailure, | ||
|
@@ -51,10 +52,10 @@ import { | |
import { TestResultsFormatter } from '../formatters/testResultsFormatter.js'; | ||
|
||
export class DeployResultFormatter extends TestResultsFormatter implements Formatter<DeployResultJson> { | ||
private relativeFiles: FileResponse[]; | ||
private absoluteFiles: FileResponse[]; | ||
private coverageOptions: CoverageReporterOptions; | ||
private resultsDir: string; | ||
private readonly relativeFiles: FileResponse[]; | ||
private readonly absoluteFiles: FileResponse[]; | ||
private readonly coverageOptions: CoverageReporterOptions; | ||
private readonly resultsDir: string; | ||
private readonly junit: boolean | undefined; | ||
|
||
public constructor( | ||
|
@@ -285,6 +286,26 @@ export class DeployResultFormatter extends TestResultsFormatter implements Forma | |
private displaySuccesses(): void { | ||
const successes = this.relativeFiles.filter(isSdrSuccess); | ||
|
||
ensureArray(this.result.response.details.componentSuccesses) | ||
.filter( | ||
(fromServer) => | ||
// removes package.xml, other manifests | ||
fromServer.componentType !== '' && | ||
// if we don't find the file in the response, it's because it doesn't exist locally, yet | ||
!successes.find( | ||
(fromLocal) => fromServer.fullName === fromLocal.fullName && fromServer.componentType === fromLocal.type | ||
) | ||
) | ||
.map((s) => | ||
successes.push({ | ||
fullName: s.fullName, | ||
// @ts-expect-error getState can return 'failed' which isn't applicable to FileSuccess | ||
state: getState(s), | ||
type: s.componentType ?? '', | ||
filePath: 'Not found in project', | ||
}) | ||
); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO, SDR should do this. Other clients may have the same problem and need this code. I think SDR should report everything that happened, using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried that, but NUTs had errors, maybe there's a different method, or a new one, but I don't think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like your SDR solution better (made 1 comment there). I think the NUT failures look to all be So maybe explore why that's hitting missing files? |
||
if (!successes.length || this.result.response.status === RequestStatus.Failed) return; | ||
|
||
const columns = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't do this kind of import. If we need this method it should be made public in SDR and exported.