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/dynamodb #5574

Open
wants to merge 1,774 commits into
base: feature/dynamodb
Choose a base branch
from

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/dynamodb
git merge origin/master
git commit
git push origin HEAD:refs/heads/autoMerge/feature/dynamodb

@aws-toolkit-automation aws-toolkit-automation requested a review from a team as a code owner October 2, 2024 16:47
@aws-toolkit-automation aws-toolkit-automation requested a review from a team as a code owner December 3, 2024 22:16
dhasani23 and others added 25 commits December 10, 2024 12:38
## Problem

Lots of file utils functions in `startTransformByQ.ts` should be in
`transformFileHandler.ts`

## Solution

Move them.

---

- 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: David Hasani <[email protected]>
## Problem
The system status (battery, CPU usage) was polled very frequently.
#6134

## Solution
Only poll system status (battery, CPU usage) when vector indexing is in
progress, this is to make the vector index pause when system load is
high to protect system resources.
## Problem
Git commands are too noisy; running /review always opens Amazon Q output
channel with git command output

## Solution
- Output to the Amazon Q Logs channel instead
- Make it verbose level so it won't show by default
# Problem:
The "tests" codecov target always reports 0%, probably because the test
code is ignored.

# Solution:
The "tests" target is not useful without more configuration, so drop it
for now.
## Problem
`jscpd` detected a duplicate code block in a `/transform`-related test
file.

## Solution
Use a shared variable so as not to duplicate.
## Problem
Code issues tree view takes up too much space away from chat view

## Solution
Set `visibility` to `collapsed` (will only take effect for new
installations)
## Problem
Applying a fix does not update the position of other issues in the same
file.

## Solution
Revert disabling event handler on apply fix command
## Problem
Projects with a nested folder of the same name does not scan properly.

For example if the project name is `foo`, and there exists a folder
`foo/foo/` then the zip artifact only contains the inner `foo/` folder.

## Solution
Always include the project name in the zip artifact instead of
conditionally adding it.
## Problem
- The SAM tests are flaky, and sometimes fail CI. 
- SAM file scenarios section includes a ton of copy-pasting. 

## Solution
The SAM build images can be pulled ahead of time to reduce risk of
timeout.

To see this working, see the integ test logs below, and notice in the
logs that `Fetching public.ecr.aws/sam/build-... Docker container
image...`, resolved immediately (likely cached from pre-fetching)
whereas before this took 60-90 seconds sometimes.

To reduce copy pasting, establish useful defaults, and generate the
scenarios based on a few args to avoid copy pasting information.
## Problem:

When we loaded sso cache from disk, we would only invalidate (leading to
a reauth prompt) if the cache file was missing.

But if the cache file was present, though its content was malformed, we
would incorrectly treat it as recoverable by throwing instead of
returning undefined. Users would get stuck in a state where all future
api calls would fail, and they'd never get a prompt to reauth to fix
their SSO session.

## Solution:

If we detect a SyntaxError treat it as non-recoverable, meaning it will
trigger a reauth.

Also added some code to validate the content of the SSO cache we loaded
from disk to ensure it is what we expected.

Fixes #6140

---

- 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
- Repetitive code when emitting amazonq_utgGenerateTests telemetry
events
- Metric has already been migrated to aws-toolkit-common

## Solution
- Created sendTestGenerationToolkitEvent helper to extract common fields
- Removed metric override in this repo
- Tested and can confirm that metrics are same as previous method
…metry event (#6211)

## Problem
- If user clicks on Cancel button, IDE do `this.sessionCleanUp()` before
emitting the metrics

## Solution
- Removed this function `this.sessionCleanUp()`

---

- 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.
Add an E2E test for Creating a README using /doc
Moved reusable functions out of featureDev.test.ts to shared test
framework

---

- 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
Each EC2 remote vscode connection wipes the remote
`.ssh/authorized_keys` file as a preventative measure to leaving stale
keys there. However, we can do better by adding comments to the keys we
add to this file, then selectively removing those keys on subsequent
connections.

## Solution
- Whenever we send keys to the instance, use `sed` to wipe all of the
keys added by us.
- determine keys added by us using a hint comment
`#AWSToolkitForVSCode`.


---

- 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: Justin M. Keyes <[email protected]>
## Problem

Diagnostics in problems panel show findingId as code which doesn't add
any value


## Solution

Use ruleId instead


---

- 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

Code fix section is not automatically visible after clicking on generate
fix inside code issue detail view.


## Solution

- Changed the behavior of updating the webview so that it doesn't
close/reopen a new panel every time
- Added event listeners to trigger UI updates
- Added scroll into view functionality


---

- 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.
laileni-aws and others added 30 commits February 4, 2025 09:20
#6482)

## Problem
- Github issue:
#6160 (comment)

## Solution
- Not able to reproduce this in local machine. Double checked with team
and planned to disable this test for now to avoid hassle for partner
teams.

---

- 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
The LSP cannot start in AL2023 arm64.

## Solution

Update the binary of linux arm64 to make it compatible with both AL2023
and Ubuntu arm64

---

- 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.
…on in JSON ASL files. (#6478)

## Feature description

Step Functions: Upgrade amazon-states-language-service to 1.15. This new
version enhance autocomplete for variable and JSONata expression in JSON
ASL files.


[Variables and
JSONata](https://aws.amazon.com/blogs/compute/simplifying-developer-experience-with-variables-and-jsonata-in-aws-step-functions/)
was a Step Funtions feature released in 2024 Nov

### Demo:

![jsonata-autocomplete](https://github.com/user-attachments/assets/ee9d01e7-8458-480a-8568-d34a6b862b87)

---

- 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: Silvia Chen <[email protected]>
…#6475)

## Problem
Users are not able to track their feedback/request through the feedback
form. There should be a description for it and a link for Github issue
links.

## Solution
- Added description field to the feedback form which accepts markdown
strings (through MynahUI
[v4.22.0](https://github.com/aws/mynah-ui/releases/tag/v4.22.0))

<img width="532" alt="image"
src="https://github.com/user-attachments/assets/0f3fce7c-9efa-423b-9801-89743cfea42e"
/>

---

_**Notes:** Feel free to change the link, or update the text. Also, if
you want to add telemetry records for these link clicks, feel free to
add that._

---

- 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
Regression in API Back off and retry. Not necessary for VSC.

## Solution
This reverts commit 3a03e95.

---

- 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
Add doc generation V2 telemetry

---

- 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.
…6419)

## Problem
To support complex recommendations broken into multiple chunks, we need
the ability to immediately show user next recommendation when they
accept previous one

## Solution
pre-fetch next recommendation predicting user accept first
recommendation when showing them to user, and if user did accept first
recommendation, immediately show next recommendation

---

- 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: Will Lo <[email protected]>
## Problem

Issues detected by auto-review feature are not populating the code
issues treeview list unless you run a manual `/review` first.

<img width="1594" alt="Screenshot 2025-02-04 at 3 00 08 PM"
src="https://github.com/user-attachments/assets/4b817fad-a17e-4ce6-8374-fb81634f18b1"
/>

This issue is happening because `vscode.window.createTreeView` is hidden
inside `SecurityIssuesTree` class which only gets invoked when you call
`SecurityIssuesTree.instance.focus()`. Since we don't want to focus the
tree view for auto-reviews, the treeview itself is never created.

## Solution

Move the treeview creation to activation so that it always gets created
when the extension is activated


---

- 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.
…ormation (#6499)

## Problem
This metric is currently being spammed in telemetry at unusual volume.
It is suspected that this is connected to this change:
https://github.com/aws/aws-toolkit-vscode/pull/5979/files, but the
connection is not yet clear.

## Solution
- use the `withTelemetryContext` decorator to emit a `function_call`
metric to capture additional information. This metric should allow us to
determine what is calling this function so much. Added techdebt test to
remove this debugging information before the following release.
- debounce the current emit line that is causing the high volume
emission.


## Future Work 
- `debounce` reimplements a special case of `debounceWithCancel`, these
can be redone to reduce code and improve reliability.

---

- 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
- valid language tests are flaky, specifically the "before each" hook is
failing in the CI for valid language

## Solution
- skip valid language tests for now

These changes will be helpful for when we come back to this issue:
- use closeAllEditors function in existing testUtils file
- retries for setting up and opening text file
## Problem
If you have amazon q locally and start a debugging session, pressing
stop can sometimes crash the entirety of vscode

## Solution
remove
[debugWebviews](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#rendererdebugoptions)/[rendererDebugOptions](https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#rendererdebugoptions)
from amazon q's launch config since they cause the local amazon q
webview to attach to the debug instance which coincidentally ends up
crashing vscode when extension debugging is stopped

---

- 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
A line in
[packages/core/package.nls.json](https://github.com/aws/aws-toolkit-vscode/compare/master...witness-me:fix-lint?expand=1#diff-4d90099a916e267c6fa8cfeeec9c569c4889dc50cb53178e1c748d0d37ff501e)
contains extra space, which is inconsistent with current code style

## Solution
Remove extra space

---

- 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: Vlad Nikolaenko <[email protected]>
## Problem
Update support for enVar in the webview

---

- 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

When API calls fail, it can be difficult to debug without the requestId.

## Solution

Log entire error to ensure we have all relevant details, not just the
error message.

---

- 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: David Hasani <[email protected]>
## Problem
`debounce` is reimplemented in multiple places. There is `debounce`:
https://github.com/aws/aws-toolkit-vscode/blob/100eb0737789d9d5ba4b04e055730b467bd97e14/packages/core/src/shared/utilities/functionUtils.ts#L89-L108
`cancellableDebounce`:
https://github.com/aws/aws-toolkit-vscode/blob/100eb0737789d9d5ba4b04e055730b467bd97e14/packages/core/src/shared/utilities/functionUtils.ts#L114-L147
and a very similar function `keyedDebounce`:
https://github.com/aws/aws-toolkit-vscode/blob/100eb0737789d9d5ba4b04e055730b467bd97e14/packages/core/src/auth/auth.ts#L107-L122

These functions should share common implementation logic, and live in
the same place for easier discoverability.

## Solution
- reimplement `debounce` in terms of `cancellableDebounce` since its a
special case.
- move these functions to shared, common location. 
- augment `debounce` to allow the callback to take arguments. 

---

- 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:

getChatAuthState() is called in many places by the Q features
simultaneously,
this eventually triggers multiple calls to getToken() and if needed
refreshToken().

This resulted in refreshToken being spammed and the Identity team seeing
spikes in token refreshes
from clients.

## Solution:

Throttle getChatAuthState().

Throttling w/ leading: true, allows us to instantly return
a fresh result OR a cached result in the case we are throttled. Debounce
on the
other hand would cause callers to hang since they have to wait for
debounce to timeout.

Also, we put a debounce on getToken() before in #6282 but this did not
work since a new
SsoAccessToken instance is created each time the offending code flow
triggered (we could
look to cache the instance instead which would enable the getToken()
debounce to be useful.

### Testing

To test the difference after adding the throttle:
- Add log statements to `getToken()`
- Set an expired date in the SSO cache for both token expiration +
client registration expiration
- Use chat

What would happen is that without throttle it would trigger
getChatAuthState() many times, likely due to the connection
becoming invalid and sending an event to all Q features, causing each of
them to call getChatAuthState() at the same time.

But when the throttle was added, the amount of these calls dropped to at
most 2.

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


---

- 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

Support transformations to Java 21.

## Solution

Add support.

---

- 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: David Hasani <[email protected]>
Co-authored-by: Maxim Hayes <[email protected]>
## Problem
1) we already have logic to show the user the request ID of the last
failed API call
2) we also already have logic to show them the failure reason
3) when a job is stopped, we don't expect anything to be present in the
`reason` field

## Solution
Remove param
#6527)

## Problem:

When a user starts up VSC, hasn't opened Q chat yet, then highlights
text and does a right click option like "send to prompt" THEN the whole
prompt fails to make it to chat.

This is because there is a race condition between the message being sent
to the webview, and the webview completed loading and ready to recieve
messages.

## Solution:

In the appToMessage publisher, verify that the chat is ready to recieve
messages based on if the webview sent the chat ui ready message.
Otherwise wait until we get it, and then send the message.

### Demo

#### Before


https://github.com/user-attachments/assets/baf86737-4a5a-4f80-86fb-9abca2c56827

#### After 


https://github.com/user-attachments/assets/c3361403-5dae-49df-a878-94722eb4fc62

---

- 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

Transformation results/artifacts expire after 24h, and sometimes users
forget to manually click the "Download Proposed Changes" button within
that time period.

## Solution

Auto-download the results from S3 when ready.

---

- 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: David Hasani <[email protected]>
…svelte files in /dev (#6523)

## Problem

The following filetypes are not currently supported in `/dev`:

- .hbs (Handlebars)
- .gjs/.gts (Glimmer JavaScript/Glimmer TypeScript)
- .astro/.mdx (Astro)
- .svelte (Svelte)
- .erb/.rake (Ruby)

## Solution

Add .hbs, .gjs, .gts, .astro, .mdx, .svelte, .erb, and .rake to list of
supported file extensions

---

- 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.
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.