Skip to content

Commit a5f8e10

Browse files
committed
Merge branch 'master' into flakyTestTemplate
2 parents 4d75e4f + 2844554 commit a5f8e10

File tree

67 files changed

+3617
-1709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+3617
-1709
lines changed

package-lock.json

Lines changed: 11 additions & 11 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": "Bug Fix",
3+
"description": "Chat container exceeds width of container"
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": "amazon q inline: skip indexing when no workspace folders are found"
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": "file details and name unneccessary cropping"
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 /dev: support `.gradle` files"
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": "Notifications: Support for delivering critical alerts and product updates"
4+
}

packages/amazonq/src/extensionNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function activateAmazonQNode(context: vscode.ExtensionContext) {
7575
...authState,
7676
})
7777

78-
await activateNotifications(context, authState, getAuthState)
78+
void activateNotifications(context, authState, getAuthState)
7979
}
8080

8181
async function getAuthState(): Promise<Omit<AuthUserState, 'source'>> {

packages/amazonq/test/unit/amazonqFeatureDev/session/session.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ describe('session', () => {
109109
it('only insert non rejected files', async () => {
110110
const fsSpyWriteFile = sinon.spy(fs, 'writeFile')
111111
const session = await createCodeGenState()
112+
sinon.stub(session, 'sendLinesOfCodeAcceptedTelemetry').resolves()
112113
await sessionWriteFile(session, uri, encodedContent)
113114
await session.insertChanges()
114115

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"content": [
3+
{
4+
"name": "Added file",
5+
"fileName": "resources/files/addedFile.diff",
6+
"isSuccessful": true
7+
}
8+
]
9+
}

packages/amazonq/test/unit/amazonqGumby/transformationResultsHandler.test.ts

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
*/
55
import assert from 'assert'
66
import sinon from 'sinon'
7-
import os from 'os'
87
import { DiffModel, AddedChangeNode, ModifiedChangeNode } from 'aws-core-vscode/codewhisperer/node'
8+
import { DescriptionContent } from 'aws-core-vscode/codewhisperer'
99
import path from 'path'
1010
import { getTestResourceFilePath } from './amazonQGumbyUtil'
1111
import { fs } from 'aws-core-vscode/shared'
12+
import { createTestWorkspace } from 'aws-core-vscode/test'
1213

1314
describe('DiffModel', function () {
15+
let parsedTestDescriptions: DescriptionContent
16+
beforeEach(async () => {
17+
parsedTestDescriptions = JSON.parse(await fs.readFileText(getTestResourceFilePath('resources/files/diff.json')))
18+
})
19+
1420
afterEach(() => {
1521
sinon.restore()
1622
})
@@ -28,34 +34,76 @@ describe('DiffModel', function () {
2834

2935
return true
3036
})
37+
testDiffModel.parseDiff(
38+
getTestResourceFilePath('resources/files/addedFile.diff'),
39+
workspacePath,
40+
parsedTestDescriptions.content[0],
41+
1
42+
)
3143

32-
testDiffModel.parseDiff(getTestResourceFilePath('resources/files/addedFile.diff'), workspacePath)
33-
34-
assert.strictEqual(testDiffModel.changes.length, 1)
35-
const change = testDiffModel.changes[0]
44+
assert.strictEqual(
45+
testDiffModel.patchFileNodes[0].patchFilePath,
46+
getTestResourceFilePath('resources/files/addedFile.diff')
47+
)
48+
assert(testDiffModel.patchFileNodes[0].label.includes(parsedTestDescriptions.content[0].name))
49+
const change = testDiffModel.patchFileNodes[0].children[0]
3650

3751
assert.strictEqual(change instanceof AddedChangeNode, true)
3852
})
3953

4054
it('WHEN parsing a diff patch where a file was modified THEN returns an array representing the modified file', async function () {
4155
const testDiffModel = new DiffModel()
4256

43-
const workspacePath = os.tmpdir()
44-
45-
sinon.replace(fs, 'exists', async (path) => true)
57+
const fileAmount = 1
58+
const workspaceFolder = await createTestWorkspace(fileAmount, { fileContent: '' })
4659

4760
await fs.writeFile(
48-
path.join(workspacePath, 'README.md'),
61+
path.join(workspaceFolder.uri.fsPath, 'README.md'),
4962
'This guide walks you through using Gradle to build a simple Java project.'
5063
)
5164

52-
testDiffModel.parseDiff(getTestResourceFilePath('resources/files/modifiedFile.diff'), workspacePath)
65+
testDiffModel.parseDiff(
66+
getTestResourceFilePath('resources/files/modifiedFile.diff'),
67+
workspaceFolder.uri.fsPath,
68+
parsedTestDescriptions.content[0],
69+
1
70+
)
5371

54-
assert.strictEqual(testDiffModel.changes.length, 1)
55-
const change = testDiffModel.changes[0]
72+
assert.strictEqual(
73+
testDiffModel.patchFileNodes[0].patchFilePath,
74+
getTestResourceFilePath('resources/files/modifiedFile.diff')
75+
)
76+
assert(testDiffModel.patchFileNodes[0].label.includes(parsedTestDescriptions.content[0].name))
77+
const change = testDiffModel.patchFileNodes[0].children[0]
5678

5779
assert.strictEqual(change instanceof ModifiedChangeNode, true)
80+
})
81+
82+
it('WHEN parsing a diff patch where diff.json is not present and a file was modified THEN returns an array representing the modified file', async function () {
83+
const testDiffModel = new DiffModel()
5884

59-
await fs.delete(path.join(workspacePath, 'README.md'), { recursive: true })
85+
const fileAmount = 1
86+
const workspaceFolder = await createTestWorkspace(fileAmount, { fileContent: '' })
87+
88+
await fs.writeFile(
89+
path.join(workspaceFolder.uri.fsPath, 'README.md'),
90+
'This guide walks you through using Gradle to build a simple Java project.'
91+
)
92+
93+
testDiffModel.parseDiff(
94+
getTestResourceFilePath('resources/files/modifiedFile.diff'),
95+
workspaceFolder.uri.fsPath,
96+
undefined,
97+
1
98+
)
99+
100+
assert.strictEqual(
101+
testDiffModel.patchFileNodes[0].patchFilePath,
102+
getTestResourceFilePath('resources/files/modifiedFile.diff')
103+
)
104+
assert(testDiffModel.patchFileNodes[0].label.endsWith('modifiedFile.diff'))
105+
const change = testDiffModel.patchFileNodes[0].children[0]
106+
107+
assert.strictEqual(change instanceof ModifiedChangeNode, true)
60108
})
61109
})

0 commit comments

Comments
 (0)