Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into feature/amazonqLSP #6671

Merged
merged 610 commits into from
Mar 11, 2025

Conversation

aws-toolkit-automation
Copy link
Collaborator

Automatic merge failed

  • Resolve conflicts and push to this PR branch.
  • Do not squash-merge this PR. Use the "Create a merge commit" option to do a regular merge.

Command line hint

To perform the merge from the command line, you could do something like the following (where "origin" is the name of the remote in your local git repo):

git stash
git fetch --all
git checkout origin/feature/amazonqLSP
git merge origin/master
git commit
git push origin HEAD:refs/heads/autoMerge/feature/amazonqLSP

aws-toolkit-automation and others added 30 commits January 30, 2025 17:50
#6421

## Problem

The Workflow Studio webview currently does not allow for calling the
[TestState
API](https://docs.aws.amazon.com/step-functions/latest/dg/test-state-isolation.html).
This API is used for testing individual states in isolation, and helps
with debugging when constructing a state machine. It is available in the
console version of Workflow Studio.

## Solution

Adding support for calling APIs from the webview using message passing.
This is the added flow:

1. The webview sends a message to the extension to call sfn:TestState or
iam:ListRoles
2. The extension performs the API call using its credentials and default
credential region
3. The extension sends the response as a message to the webview

Note: this PR is dependent on [this
PR](#6375) being merged
first since it requires an [aws-sdk version
update](f4e0893).
…6489)

## Problem

Changelog is missing for the Step Functions Workflow Studio integration

## Solution

Added Changelog for Workflow Studio integration, and a separate one for
TestState in the integration.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Co-authored-by: Anthony Ting <[email protected]>
aws-toolkit-automation and others added 22 commits March 4, 2025 17:15
feat(sdkv3): start migration to sdkv3
…ules (#6722)

## Problem
In Windows, the rules under .amazonq/rules were not send in the chat
prompt because of path resolution failure.

## Solution
![Screenshot 2025-03-04 at 3 34
34 PM](https://github.com/user-attachments/assets/649c4f40-365e-4b67-9bff-48a2a8a6c450)
Use path.join instead of vscode.Uri.joinPath

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem:

Updated the telemetry types and had to change an existing name to match
the new one.

## Solution:

use `toolkit_didLoadModule` to indicate that the module successfully
opened. In certain cases we will want to use `toolkit_willOpenModule` to
indicate the start of it, but because it doesn't look like that was used
already we can ignore it for now and revisit later.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Signed-off-by: nkomonen-amazon <[email protected]>
## Problem

Missing fields for some code scan events


## Solution

- Add `autoDetected` to:
  - `codewhisperer_codeScanIssueHover`
  - `codewhisperer_codeScanIssueIgnore`
  - `codewhisperer_codeScanIssueViewDetails`


---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem

Some users are reporting S3 upload failures but we don't have the
requestIds to investigate further.


## Solution

Emit `amazonq_createUpload` metric with requestIds


---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem

Events about findings are always tied to hover, apply fix, etc. Not able
to understand the number of findings which never get acted on.


## Solution

Emit metrics about findings at the time of scan results.


---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
Previous mynah-ui upgrade included a regression which removed the `@`
from the context command name.

## Solution
Fix `@worskspace` regex now that @ is no longer removed. Upgrade mynah
to 4.23.1 https://github.com/aws/mynah-ui/releases/tag/v4.23.1



---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem


## Solution


---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Signed-off-by: nkomonen-amazon <[email protected]>
### This is a merge of `feature/serverlessland` in to `master`, but I
rebased to keep it clean

New feature from the Lambda team:

The AWS Toolkit for VS Code now integrates Serverless Land's application
pattern library, allowing developers to browse, search, and implement
pre-built serverless patterns directly in the IDE. This simplifies and
accelerates the process of building serverless applications using VS
Code.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Signed-off-by: nkomonen-amazon <[email protected]>
Co-authored-by: Vandita Patidar <[email protected]>
Co-authored-by: Vandita Patidar <[email protected]>
Co-authored-by: vicheey <[email protected]>
## Problem
Customers are not able to local invoke with the runtime selected in the
webview UI. Currently the runtime used is the one specified on the
template. The feature was already added to SAMCLI
aws/aws-sam-cli#7885.

## Solution
Allows customers to change runtimes when locally invoking in the local
invoke webview, without having to change it in their template and
rebuilding. Under the hood, the newly added ```--runtime``` option will
be appended to the ```samcli``` command.
This reverts commit 62d3ec1.

## Problem

Scan name change is causing unexpected behavior from the service.


## Solution

Temporarily revert this change

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
There is a side effect from `sandbox.spy(AppBuilderRootNode.instance)`
between two integration tests for AppBuilder causing test failure due to
**_`TypeError: Attempted to wrap onDidChangeChildren which is already
wrapped`_**`

```
 1) "before each" hook for "creates an AppBuilderRootNode with correct label":
     TypeError: Attempted to wrap onDidChangeChildren which is already wrapped
      at checkWrappedMethod (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:64:21)
      at wrapMethod (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:135:13)
      at spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:180:16)
      at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:33:17
      at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:27:22
      at Array.forEach (<anonymous>)
      at walkInternal (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:19:5)
      at walk (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:48:12)
      at walkObject (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:18:5)
      at Function.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:170:16)
      at Sandbox.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/sandbox.js:383:35)
      at Context.<anonymous> (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/packages/core/src/testInteg/appBuilder/serverlessLand/main.test.ts:34:28)
  --------------
  Error: Stack Trace for original
      at extendObjectWithWrappedMethods (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:169:34)
      at wrapMethod (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/wrap-method.js:157:5)
      at spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:180:16)
      at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:33:17
      at /Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:27:22
      at Array.forEach (<anonymous>)
      at walkInternal (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:19:5)
      at walk (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk.js:48:12)
      at walkObject (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/util/core/walk-object.js:18:5)
      at Function.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/spy.js:170:16)
      at Sandbox.spy (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/node_modules/sinon/lib/sinon/sandbox.js:383:35)
      at Context.<anonymous> (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/packages/core/src/testInteg/appBuilder/sidebar/appBuilderNode.test.ts:35:28)
      at Context.fn (/Volumes/workplace/Lambda Tooling/aws-toolkit-vscode/packages/core/src/test/setupUtil.ts:34:24)
      at processImmediate (node:internal/timers:483:21)
      at process.topLevelDomainCallback (node:domain:161:15)
      at process.callbackTrampoline (node:internal/async_hooks:128:24)
```

## Solution

Add additional layer of `describe()`. 

Test result: 
```
Walkthrough pattern URL exists
    ✔ Walkthrough pattern URL exists for APIdotnet (623ms)
    ✔ Walkthrough pattern URL exists for APInode (510ms)
    ✔ Walkthrough pattern URL exists for APIpython (473ms)
    ✔ Walkthrough pattern URL exists for APIjava (559ms)
    ✔ Walkthrough pattern URL exists for S3dotnet (584ms)
    ✔ Walkthrough pattern URL exists for S3node (525ms)
    ✔ Walkthrough pattern URL exists for S3python (566ms)
    ✔ Walkthrough pattern URL exists for S3java (560ms)
  Application Builder
    root node
      ✔ creates an AppBuilderRootNode with correct label
      ✔ generates correct number of children nodes: walkthrough node + project nodes
    application nodes in workspace (Test in order)
      ✔ 1: contains application node for appbuilder-test-app
      ✔ 2: contains correct application node properties
      ✔ 3: contains correct resource node properties (4266ms)
      ✔ 4: has registered refresh command successfully
      ✔ 5: triggers auto refresh when there a file getting updated (509ms)
  Happy Path
    ✔ creates project from Serverless Land integration (1083ms)
  16 passing (10s)
globalSetup: after()
deleteTestTempDirs: deleted 2 test temp dirs

```
---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
This client is tightly coupled to some implementations, making this
migration more difficult than usual. Additionally, v3 handles streams
differently than v2. Also, some v2 features in the SDK are completely
redone. For example, pre-signing a url:
https://aws.amazon.com/blogs/developer/generate-presigned-url-modular-aws-sdk-javascript/.

## Solution
- refactor or delete most of the tests in
https://github.com/aws/aws-toolkit-vscode/blob/1dbaab43d3533cc35b8bcd705860c7199bc98264/packages/core/src/test/shared/clients/defaultS3Client.test.ts
- Most of them don't add real value. They simply assert the SDK was
called, or that errors propagate. These unit tests should be reserved
for testing the logic built on top of these requests, not the requests
themselves.
- For tests that do add value, refactor to avoid stubbing the SDK (Ex.
`listFiles` refactor).
- Throw an explicit error when we reach a code path that is not
web-supported.
- Migrate to new pre-signing logic, described here:
https://aws.amazon.com/blogs/developer/generate-presigned-url-modular-aws-sdk-javascript/
- Simplify list buckets since region is now added in response by
default.
- Unify Bucket type definitions. There originally was the S3 `Bucket`
type exported by the SDK, our own `Bucket`, and `DefaultBucket`.
`Bucket` was derived from `DefaultBucket`, but this made reading type
signatures ambiguous at first glance. These are all now under S3Bucket.

## Verification
To verify this migration didn't break anything I manually tested the
following through the toolkit:
- Create buckets (in console and toolkit) in three different regions,
ensure they display in proper regions.
- Create folders (nested as well). 
- Upload a file, view and edit the file through explorer. 
- Download the file, and verify my changes were saved through S3. 
- Generate a presigned url for objects in my bucket. 
- Delete a file, bucket, folder. 
- Verify copied ARN, name, and Path are correct through selection. 

## Future Work
- Downloading and uploading a file now supports web streams, which means
that `GetObject` response body is now a
`StreamingBlobPayloadOutputTypes` from `@smithy/types`. This is a
general type for web/node streams, therefore we must cast to Node's
`Readable` type. Ideally we would support working with the abstract
stream directly and avoiding the cast. The approach is outlined here:
https://docs.aws.amazon.com/code-library/latest/ug/s3_example_s3_Scenario_UsingLargeFiles_section.html.
- E2E tests for uploading and downloading a file. 
- Remove mocks from
https://github.com/aws/aws-toolkit-vscode/blob/1a313e4029930e1da48558f6c7b84f48036672e9/packages/core/src/test/awsService/s3/commands/uploadFile.test.ts.
Mocked tests are extremely expensive to maintain because they inherently
rely on implementation details.
- There are three listBuckets-related methods that all do slightly
different things. These should live in a single method, `listBuckets`
and it should return an `AsyncCollection` for proper pagination support.
- Reduce stub usage in the tests to avoid coupling to implementation.
The entire test suite for the wrapper stubbed S3 v2 directly, making it
very difficult to refactor the tests.
---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: aws-toolkit-automation <[email protected]>
@aws-toolkit-automation aws-toolkit-automation requested a review from a team as a code owner March 6, 2025 21:13
Hweinstock and others added 3 commits March 10, 2025 10:16
## Problem
This code is no longer used, and appears to have been moved to the LSP
side:
aws/aws-toolkit-vscode-staging#1214 (comment)

This fix also no longer works, and the work it was based off has
significantly changed their approach:
https://github.com/sourcegraph/cody/blob/62d73f78c432036d1f99bc9631ed534cc2ed846b/vscode/src/net/net.patch.ts

## Solution
- remove it. 


---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
previously we avoided resetting the global states because it didn't have
it stubbed for integ/e2e tests

## Solution
Now that it is we can allow global state to reset in the inline tests

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
@jpinkney-aws jpinkney-aws force-pushed the autoMerge/feature/amazonqLSP branch from ee52351 to 848fe0c Compare March 10, 2025 17:58
@justinmk3
Copy link
Contributor

linux CI is failing because of unhandled promise rejections, but we can fix that in a followup.

rejected promise not handled within 1 second: Error: Unhandled method lsp/getContextCommandItems

@justinmk3 justinmk3 merged commit b19d52b into feature/amazonqLSP Mar 11, 2025
13 of 17 checks passed
@justinmk3 justinmk3 deleted the autoMerge/feature/amazonqLSP branch March 11, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.