Skip to content

Commit 0d18cd0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into all-repomap
2 parents 8ba8d06 + 2af8b45 commit 0d18cd0

File tree

21 files changed

+294
-410
lines changed

21 files changed

+294
-410
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": "Auth: SSO session was bad, but no reauth prompt given"
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/auth/sso/cache.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import { getLogger } from '../../shared/logger/logger'
1010
import fs from '../../shared/fs/fs'
1111
import { createDiskCache, KeyedCache, mapCache } from '../../shared/utilities/cacheUtils'
1212
import { stripUndefined } from '../../shared/utilities/collectionUtils'
13-
import { hasProps, selectFrom } from '../../shared/utilities/tsUtils'
13+
import { getMissingProps, hasProps, selectFrom } from '../../shared/utilities/tsUtils'
1414
import { SsoToken, ClientRegistration } from './model'
1515
import { DevSettings } from '../../shared/settings'
1616
import { onceChanged } from '../../shared/utilities/functionUtils'
1717
import globals from '../../shared/extensionGlobals'
18+
import { ToolkitError } from '../../shared/errors'
1819

1920
interface RegistrationKey {
2021
readonly startUrl: string
@@ -92,6 +93,12 @@ export function getTokenCache(directory = getCacheDir()): KeyedCache<SsoAccess>
9293

9394
stripUndefined(token)
9495

96+
// Validate data is not missing.
97+
const missingProps = getMissingProps(token, 'accessToken', 'refreshToken')
98+
if (missingProps.length > 0) {
99+
throw new ToolkitError(`SSO cache data unexpectedly missing props: ${JSON.stringify(missingProps)}`)
100+
}
101+
95102
return {
96103
token,
97104
registration,

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) => {

0 commit comments

Comments
 (0)