Skip to content

Commit e196f02

Browse files
committed
Merge branch 'master' into appComposer/raceConditionFix
2 parents 6566d24 + 8113288 commit e196f02

File tree

6 files changed

+61
-4
lines changed

6 files changed

+61
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Breaking Change",
3+
"description": "Change focus chat keybind to win+alt+i on Windows, cmd+alt+i on macOS, and meta+alt+i on Linux"
4+
}

packages/amazonq/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,9 @@
609609
"keybindings": [
610610
{
611611
"command": "_aws.amazonq.focusChat.keybinding",
612-
"win": "ctrl+win+i",
613-
"mac": "ctrl+cmd+i",
614-
"linux": "ctrl+meta+i"
612+
"win": "win+alt+i",
613+
"mac": "cmd+alt+i",
614+
"linux": "meta+alt+i"
615615
},
616616
{
617617
"command": "aws.amazonq.explainCode",

packages/amazonq/src/inlineChat/controller/inlineChatController.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export class InlineChatController {
286286
}
287287
}
288288
if (chatEvent.error) {
289+
getLogger().error('generateAssistantResponse stream error: %s', chatEvent.error)
289290
await this.rejectAllChanges(this.task, false)
290291
void vscode.window.showErrorMessage(`Amazon Q: ${chatEvent.error.message}`)
291292
await this.updateTaskAndLenses(this.task, TaskState.Complete)

packages/core/src/awsService/ec2/activation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export async function activate(ctx: ExtContext): Promise<void> {
4444
}),
4545

4646
Commands.register('aws.ec2.openRemoteConnection', async (node?: Ec2Node) => {
47-
await openRemoteConnection(connectionManagers, node)
47+
await telemetry.ec2_connectToInstance.run(async (span) => {
48+
span.record({ ec2ConnectionType: 'remoteWorkspace' })
49+
await openRemoteConnection(connectionManagers, node)
50+
})
4851
}),
4952

5053
Commands.register('aws.ec2.startInstance', async (node?: Ec2Node) => {

packages/core/src/awsService/ec2/sshKeyPair.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export class SshKeyPair {
8080
}
8181
return !(await tryRun('ssh-keygen', ['-t', keyType, '-N', '', '-q', '-f', keyPath], 'yes', 'unknown key type', {
8282
onStdout: overrideKeys,
83+
timeout: new Timeout(5000),
8384
}))
8485
}
8586

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*!
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
import * as vscode from 'vscode'
6+
import * as sinon from 'sinon'
7+
import { assertTelemetry } from '../../testUtil'
8+
import { Ec2InstanceNode } from '../../../awsService/ec2/explorer/ec2InstanceNode'
9+
import { Ec2ParentNode } from '../../../awsService/ec2/explorer/ec2ParentNode'
10+
import { Ec2Client } from '../../../shared/clients/ec2Client'
11+
import { Ec2Connecter } from '../../../awsService/ec2/model'
12+
import { PollingSet } from '../../../shared/utilities/pollingSet'
13+
14+
describe('ec2 activation', function () {
15+
let testNode: Ec2InstanceNode
16+
17+
before(function () {
18+
const testRegion = 'test-region'
19+
const testPartition = 'test-partition'
20+
// Don't want to be polling here, that is tested in ../ec2ParentNode.test.ts
21+
// disabled here for convenience (avoiding race conditions with timeout)
22+
sinon.stub(PollingSet.prototype, 'start')
23+
const testClient = new Ec2Client(testRegion)
24+
const parentNode = new Ec2ParentNode(testRegion, testPartition, new Ec2Client(testRegion))
25+
testNode = new Ec2InstanceNode(parentNode, testClient, testRegion, testPartition, {
26+
InstanceId: 'testId',
27+
LastSeenStatus: 'status',
28+
})
29+
})
30+
31+
after(function () {
32+
sinon.restore()
33+
})
34+
35+
it('telemetry', async function () {
36+
const terminalStub = sinon.stub(Ec2Connecter.prototype, 'attemptToOpenEc2Terminal')
37+
await vscode.commands.executeCommand('aws.ec2.openTerminal', testNode)
38+
39+
assertTelemetry('ec2_connectToInstance', { ec2ConnectionType: 'ssm' })
40+
terminalStub.restore()
41+
42+
const stopInstanceStub = sinon.stub(Ec2Client.prototype, 'stopInstanceWithCancel')
43+
await vscode.commands.executeCommand('aws.ec2.stopInstance', testNode)
44+
45+
assertTelemetry('ec2_changeState', { ec2InstanceState: 'stop' })
46+
stopInstanceStub.restore()
47+
})
48+
})

0 commit comments

Comments
 (0)