Skip to content

Commit 0234303

Browse files
authored
Merge branch 'aws:master' into master
2 parents 4cd5400 + 0a40071 commit 0234303

File tree

14 files changed

+260
-407
lines changed

14 files changed

+260
-407
lines changed

buildspec/linuxIntegrationTests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,27 @@ phases:
5151
# Ensure that "docker" group has permissions to the socket.
5252
# - chown codebuild-user /var/run/docker.sock
5353
- chmod 666 /var/run/docker.sock
54+
# Pull Docker Images for SAM tests
55+
56+
# Nodejs
57+
- |
58+
docker pull public.ecr.aws/sam/build-nodejs18.x:latest
59+
docker pull public.ecr.aws/sam/build-nodejs20.x:latest
60+
docker pull public.ecr.aws/sam/build-nodejs22.x:latest
61+
# Java
62+
- |
63+
docker pull public.ecr.aws/sam/build-java8.al2:latest
64+
docker pull public.ecr.aws/sam/build-java11:latest
65+
docker pull public.ecr.aws/sam/build-java17:latest
66+
# Python
67+
- |
68+
docker pull public.ecr.aws/sam/build-python3.10:latest
69+
docker pull public.ecr.aws/sam/build-python3.11:latest
70+
docker pull public.ecr.aws/sam/build-python3.12:latest
71+
docker pull public.ecr.aws/sam/build-python3.13:latest
72+
# Dotnet
73+
- |
74+
docker pull public.ecr.aws/sam/build-dotnet6:latest
5475
5576
pre_build:
5677
commands:

codecov.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ coverage:
8181
target: 80
8282
threshold: 5
8383
only_pulls: true
84-
tests:
85-
# Most code in test/ should always be "covered"!
86-
target: 95
87-
paths:
88-
- '**/test/**'
8984
patch:
9085
default:
9186
# Note: `default` measures the entire project.
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": "Code Review: Cleaned up output logs when running /review"
4+
}
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": "Code Review: Fixed a bug where applying a fix did not update the positions of other issues in the same file."
4+
}
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": "Code Review: Fixed a bug where projects with repeated path names did not scan properly."
4+
}

packages/amazonq/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@
210210
"type": "tree",
211211
"id": "aws.amazonq.SecurityIssuesTree",
212212
"name": "%AWS.amazonq.security%",
213-
"when": "!aws.isSageMaker && !aws.isWebExtHost && !aws.amazonq.showLoginView"
213+
"when": "!aws.isSageMaker && !aws.isWebExtHost && !aws.amazonq.showLoginView",
214+
"visibility": "collapsed"
214215
},
215216
{
216217
"type": "webview",

packages/amazonq/test/unit/codewhisperer/util/zipUtil.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ import { ToolkitError } from 'aws-core-vscode/shared'
1414
import { LspClient } from 'aws-core-vscode/amazonq'
1515
import { fs } from 'aws-core-vscode/shared'
1616
import path from 'path'
17+
import JSZip from 'jszip'
1718

1819
describe('zipUtil', function () {
1920
const workspaceFolder = getTestWorkspaceFolder()
2021
const appRoot = join(workspaceFolder, 'java11-plain-maven-sam-app')
2122
const appCodePath = join(appRoot, 'HelloWorldFunction', 'src', 'main', 'java', 'helloworld', 'App.java')
23+
const appCodePathWithRepeatedProjectName = join(workspaceFolder, 'workspaceFolder', 'App.java')
2224

2325
describe('getProjectPaths', function () {
2426
it('Should return the correct project paths', function () {
@@ -112,6 +114,30 @@ describe('zipUtil', function () {
112114
)
113115
assert.equal(zipMetadata2.lines, zipMetadata.lines + 1)
114116
})
117+
118+
it('should handle path with repeated project name for file scan', async function () {
119+
const zipMetadata = await zipUtil.generateZip(
120+
vscode.Uri.file(appCodePathWithRepeatedProjectName),
121+
CodeAnalysisScope.FILE_ON_DEMAND
122+
)
123+
124+
const zipFileData = await fs.readFileBytes(zipMetadata.zipFilePath)
125+
const zip = await JSZip.loadAsync(zipFileData)
126+
const files = Object.keys(zip.files)
127+
assert.ok(files.includes(join('workspaceFolder', 'workspaceFolder', 'App.java')))
128+
})
129+
130+
it('should handle path with repeated project name for project scan', async function () {
131+
const zipMetadata = await zipUtil.generateZip(
132+
vscode.Uri.file(appCodePathWithRepeatedProjectName),
133+
CodeAnalysisScope.PROJECT
134+
)
135+
136+
const zipFileData = await fs.readFileBytes(zipMetadata.zipFilePath)
137+
const zip = await JSZip.loadAsync(zipFileData)
138+
const files = Object.keys(zip.files)
139+
assert.ok(files.includes(join('workspaceFolder', 'workspaceFolder', 'App.java')))
140+
})
115141
})
116142

117143
describe('generateZipTestGen', function () {

packages/core/src/codewhisperer/commands/basicCommands.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ export const applySecurityFix = Commands.declare(
464464
new vscode.Range(document.lineAt(0).range.start, document.lineAt(document.lineCount - 1).range.end),
465465
updatedContent
466466
)
467-
SecurityIssueProvider.instance.disableEventHandler()
468467
const isApplied = await vscode.workspace.applyEdit(edit)
469468
if (isApplied) {
470469
void document.save().then((didSave) => {

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export class SecurityIssueProvider {
1212
}
1313

1414
private _issues: AggregatedCodeScanIssue[] = []
15-
private _disableEventHandler: boolean = false
1615
public get issues() {
1716
return this._issues
1817
}
@@ -21,19 +20,11 @@ export class SecurityIssueProvider {
2120
this._issues = issues
2221
}
2322

24-
public disableEventHandler() {
25-
this._disableEventHandler = true
26-
}
27-
2823
public handleDocumentChange(event: vscode.TextDocumentChangeEvent) {
2924
// handleDocumentChange function may be triggered while testing by our own code generation.
3025
if (!event.contentChanges || event.contentChanges.length === 0) {
3126
return
3227
}
33-
if (this._disableEventHandler) {
34-
this._disableEventHandler = false
35-
return
36-
}
3728
const { changedRange, lineOffset } = event.contentChanges.reduce(
3829
(acc, change) => ({
3930
changedRange: acc.changedRange.union(change.range),

packages/core/src/codewhisperer/util/gitUtil.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { showOutputMessage } from '../../shared/utilities/messages'
7-
import { getLogger, globals, removeAnsi } from '../../shared'
6+
import { getLogger, removeAnsi } from '../../shared'
87
import { ChildProcess, ChildProcessOptions } from '../../shared/utilities/processUtils'
98
import { Uri } from 'vscode'
109

@@ -17,10 +16,10 @@ export async function isGitRepo(folder: Uri): Promise<boolean> {
1716
rejectOnErrorCode: true,
1817
onStdout: (text) => {
1918
output += text
20-
showOutputMessage(removeAnsi(text), globals.outputChannel)
19+
getLogger().verbose(removeAnsi(text))
2120
},
2221
onStderr: (text) => {
23-
showOutputMessage(removeAnsi(text), globals.outputChannel)
22+
getLogger().error(removeAnsi(text))
2423
},
2524
spawnOptions: {
2625
cwd: folder.fsPath,

0 commit comments

Comments
 (0)