Skip to content

Commit 66bb36c

Browse files
committed
Merge branch 'master' into kevin/fix-session
2 parents 05d4664 + 6ff8655 commit 66bb36c

40 files changed

+1413
-57
lines changed

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Amazon Q chat: Use `@` to add folders, files, and saved prompts as context"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "/review: Code reviews are now created with additional workspace context to enable grouping of related scans in the backend"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Amazon Q chat: increase chat input height to 3 lines"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Amazon Q chat: Show list of files sent as context in chat response"
4+
}

packages/amazonq/test/e2e/amazonq/chat.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { MynahUIDataModel } from '@aws/mynah-ui'
1111
import { assertContextCommands, assertQuickActions } from './assert'
1212
import { registerAuthHook, using } from 'aws-core-vscode/test'
1313
import { loginToIdC } from './utils/setup'
14-
import { webviewConstants } from 'aws-core-vscode/amazonq'
14+
import { webviewConstants, webviewTabConstants } from 'aws-core-vscode/amazonq'
1515

1616
describe('Amazon Q Chat', function () {
1717
let framework: qTestingFramework
@@ -60,7 +60,7 @@ describe('Amazon Q Chat', function () {
6060
})
6161

6262
it('Shows placeholder', () => {
63-
assert.deepStrictEqual(store.promptInputPlaceholder, 'Ask a question or enter "/" for quick actions')
63+
assert.deepStrictEqual(store.promptInputPlaceholder, webviewTabConstants.commonTabData.placeholder)
6464
})
6565

6666
it('Sends message', async () => {

packages/amazonq/test/e2e/amazonq/framework/jsdomInjector.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export function injectJSDOM() {
4040
get() {
4141
return this.textContent
4242
},
43+
set(value) {
44+
this.textContent = value
45+
},
4346
})
4447

4548
// jsdom doesn't have support for structuredClone. See https://github.com/jsdom/jsdom/issues/3363

packages/amazonq/test/unit/codewhisperer/service/securityScanHandler.test.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import {
1515
ListCodeScanFindingsResponse,
1616
pollScanJobStatus,
1717
SecurityScanTimedOutError,
18+
generateScanName,
1819
} from 'aws-core-vscode/codewhisperer'
19-
import { timeoutUtils } from 'aws-core-vscode/shared'
20+
import { getStringHash, timeoutUtils } from 'aws-core-vscode/shared'
2021
import assert from 'assert'
2122
import sinon from 'sinon'
2223
import * as vscode from 'vscode'
@@ -320,4 +321,37 @@ describe('securityScanHandler', function () {
320321
await assert.rejects(() => pollPromise, SecurityScanTimedOutError)
321322
})
322323
})
324+
325+
describe('generateScanName', function () {
326+
const clientId = 'ffffffff-ffff-ffff-ffff-ffffffffffff'
327+
328+
it('generates scan name for FILE_AUTO scope', function () {
329+
const result = generateScanName(['/some/root/path'], CodeAnalysisScope.FILE_AUTO, '/path/to/some/file')
330+
assert.strictEqual(result, getStringHash(`${clientId}::/path/to/some/file::FILE_AUTO`))
331+
})
332+
333+
it('generates scan name for FILE_ON_DEMAND scope', function () {
334+
const result = generateScanName(['/some/root/path'], CodeAnalysisScope.FILE_ON_DEMAND, '/path/to/some/file')
335+
assert.strictEqual(result, getStringHash(`${clientId}::/path/to/some/file::FILE_ON_DEMAND`))
336+
})
337+
338+
it('generates scan name for PROJECT scope with a single project root', function () {
339+
const result = generateScanName(['/some/root/path'], CodeAnalysisScope.PROJECT)
340+
assert.strictEqual(result, getStringHash(`${clientId}::/some/root/path::PROJECT`))
341+
})
342+
343+
it('generates scan name for PROJECT scope with multiple project roots', function () {
344+
const result = generateScanName(['/some/root/pathB', '/some/root/pathA'], CodeAnalysisScope.PROJECT)
345+
assert.strictEqual(result, getStringHash(`${clientId}::/some/root/pathA,/some/root/pathB::PROJECT`))
346+
})
347+
348+
it('does not exceed 126 characters', function () {
349+
let reallyDeepFilePath = ''
350+
for (let i = 0; i < 100; i++) {
351+
reallyDeepFilePath += '/some/deep/path'
352+
}
353+
const result = generateScanName(['/some/root/path'], CodeAnalysisScope.FILE_ON_DEMAND, reallyDeepFilePath)
354+
assert.ok(result.length <= 126)
355+
})
356+
})
323357
})

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@
510510
"@aws-sdk/property-provider": "<3.696.0",
511511
"@aws-sdk/smithy-client": "<3.696.0",
512512
"@aws-sdk/util-arn-parser": "<3.696.0",
513-
"@aws/mynah-ui": "^4.22.1",
513+
"@aws/mynah-ui": "^4.23.0",
514514
"@gerhobbelt/gitignore-parser": "^0.2.0-9",
515515
"@iarna/toml": "^2.2.5",
516516
"@smithy/middleware-retry": "^3.0.0",

packages/core/package.nls.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,17 @@
309309
"AWS.codewhisperer.customization.notification.new_customizations.learn_more": "Learn More",
310310
"AWS.amazonq.title": "Amazon Q",
311311
"AWS.amazonq.chat": "Chat",
312+
"AWS.amazonq.context.folders.title": "Folders",
313+
"AWS.amazonq.context.folders.description": "Add all files in a folder to context",
314+
"AWS.amazonq.context.files.title": "Files",
315+
"AWS.amazonq.context.files.description": "Add a file to context",
316+
"AWS.amazonq.context.prompts.title": "Prompts",
317+
"AWS.amazonq.context.prompts.description": "Add a saved prompt to context",
318+
"AWS.amazonq.savedPrompts.title": "Prompt name",
319+
"AWS.amazonq.savedPrompts.create": "Create",
320+
"AWS.amazonq.savedPrompts.action": "Create a new prompt",
321+
"AWS.amazonq.savedPrompts.placeholder": "Enter prompt name",
322+
"AWS.amazonq.savedPrompts.description": "Use this prompt by typing '@' followed by the prompt name.",
312323
"AWS.amazonq.chat.workspacecontext.enable.message": "Amazon Q: Workspace index is now enabled. You can disable it from Amazon Q settings.",
313324
"AWS.amazonq.security": "Code Issues",
314325
"AWS.amazonq.login": "Login",

0 commit comments

Comments
 (0)