Skip to content

Commit 026d39d

Browse files
committed
Merge branch 'master' into hkobew/ec2/remoteConnect/telemetry
2 parents ea2a1ce + 5f816f1 commit 026d39d

File tree

16 files changed

+186
-57
lines changed

16 files changed

+186
-57
lines changed

.github/workflows/node.js.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ jobs:
8080
uses: coactions/setup-xvfb@v1
8181
with:
8282
run: npm test
83-
- name: Code coverage (Core)
84-
env:
85-
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
86-
NODE_OPTIONS: ''
87-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
88-
uses: codecov/codecov-action@v4
89-
with:
90-
flags: macos-core-unittests
91-
verbose: true
92-
file: ./coverage/core/lcov.info
93-
token: ${{ secrets.CODECOV_TOKEN }}
9483
- name: Code coverage (Toolkit)
9584
env:
9685
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
@@ -113,17 +102,6 @@ jobs:
113102
verbose: true
114103
file: ./coverage/amazonq/lcov.info
115104
token: ${{ secrets.CODECOV_TOKEN }}
116-
- name: Code coverage (CodeWhisperer)
117-
env:
118-
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
119-
NODE_OPTIONS: ''
120-
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && github.ref == 'master' }}
121-
uses: codecov/codecov-action@v4
122-
with:
123-
flags: codewhisperer
124-
verbose: true
125-
file: ./coverage/core/lcov.info
126-
token: ${{ secrets.CODECOV_TOKEN }}
127105

128106
web:
129107
needs: lint-commits

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ To run tests against a specific folder in VSCode, do any one of:
218218
219219
### Coverage report
220220
221-
You can find the coverage report at `./coverage/amazonq/lcov-report/index.html` and `./coverage/core/lcov-report/index.html` after running the tests. Tests ran from the workspace launch config won't generate a coverage report automatically because it can break file watching.
221+
You can find the coverage report at `./coverage/amazonq/lcov-report/index.html` and `./coverage/toolkit/lcov-report/index.html` after running the tests. Tests ran from the workspace launch config won't generate a coverage report automatically because it can break file watching.
222222
223223
### CodeCatalyst Blueprints
224224

buildspec/linuxE2ETests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ phases:
4141
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
4242
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g')
4343
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"
44-
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
44+
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
4545
finally:
4646
- rm -rf ~/.aws/sso/cache || true
4747
reports:

buildspec/linuxIntegrationTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ phases:
7575
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
7676
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g')
7777
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"
78-
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
78+
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
7979
post_build:
8080
commands:
8181
# Destroy .netrc to avoid leaking $GITHUB_READONLY_TOKEN.

buildspec/linuxTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ phases:
4848
- VCS_COMMIT_ID="${CODEBUILD_RESOLVED_SOURCE_VERSION}"
4949
- CI_BUILD_URL=$(echo $CODEBUILD_BUILD_URL | sed 's/#/%23/g') # Encode `#` in the URL because otherwise the url is clipped in the Codecov.io site
5050
- CI_BUILD_ID="${CODEBUILD_BUILD_ID}"
51-
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/core/lcov.info --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
51+
- test -n "${CODECOV_TOKEN}" && [ "$TARGET_BRANCH" = "master" ] && ./codecov --token=${CODECOV_TOKEN} --branch=${CODEBUILD_RESOLVED_SOURCE_VERSION} --repository=${CODEBUILD_SOURCE_REPO_URL} --file=./coverage/amazonq/lcov.info --file=./coverage/toolkit/lcov.info
5252

5353
reports:
5454
unit-test:

packages/core/.c8rc.json

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ export class SshKeyPair {
4545

4646
public static async generateSshKeyPair(keyPath: string): Promise<void> {
4747
const keyGenerated = await SshKeyPair.tryKeyTypes(keyPath, ['ed25519', 'rsa'])
48-
await SshKeyPair.assertGenerated(keyPath, keyGenerated)
4948
// Should already be the case, but just in case we assert permissions.
5049
// skip on Windows since it only allows write permission to be changed.
5150
if (!globals.isWeb && os.platform() !== 'win32') {
5251
await fs.chmod(keyPath, 0o600)
52+
await SshKeyPair.assertGenerated(keyPath, keyGenerated)
5353
}
5454
}
5555
/**

packages/core/src/codewhisperer/commands/basicCommands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ import { ToolkitError, getTelemetryReason, getTelemetryReasonDesc } from '../../
4141
import { isRemoteWorkspace } from '../../shared/vscode/env'
4242
import { isBuilderIdConnection } from '../../auth/connection'
4343
import globals from '../../shared/extensionGlobals'
44-
import { getVscodeCliPath, tryRun } from '../../shared/utilities/pathFind'
44+
import { getVscodeCliPath } from '../../shared/utilities/pathFind'
4545
import { setContext } from '../../shared/vscode/setContext'
46+
import { tryRun } from '../../shared/utilities/pathFind'
4647

4748
const MessageTimeOut = 5_000
4849

packages/core/src/shared/remoteSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface MissingTool {
3030
readonly reason?: string
3131
}
3232

33-
const minimumSsmActions = [
33+
export const minimumSsmActions = [
3434
'ssmmessages:CreateControlChannel',
3535
'ssmmessages:CreateDataChannel',
3636
'ssmmessages:OpenControlChannel',

packages/core/src/shared/telemetry/telemetryService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ClassToInterfaceType } from '../utilities/tsUtils'
2020
import { getClientId, validateMetricEvent } from './util'
2121
import { telemetry, MetricBase } from './telemetry'
2222
import fs from '../fs/fs'
23+
import fsNode from 'fs/promises'
2324
import * as collectionUtil from '../utilities/collectionUtils'
2425

2526
export type TelemetryService = ClassToInterfaceType<DefaultTelemetryService>
@@ -116,7 +117,10 @@ export class DefaultTelemetryService {
116117
})
117118

118119
try {
119-
await fs.writeFile(this.persistFilePath, JSON.stringify(this._eventQueue))
120+
/**
121+
* This function runs in deactivate() so we must use node fs. See the vscode behavior doc for more info.
122+
*/
123+
await fsNode.writeFile(this.persistFilePath, JSON.stringify(this._eventQueue))
120124
} catch {}
121125
}
122126
}

0 commit comments

Comments
 (0)