Skip to content

Commit b4f2428

Browse files
authored
fix(amazonq): /review returns 0 findings aws#6992
1 parent 6af0425 commit b4f2428

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Bug Fix",
3+
"description": "Fix bug where review shows 0 findings"
4+
}

packages/core/src/codewhisperer/client/codewhisperer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,15 @@ export class DefaultCodeWhispererClient {
202202
}
203203

204204
public async listCodeScanFindings(
205-
request: ListCodeScanFindingsRequest
205+
request: ListCodeScanFindingsRequest,
206+
profileArn: string | undefined
206207
): Promise<PromiseResult<ListCodeScanFindingsResponse, AWSError>> {
207208
if (this.isBearerTokenAuth()) {
208209
const req = {
209210
jobId: request.jobId,
210211
nextToken: request.nextToken,
211212
codeAnalysisFindingsSchema: 'codeanalysis/findings/1.0',
213+
profileArn: profileArn,
212214
} as CodeWhispererUserClient.ListCodeAnalysisFindingsRequest
213215
return (await this.createUserSdkClient()).listCodeAnalysisFindings(req).promise()
214216
}

packages/core/src/codewhisperer/service/securityScanHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export async function listScanResults(
5757
const logger = getLoggerForScope(scope)
5858
const codeScanIssueMap: Map<string, RawCodeScanIssue[]> = new Map()
5959
const aggregatedCodeScanIssueList: AggregatedCodeScanIssue[] = []
60-
const requester = (request: codewhispererClient.ListCodeScanFindingsRequest) => client.listCodeScanFindings(request)
60+
const requester = (request: codewhispererClient.ListCodeScanFindingsRequest) =>
61+
client.listCodeScanFindings(request, profile?.arn)
6162
const request: codewhispererClient.ListCodeScanFindingsRequest = {
6263
jobId,
6364
codeAnalysisFindingsSchema: codeScanFindingsSchema,

0 commit comments

Comments
 (0)