Skip to content

Commit 6841217

Browse files
committed
Merge branch 'master' into fixWindowsTest
2 parents a4b01f1 + 7f3f45c commit 6841217

24 files changed

+4898
-4950
lines changed

package-lock.json

Lines changed: 3265 additions & 4873 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"workspaces": [
44
"packages/core/src/web",
55
"packages/*",
6-
"plugins/*",
7-
"src.gen/@amzn/codewhisperer-streaming"
6+
"plugins/*"
87
],
98
"version": "0.0.1",
109
"private": true,
@@ -21,6 +20,7 @@
2120
},
2221
"scripts": {
2322
"prepare": "ts-node ./scripts/prepare.ts",
23+
"preinstall": "cd src.gen/@amzn/codewhisperer-streaming && npm i",
2424
"postinstall": "npm run buildCustomLintPlugin && npm run postinstall -ws --if-present",
2525
"buildCustomLintPlugin": "npm run build -w plugins/eslint-plugin-aws-toolkits",
2626
"compile": "npm run compile -w packages/",
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"date": "2024-09-27",
3+
"version": "1.27.0",
4+
"entries": [
5+
{
6+
"type": "Bug Fix",
7+
"description": "Security Scan: Fixes an issue that incorrectly removes hardcoded credentials detections from auto scans."
8+
}
9+
]
10+
}

packages/amazonq/.changes/next-release/Bug Fix-385bc912-dc06-4b16-91ae-47fa1c586367.json

Lines changed: 0 additions & 4 deletions
This file was deleted.
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": "Amazon Q /dev: define first folder as a root path for LLM-created files when using workspaces"
4+
}

packages/amazonq/.changes/next-release/Feature-cd5797a0-6460-4fc6-b3f7-47f55f9bf163.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/amazonq/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.27.0 2024-09-27
2+
3+
- **Bug Fix** Security Scan: Fixes an issue that incorrectly removes hardcoded credentials detections from auto scans.
4+
15
## 1.26.0 2024-09-19
26

37
- **Bug Fix** Security Scan: Fixed an issue where the wrong icon was used in the status bar menu.

packages/amazonq/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "amazon-q-vscode",
33
"displayName": "Amazon Q",
44
"description": "Amazon Q is your generative AI-powered assistant across the software development lifecycle.",
5-
"version": "1.27.0-SNAPSHOT",
5+
"version": "1.28.0-SNAPSHOT",
66
"extensionKind": [
77
"workspace"
88
],
@@ -352,7 +352,7 @@
352352
{
353353
"command": "aws.amazonq.generateUnitTests",
354354
"group": "cw_chat@5",
355-
"when": "aws.codewhisperer.connected && aws.isInternalUser"
355+
"when": "false"
356356
},
357357
{
358358
"command": "aws.amazonq.sendToPrompt",
@@ -432,7 +432,7 @@
432432
"command": "aws.amazonq.generateUnitTests",
433433
"title": "%AWS.command.amazonq.generateUnitTests%",
434434
"category": "%AWS.amazonq.title%",
435-
"enablement": "aws.codewhisperer.connected && aws.isInternalUser"
435+
"enablement": "false"
436436
},
437437
{
438438
"command": "aws.amazonq.reconnect",
@@ -615,7 +615,7 @@
615615
"key": "win+alt+t",
616616
"mac": "cmd+alt+t",
617617
"linux": "meta+alt+t",
618-
"when": "aws.codewhisperer.connected && aws.isInternalUser"
618+
"when": "false"
619619
},
620620
{
621621
"command": "aws.amazonq.invokeInlineCompletion",

packages/core/src/amazonqFeatureDev/session/sessionState.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ function registerNewFiles(
6868
fs.registerProvider(uri, new VirtualMemoryFile(contents))
6969
const prefix =
7070
workspaceFolderPrefixes === undefined ? '' : zipFilePath.substring(0, zipFilePath.indexOf(path.sep))
71-
const folder = workspaceFolderPrefixes === undefined ? workspaceFolders[0] : workspaceFolderPrefixes[prefix]
71+
const folder =
72+
workspaceFolderPrefixes === undefined
73+
? workspaceFolders[0]
74+
: workspaceFolderPrefixes[prefix] ??
75+
workspaceFolderPrefixes[
76+
Object.values(workspaceFolderPrefixes).find((val) => val.index === 0)?.name ?? ''
77+
]
7278
if (folder === undefined) {
7379
getLogger().error(`No workspace folder found for file: ${zipFilePath} and prefix: ${prefix}`)
7480
continue
@@ -78,7 +84,9 @@ function registerNewFiles(
7884
fileContent,
7985
virtualMemoryUri: uri,
8086
workspaceFolder: folder,
81-
relativePath: zipFilePath.substring(workspaceFolderPrefixes === undefined ? 0 : prefix.length + 1),
87+
relativePath: zipFilePath.substring(
88+
workspaceFolderPrefixes === undefined ? 0 : prefix.length > 0 ? prefix.length + 1 : 0
89+
),
8290
rejected: false,
8391
})
8492
}

packages/core/src/amazonqFeatureDev/util/files.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,18 @@ export async function prepareRepoData(
6363
const iterator = ignoredExtensionMap.entries()
6464

6565
for (let i = 0; i < ignoredExtensionMap.size; i++) {
66-
const [key, value] = iterator.next().value
67-
await amznTelemetry.amazonq_bundleExtensionIgnored.run(async (bundleSpan) => {
68-
const event = {
69-
filenameExt: key,
70-
count: value,
71-
}
66+
const iteratorValue = iterator.next().value
67+
if (iteratorValue) {
68+
const [key, value] = iteratorValue
69+
await amznTelemetry.amazonq_bundleExtensionIgnored.run(async (bundleSpan) => {
70+
const event = {
71+
filenameExt: key,
72+
count: value,
73+
}
7274

73-
bundleSpan.record(event)
74-
})
75+
bundleSpan.record(event)
76+
})
77+
}
7578
}
7679

7780
telemetry.setRepositorySize(totalBytes)
@@ -117,7 +120,9 @@ export function getPathsFromZipFilePath(
117120
}
118121
// otherwise the first part of the zipPath is the prefix
119122
const prefix = zipFilePath.substring(0, zipFilePath.indexOf(path.sep))
120-
const workspaceFolder = workspacesByPrefix[prefix]
123+
const workspaceFolder =
124+
workspacesByPrefix[prefix] ??
125+
(workspacesByPrefix[Object.values(workspacesByPrefix).find((val) => val.index === 0)?.name ?? ''] || undefined)
121126
if (workspaceFolder === undefined) {
122127
throw new ToolkitError(`Could not find workspace folder for prefix ${prefix}`)
123128
}

0 commit comments

Comments
 (0)