Skip to content

Commit a43080c

Browse files
authored
Merge branch 'aws:master' into feature/qca
2 parents 76ec8d8 + 5397c1b commit a43080c

File tree

993 files changed

+21226
-12925
lines changed

Some content is hidden

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

993 files changed

+21226
-12925
lines changed

.eslintignore

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

.eslintrc.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ module.exports = {
1212
mocha: true,
1313
es2024: true,
1414
},
15-
plugins: ['@typescript-eslint', 'unicorn', 'header', 'aws-toolkits'],
15+
plugins: ['@typescript-eslint', 'unicorn', 'header', 'security-node', 'aws-toolkits'],
1616
extends: [
1717
'eslint:recommended',
1818
'plugin:@typescript-eslint/eslint-recommended',
1919
'plugin:@typescript-eslint/recommended-requiring-type-checking',
2020
'plugin:@typescript-eslint/recommended',
21-
'prettier',
21+
// "Add this as the _last_ item in the extends array, so that eslint-config-prettier has the
22+
// opportunity to override other configs." https://github.com/prettier/eslint-plugin-prettier
23+
'plugin:prettier/recommended',
2224
],
2325
rules: {
2426
curly: 2, // Enforce braces on "if"/"for"/etc.
@@ -94,6 +96,9 @@ module.exports = {
9496
// This is off because prettier takes care of it
9597
'no-extra-semi': 'off',
9698
'@typescript-eslint/no-empty-function': 'off',
99+
// Disallows returning e.g. Promise<…|never> which signals that an exception may be thrown.
100+
// https://stackoverflow.com/q/64230626/152142
101+
'@typescript-eslint/no-redundant-type-constituents': 'off',
97102
'@typescript-eslint/no-unused-vars': 'off',
98103
'@typescript-eslint/no-floating-promises': 'error', // Promises must catch errors or be awaited.
99104
'@typescript-eslint/no-var-requires': 'off', // Should be able to remove with the full migration of SDK v3
@@ -139,6 +144,7 @@ module.exports = {
139144
'unicorn/prefer-reflect-apply': 'error',
140145
'unicorn/prefer-string-trim-start-end': 'error',
141146
'unicorn/prefer-type-error': 'error',
147+
'security-node/detect-child-process': 'error',
142148

143149
'header/header': [
144150
'error',
@@ -152,6 +158,10 @@ module.exports = {
152158

153159
'aws-toolkits/no-only-in-tests': 'error',
154160
'aws-toolkits/no-await-on-vscode-msg': 'error',
161+
'aws-toolkits/no-banned-usages': 'error',
162+
'aws-toolkits/no-incorrect-once-usage': 'error',
163+
'aws-toolkits/no-string-exec-for-child-process': 'error',
164+
'aws-toolkits/no-console-log': 'error',
155165

156166
'no-restricted-imports': [
157167
'error',
@@ -168,7 +178,7 @@ module.exports = {
168178
// {
169179
// name: 'fs-extra',
170180
// message:
171-
// 'Avoid fs-extra, use FileSystemCommon. Notify the Toolkit team if your required functionality is not available.',
181+
// 'Avoid fs-extra, use shared/fs/fs.ts. Notify the Toolkit team if your required functionality is not available.',
172182
// },
173183
],
174184
},

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ packages/core/src/codewhisperer/ @aws/codewhisperer-team
33
packages/core/src/amazonqFeatureDev/ @aws/earlybird
44
packages/core/src/codewhispererChat/ @aws/dexp
55
packages/core/src/amazonq/ @aws/dexp
6-
packages/core/src/accessanalyzer/ @aws/access-analyzer
6+
packages/core/src/awsService/accessanalyzer/ @aws/access-analyzer

.github/workflows/node.js.yml

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,50 @@ jobs:
3232
uses: coactions/setup-xvfb@v1
3333
with:
3434
run: npm test
35-
- name: Code coverage
35+
- name: Code coverage (Core)
3636
env:
3737
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
3838
NODE_OPTIONS: ''
3939
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
40-
uses: codecov/codecov-action@v3
40+
uses: codecov/codecov-action@v4
4141
with:
42+
flags: macos-core-unittests
4243
verbose: true
43-
file: ./coverage/lcov.info
44-
flags: macos-unittests
45-
- name: Code coverage (CodeWhisperer)
44+
file: ./coverage/core/lcov.info
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
- name: Code coverage (Toolkit)
4647
env:
4748
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
4849
NODE_OPTIONS: ''
4950
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
50-
uses: codecov/codecov-action@v3
51+
uses: codecov/codecov-action@v4
5152
with:
53+
flags: macos-toolkit-unittests
5254
verbose: true
53-
file: ./coverage/lcov.info
55+
file: ./coverage/toolkit/lcov.info
56+
token: ${{ secrets.CODECOV_TOKEN }}
57+
- name: Code coverage (Amazon Q)
58+
env:
59+
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
60+
NODE_OPTIONS: ''
61+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
62+
uses: codecov/codecov-action@v4
63+
with:
64+
flags: macos-amazonq-unittests
65+
verbose: true
66+
file: ./coverage/amazonq/lcov.info
67+
token: ${{ secrets.CODECOV_TOKEN }}
68+
- name: Code coverage (CodeWhisperer)
69+
env:
70+
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
71+
NODE_OPTIONS: ''
72+
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
73+
uses: codecov/codecov-action@v4
74+
with:
5475
flags: codewhisperer
76+
verbose: true
77+
file: ./coverage/core/lcov.info
78+
token: ${{ secrets.CODECOV_TOKEN }}
5579

5680
web:
5781
name: test Web
@@ -101,11 +125,12 @@ jobs:
101125
# Unset NODE_OPTIONS because of https://github.com/codecov/uploader/issues/475
102126
NODE_OPTIONS: ''
103127
if: ${{ github.repository == 'aws/aws-toolkit-vscode' && ( github.ref == 'master' || github.event_name == 'pull_request' ) }}
104-
uses: codecov/codecov-action@v3
128+
uses: codecov/codecov-action@v4
105129
with:
130+
flags: windows-unittests
106131
verbose: true
107132
file: ./coverage/lcov.info
108-
flags: windows-unittests
133+
token: ${{ secrets.CODECOV_TOKEN }}
109134

110135
lint:
111136
name: Lint

.gitignore

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Note: also used for `eslint --ignore-path`.
2+
13
out
24
dist
35
node_modules
@@ -20,22 +22,19 @@ __pycache__
2022
packages/*/src/**/*.gen.ts
2123
src.gen/*
2224

23-
# Telemetry definition for testing adding telemetry
24-
packages/core/src/shared/telemetry/vscodeTelemetry.json
25-
2625
# Test reports
2726
.test-reports
2827

2928
# Auto generated type definitions
30-
packages/core/src/shared/telemetry/clienttelemetry.d.ts
31-
packages/core/src/codewhisperer/client/codewhispererclient.d.ts
32-
packages/core/src/codewhisperer/client/codewhispereruserclient.d.ts
33-
packages/core/src/amazonqFeatureDev/client/featuredevproxyclient.d.ts
34-
packages/core/src/auth/sso/oidcclientpkce.d.ts
29+
**/src/shared/telemetry/clienttelemetry.d.ts
30+
**/src/codewhisperer/client/codewhispererclient.d.ts
31+
**/src/codewhisperer/client/codewhispereruserclient.d.ts
32+
**/src/amazonqFeatureDev/client/featuredevproxyclient.d.ts
33+
**/src/auth/sso/oidcclientpkce.d.ts
3534

3635
# Generated by tests
37-
packages/core/src/testFixtures/**/bin
38-
packages/core/src/testFixtures/**/obj
36+
**/src/testFixtures/**/bin
37+
**/src/testFixtures/**/obj
3938

4039
# Generated by copyFiles.ts
4140
packages/*/LICENSE

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
git secrets --register-aws || (echo 'Please install git-secrets https://github.com/awslabs/git-secrets to check for accidentally commited secrets!' && exit 1)
52
git secrets --pre_commit_hook -- ""
63
node_modules/.bin/pretty-quick --staged

CONTRIBUTING.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +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/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. A few manual steps are needed instead:
222-
223-
- Run the command `Tasks: Run Build Task` if not already active
224-
- Instrument built code with `npm run instrument`
225-
- Exercise the code (`Extension Tests`, `Integration Tests`, etc.)
226-
- Generate a report with `npm run report`
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.
227222
228223
### CodeCatalyst Blueprints
229224
@@ -249,20 +244,35 @@ To send a pull request:
249244
250245
### Changelog
251246
252-
Pull requests that change **customer-impacting behavior** must include a changelog item(s). Run this command:
247+
Pull requests that change **customer-impacting behavior** must include a changelog item(s). Run one
248+
or both of the following commands:
249+
250+
- For changes relevant to Amazon Q:
251+
```
252+
npm run newChange -w packages/amazonq
253+
```
254+
- For changes relevant to AWS Toolkit:
255+
```
256+
npm run newChange -w packages/toolkit
257+
```
258+
259+
The audience for the changelog is _the user_. The changelog is presented to users by VSCode and the
260+
marketplace. It is a "micro-blog" for advertising improvements to users. It is the _primary_ way of
261+
communicating changes to customers. Please consider this when writing changelog entries.
253262
254-
npm run newChange
263+
Mentioning low-level details like "function x now takes argument y", will not be useful, because it
264+
doesn't say what that means in terms of the user experience. Instead, describe the effect from the
265+
user's point of view.
255266
256267
> [!TIP]
257268
>
258269
> - Describe the change in a way that is _meaningful to the customer_. If you can't describe the _customer impact_ then it probably shouldn't be in the changelog.
259-
> - ❌ `Update telemetry definitions` (not customer-impacting)
270+
> - ✅ `Connection wizard sometimes shows the old (stale) connection`
260271
> - ✅ `Faster startup after VSCode restarts`
261272
> - ❌ `Remove the cache when the connection wizard is re-launched` (code internals are not relevant to customers)
262-
> - ✅ `Connection wizard sometimes shows the old (stale) connection`
263-
> - "Bug Fix" changes should describe the _problem being fixed_. This tends to produce simpler,
264-
> more-intuitive descriptions. It's redundant to say "Fixed" in the description, because the
265-
> generated changelog will say that. Example:
273+
> - ❌ `Update telemetry definitions` (not customer-impacting)
274+
> - "Bug Fix" changes should describe the _problem being fixed_. Don't say "Fixed" in the
275+
> description, it's redundant. Example:
266276
> - ❌ `Fixed S3 bug which caused filenames to be uppercase`
267277
> - ✅ `S3 filenames are always uppercase`
268278
> - To update an _existing_ changelog item, just edit its `.changes/next-release/….json` file, you don't need to re-run `npm run newChange`.
@@ -462,6 +472,8 @@ The package.json 'devDependencies' includes `eslint-plugin-aws-toolkits`. This i
462472
3. Register your rule in `plugins/eslint-plugin-aws-toolkits/index.ts`.
463473
4. Enable your rule in `.eslintrc`.
464474

475+
Writing lint rules can be tricky if you are unfamiliar with the process. Use an AST viewer such as https://astexplorer.net/
476+
465477
### AWS SDK generator
466478

467479
When the AWS SDK does not (yet) support a service but you have an API

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,46 @@
1-
# AWS Toolkit for Visual Studio Code
1+
# AWS Extensions for Visual Studio Code
22

3-
[![Coverage](https://img.shields.io/codecov/c/github/aws/aws-toolkit-vscode/master.svg)](https://codecov.io/gh/aws/aws-toolkit-vscode/branch/master) [![Marketplace Version](https://img.shields.io/vscode-marketplace/v/AmazonWebServices.aws-toolkit-vscode.svg) ![Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/AmazonWebServices.aws-toolkit-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-toolkit-vscode)
3+
[![Coverage](https://img.shields.io/codecov/c/github/aws/aws-toolkit-vscode/master.svg)](https://codecov.io/gh/aws/aws-toolkit-vscode/branch/master)
4+
5+
This project is open source. We encourage issues, feature requests, code reviews, pull requests or
6+
any positive contribution. See [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
7+
8+
### Amazon Q
9+
10+
[![Marketplace Version](https://img.shields.io/vscode-marketplace/v/AmazonWebServices.amazon-q-vscode.svg) ![Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/AmazonWebServices.amazon-q-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode)
11+
12+
Amazon Q for VS Code is a [VS Code extension](https://marketplace.visualstudio.com/itemdetails?itemName=AmazonWebServices.aws-toolkit-vscode) for connecting your IDE to [Amazon Q](https://aws.amazon.com/q/developer/) and leveraging generative AI to accelerate your software development.
13+
14+
- Code faster with inline code suggestions as you type
15+
- Chat with [Amazon Q](https://aws.amazon.com/q/developer/) to generate code, explain code, and get answers to questions about software development
16+
- Analyze and fix security vulnerabilities in your project
17+
- Upgrade your Java applications
18+
19+
[Project Directory](https://github.com/aws/aws-toolkit-vscode/tree/master/packages/amazonq)
20+
21+
### AWS Toolkit
22+
23+
[![Marketplace Version](https://img.shields.io/vscode-marketplace/v/AmazonWebServices.aws-toolkit-vscode.svg) ![Marketplace Downloads](https://img.shields.io/vscode-marketplace/d/AmazonWebServices.aws-toolkit-vscode.svg)](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.aws-toolkit-vscode)
424

525
AWS Toolkit is a [VS Code extension](https://marketplace.visualstudio.com/itemdetails?itemName=AmazonWebServices.aws-toolkit-vscode) for connecting your IDE to your AWS resources:
626

727
- Connect with [IAM credentials](https://docs.aws.amazon.com/sdkref/latest/guide/access-users.html),
828
[IAM Identity Center (SSO)](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html),
929
or [AWS Builder ID](https://docs.aws.amazon.com/signin/latest/userguide/differences-aws_builder_id.html)
10-
- Use [Amazon Q](https://aws.amazon.com/q/developer/) to write code
1130
- Connect to your [CodeCatalyst](https://codecatalyst.aws/) Dev Environments
1231
- Debug your Lambda functions using [SAM CLI](https://github.com/aws/aws-sam-cli)
1332
- Check and autocomplete code in SAM/CFN (CloudFormation) `template.yaml` files
1433
- `Open Terminal` on your ECS tasks
1534
- `Search Log Group` on your CloudWatch logs
1635
- Browse your AWS resources
1736

18-
This project is open source. We love issues, feature requests, code reviews, pull requests or any
19-
positive contribution. See [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
37+
[Project Directory](https://github.com/aws/aws-toolkit-vscode/tree/master/packages/toolkit)
2038

2139
## Documentation
2240

23-
- [Quick Start Guide](https://marketplace.visualstudio.com/itemdetails?itemName=AmazonWebServices.aws-toolkit-vscode)
41+
- Quick Start Guides for...
42+
- [Amazon Q](https://marketplace.visualstudio.com/itemdetails?itemName=AmazonWebServices.amazon-q-vscode)
43+
- [AWS Toolkit](https://marketplace.visualstudio.com/itemdetails?itemName=AmazonWebServices.aws-toolkit-vscode)
2444
- [FAQ / Troubleshooting](./docs/faq-credentials.md)
2545
- [User Guide](https://docs.aws.amazon.com/console/toolkit-for-vscode/welcome)
2646
- General info about [AWS SDKs and Tools](https://docs.aws.amazon.com/sdkref/latest/guide/overview.html)
@@ -37,4 +57,4 @@ We want your feedback!
3757

3858
## License
3959

40-
The **AWS Toolkit for Visual Studio Code** is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
60+
This project and the subprojects within **(AWS Toolkit for Visual Studio Code, Amazon Q for Visual Studio Code)** is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).

buildspec/linuxE2ETests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +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}" && ./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
4445
finally:
4546
- rm -rf ~/.aws/sso/cache || true
4647
reports:

buildspec/linuxIntegrationTests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +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}" && ./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
7879
post_build:
7980
commands:
8081
# Destroy .netrc to avoid leaking $GITHUB_READONLY_TOKEN.

0 commit comments

Comments
 (0)