Skip to content

Commit afcfa35

Browse files
authored
Merge branch 'aws:master' into wlsun/add-auto-build-feature-opt-in-out
2 parents 39f4bc4 + e40d586 commit afcfa35

File tree

281 files changed

+38949
-12639
lines changed

Some content is hidden

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

281 files changed

+38949
-12639
lines changed

.github/workflows/jscpd.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"pattern": "packages/**/*.ts",
3+
"ignore": ["**node_modules**", "**dist**"],
4+
"gitignore": true,
5+
"threshold": 1.34,
6+
"minLines": 15
7+
}

.github/workflows/node.js.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ jobs:
5555
- run: npm run testCompile
5656
- run: npm run lint
5757

58+
jscpd:
59+
needs: lint-commits
60+
runs-on: ubuntu-latest
61+
strategy:
62+
matrix:
63+
node-version: [18.x]
64+
env:
65+
NODE_OPTIONS: '--max-old-space-size=8192'
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Use Node.js ${{ matrix.node-version }}
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ matrix.node-version }}
72+
- run: npm install jscpd
73+
- name: Run jscpd
74+
run: npx jscpd --config "$GITHUB_WORKSPACE/.github/workflows/jscpd.json"
75+
5876
macos:
5977
needs: lint-commits
6078
name: test macOS

.github/workflows/notification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: github.event_name == 'pull_request_target'
3838
with:
3939
node-version: '20'
40-
- name: Check for tests
40+
- name: Comment about contribution guidelines
4141
uses: actions/github-script@v7
4242
if: github.event_name == 'pull_request_target'
4343
with:

.github/workflows/notify.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
const { hasPath, dedupComment } = require('./utils')
77

88
const testFilesMessage =
9-
'This pull request modifies code in src/ but no tests were added/updated. Confirm whether tests should be added or ensure the PR description explains why tests are not required.'
9+
'- This pull request modifies code in `src/*` but no tests were added/updated.\n - Confirm whether tests should be added or ensure the PR description explains why tests are not required.\n'
1010

11-
const changelogMessage = `This pull request implements a feature or fix, so it must include a changelog entry. See [CONTRIBUTING.md#changelog](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#changelog) for instructions.`
11+
const changelogMessage =
12+
'- This pull request implements a `feat` or `fix`, so it must include a changelog entry (unless the fix is for an *unreleased* feature). Review the [changelog guidelines](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#changelog).\n - Note: beta or "experiment" features that have active users *should* announce fixes in the changelog.\n - If this is not a feature or fix, use an appropriate type from the [title guidelines](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#pull-request-title). For example, telemetry-only changes should use the `telemetry` type.\n'
1213

1314
/**
1415
* Remind partner teams that tests are required. We don't need to remind them if:
@@ -44,12 +45,16 @@ module.exports = async ({ github, context }) => {
4445
issue_number: pullRequestId,
4546
})
4647

48+
let msg = ''
4749
if (shouldAddTestFileMessage) {
48-
await dedupComment({ github, comments, owner, repo, pullRequestId, message: testFilesMessage })
50+
msg += testFilesMessage
4951
}
50-
5152
if (shouldAddChangelogMessage) {
52-
await dedupComment({ github, comments, owner, repo, pullRequestId, message: changelogMessage })
53+
msg += changelogMessage
54+
}
55+
56+
if (shouldAddTestFileMessage || shouldAddChangelogMessage) {
57+
await dedupComment({ github, comments, owner, repo, pullRequestId, message: msg })
5358
}
5459
}
5560

@@ -69,7 +74,12 @@ function requiresChangelogMessage(filenames, title) {
6974
* Require the test files message if there are changes to source files but aren't any
7075
* changes to the test files
7176
*/
72-
function requiresTestFilesMessage(filenames) {
77+
function requiresTestFilesMessage(filenames, title) {
78+
if (/^\s*[mM]erge/.test(title)) {
79+
console.log('"Merge" pull request')
80+
return
81+
}
82+
7383
// Check if src directory changed
7484
if (!hasPath(filenames, 'src/')) {
7585
console.log('Did not find src files in the code changes')

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ To run a single test in VSCode, do any one of:
188188
189189
- Unix/macOS/POSIX shell:
190190
```
191-
TEST_FILE=src/test/foo.test.ts npm run test
191+
TEST_FILE=../core/src/test/foo.test.ts npm run test
192192
```
193193
- Powershell:
194194
```
195-
$Env:TEST_FILE = "src/test/foo.test.ts"; npm run test
195+
$Env:TEST_FILE = "../core/src/test/foo.test.ts"; npm run test
196196
```
197197
198198
- To run all tests in a particular subdirectory, you can edit
@@ -209,11 +209,11 @@ To run tests against a specific folder in VSCode, do any one of:
209209
- Run in your terminal
210210
- Unix/macOS/POSIX shell:
211211
```
212-
TEST_DIR=src/test/foo npm run test
212+
TEST_DIR=../core/src/test/foo npm run test
213213
```
214214
- Powershell:
215215
```
216-
$Env:TEST_DIR = "src/test/foo"; npm run test
216+
$Env:TEST_DIR = "../core/src/test/foo"; npm run test
217217
```
218218
219219
### Coverage report

buildspec/shared/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# - "Webview is disposed": only happens on vscode "minimum" (1.68.0)
1010
# - "HTTPError: Response code …": caused by github rate-limiting.
1111
# - "npm WARN deprecated querystring": transitive dep of aws sdk v2 (check `npm ls querystring`), so that's blocked until we migrate to v3.
12-
_ignore_pat='Timed-out waiting for browser login flow\|HTTPError: Response code 403\|HTTPError: Response code 404\|npm WARN deprecated querystring'
12+
_ignore_pat='Timed-out waiting for browser login flow\|HTTPError: Response code 403\|HTTPError: Response code 404\|npm WARN deprecated querystring\|npm WARN deprecated'
1313
if [ "$VSCODE_TEST_VERSION" = 'minimum' ]; then
1414
_ignore_pat="$_ignore_pat"'\|Webview is disposed'
1515
fi

docs/build.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
# Build
22

3-
The AmazonQ features rely on the `codewhisperer-streaming` service, who's client
4-
is generated from the service's smithy models and placed in
5-
`src.gen/@amzn/codewhisperer-streaming` (For more
6-
information about this client and how it is generated, please see this
3+
The AmazonQ features rely on the `codewhisperer-streaming` service, to support both Sigv4 and Bearer token modes of this service,
4+
two clients are generated from the service's smithy models and placed in
5+
`src.gen/@amzn/amazon-q-developer-streaming-client` and `src.gen/@amzn/codewhisperer-streaming` respectively (For more
6+
information about these clients and how they are generated, please see this
77
[quip document](https://quip-amazon.com/2dAWAvTIYXXr/Build-instructions-for-AWS-CodeWhisperer-Streaming-Typescript-client)).
88

9+
## @amzn/amazon-q-developer-streaming client
10+
11+
This client is a standalone npm project in typescript, and it is added to
12+
the project as a workspace in the project's root `package.json` with the line `"workspaces": [ ..., "src.gen/@amzn/amazon-q-developer-streaming" ]`.
13+
The client may be manually built using `npm run build -w @amzn/amazon-q-developer-streaming"`.
14+
The `generateClients` run script ensures that this dependency is
15+
built before the toolkit project itself. Workspaces are automatically ready to
16+
be imported in the root toolkit project by their declared package.json name,
17+
(`@amzn/amazon-q-developer-streaming` in this case).
18+
19+
## @amzn/codewhisperer-streaming client
20+
921
This client is a standalone npm project in typescript, and it is added to
1022
the project as a workspace in the project's root `package.json` with the line `"workspaces": [ ..., "src.gen/@amzn/codewhisperer-streaming" ]`.
1123
The client may be manually built using `npm run build -w @amzn/codewhisperer-streaming"`.

0 commit comments

Comments
 (0)