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

"Scanning CloudFormation templates..." notification never goes away/finishes #3510

Closed
ConnorChristie opened this issue May 30, 2023 · 21 comments
Labels
bug We can reproduce the issue and confirmed it is a bug. pending-release performance service:cloudformation

Comments

@ConnorChristie
Copy link

Problem

Steps to reproduce the issue

  1. Install AWS Toolkit
  2. Open a large workspace with lots of files and folders.
  3. Observe that on any file open, you see this "Scanning CloudFormation templates..." notification.
  4. Close the notification.
  5. Open a new file.
  6. And the notification re-appears with the same loading bar and never finishes.

Expected behavior

My assumption is that the file scan is just never completing because there are so many files and if so, perhaps you could utilize the user's search exclude list to ignore irrelevant files.

Or give me an option to fully disable this feature and prevent CFN template discovery / watching.

System details (run the AWS: About Toolkit command)

  • OS: Linux x64 5.4.242-162.348.amzn2int.x86_64
  • Visual Studio Code version: 1.78.2
  • AWS Toolkit version: 1.74.0
@ConnorChristie ConnorChristie added the bug We can reproduce the issue and confirmed it is a bug. label May 30, 2023
@justinmk3
Copy link
Contributor

Or give me an option to fully disable this feature and prevent CFN template discovery / watching.

Disabling the aws.samcli.enableCodeLenses should help with that , but it doesn't fully disable this feature.

We are working on more total performance improvements: #3216

@ConnorChristie
Copy link
Author

Or give me an option to fully disable this feature and prevent CFN template discovery / watching.

Disabling the aws.samcli.enableCodeLenses should help with that , but it doesn't fully disable this feature.

We are working on more total performance improvements: #3216

Thank you but it seems that option was already disabled for me. Tried toggling it and that did not make a difference.

@GPhilo
Copy link

GPhilo commented Jun 26, 2023

Adding to this, it seems that whenever the scan is in progress, all other extensions stop working. This is making it impossible for me to continue using the extension, as even with aws.samcli.enableCodeLenses set to false, the scan keeps getting triggered and blocks my workspace for several minutes every time I open it.

@justinmk3
Copy link
Contributor

whenever the scan is in progress, all other extensions stop working. ... even with aws.samcli.enableCodeLenses set to false

@GPhilo can you try vscode's extensions.experimental.affinity setting? #2703 (comment) :

  1. Run the vscode command Preferences: Open User Settings (JSON)
  2. Add or update the "extensions.experimental.affinity" setting:
    "extensions.experimental.affinity": {
        "amazonwebservices.aws-toolkit-vscode": 1
    },
    

@GPhilo
Copy link

GPhilo commented Jun 26, 2023

I'll enable the setting and give it an in-depth try tomorrow, from a first look it seems that it improves the situation greatly already.

@GPhilo
Copy link

GPhilo commented Jul 3, 2023

So, after a few days with the affinity setting enabled, I still notice very big delays in other extensions while the "Scanning CloudFormation templates..." task is running.
Is there a way to disable CloudFormation linting altogether? I do not use CloudFormation templates at all and my workspace is very big, which I suspect is the reason why the scanning for templates takes forever to complete.

@justinmk3
Copy link
Contributor

Is there a way to disable CloudFormation linting altogether?

Not yet, but performance is one of our priorities in the near/medium-term.

@justinmk3 justinmk3 pinned this issue Aug 4, 2023
justinmk3 added a commit that referenced this issue Aug 24, 2023
Problem:
"Scanning CloudFormation templates..." takes a long time on big
workspaces, and there is no workaround. #3510

Solution:
When scanning for CFN/SAM templates, exclude all directories/files
specified in _all_ of the vscode settings `files.exclude`,
`search.exclude`, or `files.watcherExclude`.
justinmk3 added a commit that referenced this issue Aug 24, 2023
Problem:
"Scanning CloudFormation templates..." takes a long time on big
workspaces, and there is no workaround. #3510

Solution:
When scanning for CFN/SAM templates, exclude all directories/files
specified in _all_ of the vscode settings `files.exclude`,
`search.exclude`, or `files.watcherExclude`.
justinmk3 added a commit that referenced this issue Aug 24, 2023
Problem:
"Scanning CloudFormation templates..." takes a long time on big
workspaces, and there is no workaround. #3510

Solution:
When scanning for CFN/SAM templates, exclude all directories/files
specified in _all_ of the vscode settings `files.exclude`,
`search.exclude`, or `files.watcherExclude`.
justinmk3 added a commit that referenced this issue Aug 24, 2023
Problem:
"Scanning CloudFormation templates..." takes a long time on big
workspaces, and there is no workaround. #3510

Solution:
When scanning for CFN/SAM templates, exclude all directories/files
specified in _all_ of the vscode settings `files.exclude`,
`search.exclude`, or `files.watcherExclude`.
justinmk3 added a commit that referenced this issue Aug 24, 2023
Problem:
"Scanning CloudFormation templates..." takes a long time on big
workspaces, and there is no workaround. #3510

Solution:
When scanning for CFN/SAM templates, exclude all directories/files
specified in _all_ of the vscode settings `files.exclude`,
`search.exclude`, or `files.watcherExclude`.
@justinmk3
Copy link
Contributor

justinmk3 commented Aug 24, 2023

perhaps you could utilize the user's search exclude list to ignore irrelevant files.

Implemented in AWS Toolkit 1.86. All directories mentioned by the standard vscode settings files.exclude, search.exclude, and files.watcherExclude, are ignored by the "Scanning CloudFormation templates" feature.

That provides a flexible workaround, but the root cause of the performance issue could still be improved, so leaving this issue open.

@GPhilo
Copy link

GPhilo commented Aug 25, 2023

I think it would at least be good to add one non-standard-vscode setting to that list, so that one could use that setting to exclude parts of hiw workspace, while not affecting other VSCode functionalities.

@lonmiller
Copy link

lonmiller commented Sep 3, 2023

perhaps you could utilize the user's search exclude list to ignore irrelevant files.

Implemented in AWS Toolkit 1.86. All directories mentioned by the standard vscode settings files.exclude, search.exclude, and files.watcherExclude, are ignored by the "Scanning CloudFormation templates" feature.

That provides a flexible workaround, but the root cause of the performance issue could still be improved, so leaving this issue open.

This is not helpful. The CloudFormation scan hangs vscode at startup. I don't want the scan at all, but I want search to work for my other extensions and find in files and the global setting disables that.

@justinmk3
Copy link
Contributor

justinmk3 commented Sep 4, 2023

Supporting "exclude patterns" was a low-risk way to ameliorate some (but not all) scenarios. The next step in improving this behavior is to make it "just in time" so that it doesn't try to scan until SAM features are actually requested.

@emrainey
Copy link

emrainey commented Sep 6, 2023

The correct approach is to allow users who do not have CloudFormations to disable it. Not exclude locations. ZERO scanning.

@ayush987goyal
Copy link

@justinmk3 Do we have a timeline on when (or if) this setting (to disable scans) be released?

@bryceitoc9
Copy link
Contributor

Hey all,

I'm taking a look into this right now...my suspicion isn't necessarily the file watcher's performance, but the fact that we're essentially loading every since YAML file in the workspace. Out of curiosity, do the repos that you're having problems with have a lot of .yaml/.yml files?

@ayush987goyal
Copy link

@bryceitoc9 Thanks for taking a look into it. In my case, there is not a single .yaml/.yml files in my workspace. I appreciate us looking into it from the performance standpoint as we should but can we just skip this and have a separate setting to disable it altogether?

We can continue looking into the performance issues for the people interested in these scans in parallel but having the setting will immediately benefits a lot of the users right now.

@justinmk3
Copy link
Contributor

Adding a setting to disable this is non-trivial because SAM features depend on it. The work needed to make a "disable" setting work is similar to the work needed for the scan to be "on-demand".

Meanwhile you can disable this by setting files.watcherExclude.

@GPhilo
Copy link

GPhilo commented Oct 23, 2023

Unfortunately, disabling via files.watcherExclude does not only affect the AWS Toolkit functionality and is an unacceptable workaround, as we do rely on other functionality using file watchers.

@justinmk3
Copy link
Contributor

Understood. This issue is still open and we're continuing to work on it.

@bryceitoc9
Copy link
Contributor

bryceitoc9 commented Oct 23, 2023

I'm not 100% sure what the sequencing is, but I've also merged #3931 , which was rescanning the workspace multiple times for each runtime we support...I'm not sure if VS Code attempts to run this scanner at the same time as the YAML one (where the message is generated from).

If you want to give this a crack before the next release, you can try the latest prerelease VSIX:
https://github.com/aws/aws-toolkit-vscode/releases/tag/prerelease

justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
justinmk3 added a commit that referenced this issue Oct 26, 2023
Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.
@justinmk3
Copy link
Contributor

justinmk3 commented Oct 26, 2023

In AWS Toolkit 1.96, the "Scanning CloudFormation templates..." should no longer show except when using a SAM feature of AWS Toolkit.

Currently it will still trigger if you open a SAM template.yaml file, even if the aws.samcli.enableCodeLenses is set to false. We are looking at changing that behavior but will track it in a separate issue.

ctlai95 added a commit that referenced this issue Oct 26, 2023
)

* auth: ellipsis + right click options for `Developer Tools` (#3925)

This commit allows user to right click to root CW or CC
Node or click the new ellipsis icon, and they will get
the options to Add Connection or Signout (if appropriate)

![Screenshot 2023-10-20 at 10 50 42
AM](https://github.com/aws/aws-toolkit-vscode/assets/118216176/c934c3b6-4b8b-40b8-a24e-2c8a7a1988c6)

![Kapture 2023-10-20 at 10 36
27](https://github.com/aws/aws-toolkit-vscode/assets/118216176/aa8b0309-4981-475c-a5bd-47d4c00db478)

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>

* fix(codewihsperer): mapping language code before calling sendTelemetry API (#3928)

* fix(codewhisperer): no auto trigger in Cloud9 #3927

* feat(settings): check that user settings.json is valid #3924

Problem:
vscode notifies the user if `settings.json` is complete nonsense, but is
silent if there are only "recoverable" JSON syntax errors. So _reading_
settings will appear to work, but _writing_ settings will throw an
exception. #3910

Solution:
On startup, check that we can actually _write_ settings, and show an
error message if not.

* watchedfiles: add watch patterns once to avoid rebuilding n times (#3931)

Rrebuilding after each additional watch pattern meant we were
processing globs n times, with each run containing `{1, 2, 3, ... , n-1,
n}` patterns. Swapping this to an array and enforcing adding the
patterns once ensures we only process 1 time, for n globs on initial
load. We aren't adding globs dynamically at any point; if we ever feel
the need to, we can implement some fancy caching/expiry business.

FWIW it seems like getting the files in the glob is fairly fast, so if
processing files is the bottleneck, this might be the cure? I'm sure we
can improve more going forward regardless.

<!---
    REMINDER:
    - Read CONTRIBUTING.md first.
    - Add test coverage for your changes.
    - Update the changelog using `npm run newChange`.
    - Link to related issues/commits.
    - Testing: how did you test your changes?
    - Screenshots
-->

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>

* test: skip e2e tests #3935

Reverts 7f98260 #3827

e2e tests are still always failing because:
- webdriver html target is outdated
- we are constantly throttled

* build(deps): Bump the github-actions group with 1 update (#3937)

Bumps the github-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).

- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(redshift): stale cache in connection wizard #3926

Problem:
1. When the connection parameters is removed, the re-launched connection wizard still has the earlier connection parameters.
2. When a sql query is successful but doesn't return any record, the output message is not clear.

Solution:
1. Remove the connection wizard from the redshiftWarehouseNode constructor. When a connection wizard is launched, a new instance is created.
2. Modify the output message when a sql query is successful but doesn't return any record.

* fix: Toolkit always opens Output panel on startup #3939

Problem:
Output panel always opens at VS Code launch. #3930

Solution:
Instead of showing Output panel at Redshift activation, change to show Output panel only when a message is added.

* auth: Helper methods to check if connection exists (#3747)

* auth: funcs to indicate if the connection exists

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codewhisperer: method that indicates if valid connection exists

For the add connection telemetry we want to know if a CW auth'
connection already exists, not necessarily the currently active
one.

This adds 2 methods that return true if the valid CW connection
exists and is known by the toolkit.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: create isSsoConnection() alternatives

A sso connection contains different types of sso connections,
such as Builder ID or AWS Identity Center (Base).

This commit creates functions to enable a user to check
with specificity of if a connection is of a specific type
of sso connection.

Additionally, it updates existing uses to the appropriate
implementation.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codecatalyst: function if toolkit is aware of valid builder id

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: fix circular dep issue

Moves isValidCodeCatalystConnection() to the
auth/connections.ts module and it fixes the circular dep

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: rename 'base' sso to 'idc' sso

This naming is easier to understand even though
the term Identity Center (idc) is purely a brand
name and subject to change in the future.

Signed-off-by: nkomonen <nkomonen@amazon.com>

---------

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Signed-off-by: nkomonen <nkomonen@amazon.com>

* feat(cloudwatchlogs): preserve position while loading items #3934

Problem:
When trying to select a CloudWatch Log Stream, the UI scrolls to the top
while fetching all streams, which is very difficult to use.

Solution:
Set `keepScrollPosition = true` by default.
Closes #2379

* codewhisperer: switch to default model when receiving ResouceNotFoundException (#3941)

* filewatcher: template watcher lazy-loads if enableCodeLenses is off (#3938)

## Problem
The template file watcher always ran regardless of SAM hint setting

## Solution
The template file watcher now loads on demand. This appears to work even when toggling from off to on (codelenses appear on the template file)
* ~~This may hit the startup function multiple times? Will do some more testing~~ should be resolved with 0b1df9d
* Confirmed SAM debug works, when coming from startup with codelenses disabled
* Confirmed the registry builds when codelenses are enabled

* deps: bump @types/vscode to 1.68 #3880

previous: 5439f95

* refactor(watchedfiles): rename getRegisteredItem => getItem

Problem:
getRegisteredItem implies there is some other kind of "item", which is
confusing.

Solution:
Rename to getItem.

* refactor(watchedfiles): rename registeredItems => items

Problem:
The name `registeredItems` implies there is some other kind of "item",
which is confusing and noisy, and unnecessarily verbose.

Solution:
Rename to `items`.

* codewhisperer: reduce token infilling suggestions (#3944)

* refactor(redshift): logging and output messages #3943

Problem:
There are similar logging and output message in node explorer. Refactoring code to centralize logging and message output makes it easy for maintenance.

Solution:
Create message functions and add them in utils.

* feat(lambda): increase timeout to 5 minutes #3954

* fix(sam): "Invalid (or missing) template file"

Problem:
SAM debug may fail to find template.yaml even if it is explicitly given
by `invokeTarget.templatePath` in the vscode launch config. #2614

Solution:
- Always call addItem() in validate(), instead of depending on the
  workspace-wide "scan".
- Log a message when process() fails to process the file contents.

* fix(sam): "Add SAM Debug Configuration" does nothing

Problem:
"AWS: Add SAM Debug Configuration" only works the first time it is
invoked. regression from 89b8a94

Solution:
Move samDebugConfigCmd() out of the if-condition.

* changelog #3957

* cloud9: skip "!isWeb" check #3956

Problem:
Cloud9 sets `isWeb` even though it has "compute".

Solution:
Add an explicit condition for Cloud9 wherever we check `isWeb`.

ref d2f03d5

* feat(codewhisperer): select customization by prefix (#3947)

Problem:
The `aws.codeWhisperer.connect` command was introduced to allow enterprises
to establish a default customization for onboarding developers after
establishing an IdC connection.

However, it only selected with a given ARN. Given the current behavior
for adding updated customization for CodeWhisperer, an enterprise would
need to keep the ARN up-to-date as well when calling this command.

Solution:
Provide the ability to define the customization to select with a
prefix for the customization name. This way the logic to select a
customization as updated customizations are introduced can be simplified
on the administrator side by maintaining a prefix.
e.g. MyModel-v1, MyModel-v2, etc.

Co-authored-by: Will Lovo <wlovo@amazon.com>

* perf(startup): avoid templateRegistry in awsFiletypes.ts #3962

Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.

* Release 1.96.0

* Update version to snapshot version: 1.97.0-SNAPSHOT

* feat: sm ide #3837

Problem:
New SM VSCode IDE with IAM role, we want to use the IAM role for Code Whisperer
auth. Currently Code Whisperer auth used Builder ID/SSO/Cloud9(IAM). Current IAM
auth is for Cloud9 IDE and does not allow for paginated results.

Solution:
Add new IDE type for SM VSCode that can be used for this feature and future
modifications. Use the new IDE type for conditional on connection type to use,
defaulting to IAM. Use IAM for Code Whisperer and make sure we use the correct,
`generateRecommendations`, endpoint to allow for auth with IAM and paginated
results.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: aws-toolkit-automation <>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Tai Lai <ctlai95@gmail.com>
justinmk3 added a commit that referenced this issue Nov 26, 2023
* CodeWhisperer: Security Issue Hover Provider (#3884)

* add hover provider for security issues

* add unit tests

* codewhisperer: add markdown content for hover (#3890)

* add markdown content for hover

* allow multiple add/deletions in the same diff

* codewhisperer: security hover update range and format (#3908)

## Problem

Hovers positions are not being updated if the document changes.

## Solution

Add an event handler which either removes the hover or offsets the line
number depending on what was changed (similar to how [diagnostics are
updated](https://github.com/aws/aws-toolkit-vscode/blob/0974becd8d26bc12a640b34bfbefc2e20fe8cb17/src/codewhisperer/service/diagnosticsProvider.ts#L61-L93
)) 
## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

* codewhisperer: add quick fix code actions for issues (#3932)

* codewhisperer: create webview panel for security issue (#3896)

* create webview panel for security issue

* update webview html

* refactor to use vue webview factory

* clean up

* update webview styles

* hide apply fix button when no suggested fix available

* update model

* fix tests

* codewhisperer: telemetry metrics for hover #3955

Problem
We want to track metrics for the number of times a user hovered on a vulnerability line.

Solution
Added metric event codewhisperer_codeScanIssueHover that will emit every time an issue is hovered over.

* Merge master into feature/codewhisperer/assisted-code-remediation (#3929)

* auth: ellipsis + right click options for `Developer Tools` (#3925)

This commit allows user to right click to root CW or CC
Node or click the new ellipsis icon, and they will get
the options to Add Connection or Signout (if appropriate)

![Screenshot 2023-10-20 at 10 50 42
AM](https://github.com/aws/aws-toolkit-vscode/assets/118216176/c934c3b6-4b8b-40b8-a24e-2c8a7a1988c6)

![Kapture 2023-10-20 at 10 36
27](https://github.com/aws/aws-toolkit-vscode/assets/118216176/aa8b0309-4981-475c-a5bd-47d4c00db478)

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>

* fix(codewihsperer): mapping language code before calling sendTelemetry API (#3928)

* fix(codewhisperer): no auto trigger in Cloud9 #3927

* feat(settings): check that user settings.json is valid #3924

Problem:
vscode notifies the user if `settings.json` is complete nonsense, but is
silent if there are only "recoverable" JSON syntax errors. So _reading_
settings will appear to work, but _writing_ settings will throw an
exception. #3910

Solution:
On startup, check that we can actually _write_ settings, and show an
error message if not.

* watchedfiles: add watch patterns once to avoid rebuilding n times (#3931)

Rrebuilding after each additional watch pattern meant we were
processing globs n times, with each run containing `{1, 2, 3, ... , n-1,
n}` patterns. Swapping this to an array and enforcing adding the
patterns once ensures we only process 1 time, for n globs on initial
load. We aren't adding globs dynamically at any point; if we ever feel
the need to, we can implement some fancy caching/expiry business.

FWIW it seems like getting the files in the glob is fairly fast, so if
processing files is the bottleneck, this might be the cure? I'm sure we
can improve more going forward regardless.

<!---
    REMINDER:
    - Read CONTRIBUTING.md first.
    - Add test coverage for your changes.
    - Update the changelog using `npm run newChange`.
    - Link to related issues/commits.
    - Testing: how did you test your changes?
    - Screenshots
-->

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>

* test: skip e2e tests #3935

Reverts 7f98260 #3827

e2e tests are still always failing because:
- webdriver html target is outdated
- we are constantly throttled

* build(deps): Bump the github-actions group with 1 update (#3937)

Bumps the github-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).

- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(redshift): stale cache in connection wizard #3926

Problem:
1. When the connection parameters is removed, the re-launched connection wizard still has the earlier connection parameters.
2. When a sql query is successful but doesn't return any record, the output message is not clear.

Solution:
1. Remove the connection wizard from the redshiftWarehouseNode constructor. When a connection wizard is launched, a new instance is created.
2. Modify the output message when a sql query is successful but doesn't return any record.

* fix: Toolkit always opens Output panel on startup #3939

Problem:
Output panel always opens at VS Code launch. #3930

Solution:
Instead of showing Output panel at Redshift activation, change to show Output panel only when a message is added.

* auth: Helper methods to check if connection exists (#3747)

* auth: funcs to indicate if the connection exists

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codewhisperer: method that indicates if valid connection exists

For the add connection telemetry we want to know if a CW auth'
connection already exists, not necessarily the currently active
one.

This adds 2 methods that return true if the valid CW connection
exists and is known by the toolkit.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: create isSsoConnection() alternatives

A sso connection contains different types of sso connections,
such as Builder ID or AWS Identity Center (Base).

This commit creates functions to enable a user to check
with specificity of if a connection is of a specific type
of sso connection.

Additionally, it updates existing uses to the appropriate
implementation.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codecatalyst: function if toolkit is aware of valid builder id

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: fix circular dep issue

Moves isValidCodeCatalystConnection() to the
auth/connections.ts module and it fixes the circular dep

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: rename 'base' sso to 'idc' sso

This naming is easier to understand even though
the term Identity Center (idc) is purely a brand
name and subject to change in the future.

Signed-off-by: nkomonen <nkomonen@amazon.com>

---------

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Signed-off-by: nkomonen <nkomonen@amazon.com>

* feat(cloudwatchlogs): preserve position while loading items #3934

Problem:
When trying to select a CloudWatch Log Stream, the UI scrolls to the top
while fetching all streams, which is very difficult to use.

Solution:
Set `keepScrollPosition = true` by default.
Closes #2379

* codewhisperer: switch to default model when receiving ResouceNotFoundException (#3941)

* filewatcher: template watcher lazy-loads if enableCodeLenses is off (#3938)

## Problem
The template file watcher always ran regardless of SAM hint setting

## Solution
The template file watcher now loads on demand. This appears to work even when toggling from off to on (codelenses appear on the template file)
* ~~This may hit the startup function multiple times? Will do some more testing~~ should be resolved with 0b1df9d
* Confirmed SAM debug works, when coming from startup with codelenses disabled
* Confirmed the registry builds when codelenses are enabled

* deps: bump @types/vscode to 1.68 #3880

previous: 5439f95

* refactor(watchedfiles): rename getRegisteredItem => getItem

Problem:
getRegisteredItem implies there is some other kind of "item", which is
confusing.

Solution:
Rename to getItem.

* refactor(watchedfiles): rename registeredItems => items

Problem:
The name `registeredItems` implies there is some other kind of "item",
which is confusing and noisy, and unnecessarily verbose.

Solution:
Rename to `items`.

* codewhisperer: reduce token infilling suggestions (#3944)

* refactor(redshift): logging and output messages #3943

Problem:
There are similar logging and output message in node explorer. Refactoring code to centralize logging and message output makes it easy for maintenance.

Solution:
Create message functions and add them in utils.

* feat(lambda): increase timeout to 5 minutes #3954

* fix(sam): "Invalid (or missing) template file"

Problem:
SAM debug may fail to find template.yaml even if it is explicitly given
by `invokeTarget.templatePath` in the vscode launch config. #2614

Solution:
- Always call addItem() in validate(), instead of depending on the
  workspace-wide "scan".
- Log a message when process() fails to process the file contents.

* fix(sam): "Add SAM Debug Configuration" does nothing

Problem:
"AWS: Add SAM Debug Configuration" only works the first time it is
invoked. regression from 89b8a94

Solution:
Move samDebugConfigCmd() out of the if-condition.

* changelog #3957

* cloud9: skip "!isWeb" check #3956

Problem:
Cloud9 sets `isWeb` even though it has "compute".

Solution:
Add an explicit condition for Cloud9 wherever we check `isWeb`.

ref d2f03d5

* feat(codewhisperer): select customization by prefix (#3947)

Problem:
The `aws.codeWhisperer.connect` command was introduced to allow enterprises
to establish a default customization for onboarding developers after
establishing an IdC connection.

However, it only selected with a given ARN. Given the current behavior
for adding updated customization for CodeWhisperer, an enterprise would
need to keep the ARN up-to-date as well when calling this command.

Solution:
Provide the ability to define the customization to select with a
prefix for the customization name. This way the logic to select a
customization as updated customizations are introduced can be simplified
on the administrator side by maintaining a prefix.
e.g. MyModel-v1, MyModel-v2, etc.

Co-authored-by: Will Lovo <wlovo@amazon.com>

* perf(startup): avoid templateRegistry in awsFiletypes.ts #3962

Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.

* Release 1.96.0

* Update version to snapshot version: 1.97.0-SNAPSHOT

* feat: sm ide #3837

Problem:
New SM VSCode IDE with IAM role, we want to use the IAM role for Code Whisperer
auth. Currently Code Whisperer auth used Builder ID/SSO/Cloud9(IAM). Current IAM
auth is for Cloud9 IDE and does not allow for paginated results.

Solution:
Add new IDE type for SM VSCode that can be used for this feature and future
modifications. Use the new IDE type for conditional on connection type to use,
defaulting to IAM. Use IAM for Code Whisperer and make sure we use the correct,
`generateRecommendations`, endpoint to allow for auth with IAM and paginated
results.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: aws-toolkit-automation <>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Tai Lai <ctlai95@gmail.com>

* fix(codewhisperer): load hover images from dist folder (#3964)

* fix(codewhisperer): load hover images from dist folder

* fix tests

* codewhisperer: emit issues with fixes count #3972

* feat(codewhisperer): apply security fix command (#3918)

* Added apply security fix command
* Added diff package to apply patch
* added functionality to apply patch and update the file.
* Wrote tests

* feat(codewhisperer): code action to open webview (#3973)

* feat(CodeWhisperer): add apply security fix command for quick fix and apply fix button in WebView (#3981)

* add apply security fix command for quick fix and apply fix button in webview

* updated text and action type for view details

* codewhisperer: downgrade telemetry package (#4006)

* codewhisperer: telemetry metrics apply fix (#4007)

* codewhisperer: add metrics for apply fix

* fix tests

* move source values to component

* use different component values for tests

* revert move source values to component

* feat(codewhisperer): add file path in webview (#4011)

* added file path field in details to navigate back to the vulnerable line

* fixed css for value of fixed available

* codewhisperer: telemetry to use component metadata type (#4015)

* codewhisperer: move images to resource folder (#4021)

Severity svg images are not loading properly as icons, so creating a new folder `resources/images` instead

* codewhisperer: open file in view column one (#4028)

* codewhisperer: open file in view column one

* return thenable

* remove auto formatting

* remove auto formatting

* remove auto formatting

* remove auto formatting

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Manthan <manthanpatel.mj@gmail.com>
@justinmk3 justinmk3 unpinned this issue Nov 28, 2023
justinmk3 added a commit that referenced this issue Nov 28, 2023
* CodeWhisperer: TS, C#, Cloud Formation[JSON & YAML/YML] & Terraform [TF & HCL] language support for Security Scans (#1182)

* CW: Add TS language for CG Security scans

* Add Csharp langauge for SecurityScans along with Test Cases

* CW: Revised Code for C# language

* CW: Adding CloudFormation support for security scans

* CW:YAML and JSON implementation in VSC

* CW:Test cases for Cloud Formation

* CW:Test cases for CF

* CW: Support for Terraform TF&HCL

* CW: Add test cases for Terraform TF & HCL

* CW: Revised Changes

* Merge branch 'feature/iaacsecurityscans' staging into feature/iaacsecurityscans

* CW: Revised changes for CSharp

* CW: Changes in TS Implementation

* CW: Change in HCL Implementation

* CW: Revised changes Terraform

* CW: Add TS language for CG Security scans

* Add Csharp langauge for SecurityScans along with Test Cases

* CW: Revised Code for C# language

* CW: Adding CloudFormation support for security scans

* CW:YAML and JSON implementation in VSC

* CW:Test cases for Cloud Formation

* CW:Test cases for CF

* CW: Support for Terraform TF&HCL

* CW: Add test cases for Terraform TF & HCL

* CW: Revised Changes

* Merge branch 'feature/iaacsecurityscans' staging into feature/iaacsecurityscans

* CW: Revised changes for CSharp

* CW: Changes in TS Implementation

* CW: Change in HCL Implementation

* CW: Revised changes Terraform

* External fix(ecs): exec command requires SimulatePrincipalPolicy permissions #3993

Problem:
We attempt `SimulatePrincipalPolicy` to verify the container task role
has proper permissions before running exec command. Users may not have
access to simulate policies, but may otherwise be able to run exec
command without issue. #3969

Solution:
Only attempt `SimulatePrincipalPolicy` if exec command fails. Otherwise,
there is no need to simulate policies.

* CW: Revised changes

* CW:Revised Code

* CW:Revised Changes according to PR Comments

* CW:Revised Changes

* CW: Various Changes

* CW: various changes according to PR

* CW: Adding a Test Case for CSharp Security Scans

---------

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* Merge from public (#1275)

* CodeWhisperer: Security Issue Hover Provider (#3884)

* add hover provider for security issues

* add unit tests

* codewhisperer: add markdown content for hover (#3890)

* add markdown content for hover

* allow multiple add/deletions in the same diff

* codewhisperer: security hover update range and format (#3908)

## Problem

Hovers positions are not being updated if the document changes.

## Solution

Add an event handler which either removes the hover or offsets the line
number depending on what was changed (similar to how [diagnostics are
updated](https://github.com/aws/aws-toolkit-vscode/blob/0974becd8d26bc12a640b34bfbefc2e20fe8cb17/src/codewhisperer/service/diagnosticsProvider.ts#L61-L93
)) 
## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

* codewhisperer: add quick fix code actions for issues (#3932)

* codewhisperer: create webview panel for security issue (#3896)

* create webview panel for security issue

* update webview html

* refactor to use vue webview factory

* clean up

* update webview styles

* hide apply fix button when no suggested fix available

* update model

* fix tests

* codewhisperer: telemetry metrics for hover #3955

Problem
We want to track metrics for the number of times a user hovered on a vulnerability line.

Solution
Added metric event codewhisperer_codeScanIssueHover that will emit every time an issue is hovered over.

* Merge master into feature/codewhisperer/assisted-code-remediation (#3929)

* auth: ellipsis + right click options for `Developer Tools` (#3925)

This commit allows user to right click to root CW or CC
Node or click the new ellipsis icon, and they will get
the options to Add Connection or Signout (if appropriate)

![Screenshot 2023-10-20 at 10 50 42
AM](https://github.com/aws/aws-toolkit-vscode/assets/118216176/c934c3b6-4b8b-40b8-a24e-2c8a7a1988c6)

![Kapture 2023-10-20 at 10 36
27](https://github.com/aws/aws-toolkit-vscode/assets/118216176/aa8b0309-4981-475c-a5bd-47d4c00db478)

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>

* fix(codewihsperer): mapping language code before calling sendTelemetry API (#3928)

* fix(codewhisperer): no auto trigger in Cloud9 #3927

* feat(settings): check that user settings.json is valid #3924

Problem:
vscode notifies the user if `settings.json` is complete nonsense, but is
silent if there are only "recoverable" JSON syntax errors. So _reading_
settings will appear to work, but _writing_ settings will throw an
exception. #3910

Solution:
On startup, check that we can actually _write_ settings, and show an
error message if not.

* watchedfiles: add watch patterns once to avoid rebuilding n times (#3931)

Rrebuilding after each additional watch pattern meant we were
processing globs n times, with each run containing `{1, 2, 3, ... , n-1,
n}` patterns. Swapping this to an array and enforcing adding the
patterns once ensures we only process 1 time, for n globs on initial
load. We aren't adding globs dynamically at any point; if we ever feel
the need to, we can implement some fancy caching/expiry business.

FWIW it seems like getting the files in the glob is fairly fast, so if
processing files is the bottleneck, this might be the cure? I'm sure we
can improve more going forward regardless.

<!---
    REMINDER:
    - Read CONTRIBUTING.md first.
    - Add test coverage for your changes.
    - Update the changelog using `npm run newChange`.
    - Link to related issues/commits.
    - Testing: how did you test your changes?
    - Screenshots
-->

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>

* test: skip e2e tests #3935

Reverts 7f98260 #3827

e2e tests are still always failing because:
- webdriver html target is outdated
- we are constantly throttled

* build(deps): Bump the github-actions group with 1 update (#3937)

Bumps the github-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).

- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(redshift): stale cache in connection wizard #3926

Problem:
1. When the connection parameters is removed, the re-launched connection wizard still has the earlier connection parameters.
2. When a sql query is successful but doesn't return any record, the output message is not clear.

Solution:
1. Remove the connection wizard from the redshiftWarehouseNode constructor. When a connection wizard is launched, a new instance is created.
2. Modify the output message when a sql query is successful but doesn't return any record.

* fix: Toolkit always opens Output panel on startup #3939

Problem:
Output panel always opens at VS Code launch. #3930

Solution:
Instead of showing Output panel at Redshift activation, change to show Output panel only when a message is added.

* auth: Helper methods to check if connection exists (#3747)

* auth: funcs to indicate if the connection exists

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codewhisperer: method that indicates if valid connection exists

For the add connection telemetry we want to know if a CW auth'
connection already exists, not necessarily the currently active
one.

This adds 2 methods that return true if the valid CW connection
exists and is known by the toolkit.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: create isSsoConnection() alternatives

A sso connection contains different types of sso connections,
such as Builder ID or AWS Identity Center (Base).

This commit creates functions to enable a user to check
with specificity of if a connection is of a specific type
of sso connection.

Additionally, it updates existing uses to the appropriate
implementation.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codecatalyst: function if toolkit is aware of valid builder id

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: fix circular dep issue

Moves isValidCodeCatalystConnection() to the
auth/connections.ts module and it fixes the circular dep

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: rename 'base' sso to 'idc' sso

This naming is easier to understand even though
the term Identity Center (idc) is purely a brand
name and subject to change in the future.

Signed-off-by: nkomonen <nkomonen@amazon.com>

---------

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Signed-off-by: nkomonen <nkomonen@amazon.com>

* feat(cloudwatchlogs): preserve position while loading items #3934

Problem:
When trying to select a CloudWatch Log Stream, the UI scrolls to the top
while fetching all streams, which is very difficult to use.

Solution:
Set `keepScrollPosition = true` by default.
Closes #2379

* codewhisperer: switch to default model when receiving ResouceNotFoundException (#3941)

* filewatcher: template watcher lazy-loads if enableCodeLenses is off (#3938)

## Problem
The template file watcher always ran regardless of SAM hint setting

## Solution
The template file watcher now loads on demand. This appears to work even when toggling from off to on (codelenses appear on the template file)
* ~~This may hit the startup function multiple times? Will do some more testing~~ should be resolved with 0b1df9d
* Confirmed SAM debug works, when coming from startup with codelenses disabled
* Confirmed the registry builds when codelenses are enabled

* deps: bump @types/vscode to 1.68 #3880

previous: 5439f95

* refactor(watchedfiles): rename getRegisteredItem => getItem

Problem:
getRegisteredItem implies there is some other kind of "item", which is
confusing.

Solution:
Rename to getItem.

* refactor(watchedfiles): rename registeredItems => items

Problem:
The name `registeredItems` implies there is some other kind of "item",
which is confusing and noisy, and unnecessarily verbose.

Solution:
Rename to `items`.

* codewhisperer: reduce token infilling suggestions (#3944)

* refactor(redshift): logging and output messages #3943

Problem:
There are similar logging and output message in node explorer. Refactoring code to centralize logging and message output makes it easy for maintenance.

Solution:
Create message functions and add them in utils.

* feat(lambda): increase timeout to 5 minutes #3954

* fix(sam): "Invalid (or missing) template file"

Problem:
SAM debug may fail to find template.yaml even if it is explicitly given
by `invokeTarget.templatePath` in the vscode launch config. #2614

Solution:
- Always call addItem() in validate(), instead of depending on the
  workspace-wide "scan".
- Log a message when process() fails to process the file contents.

* fix(sam): "Add SAM Debug Configuration" does nothing

Problem:
"AWS: Add SAM Debug Configuration" only works the first time it is
invoked. regression from 89b8a94

Solution:
Move samDebugConfigCmd() out of the if-condition.

* changelog #3957

* cloud9: skip "!isWeb" check #3956

Problem:
Cloud9 sets `isWeb` even though it has "compute".

Solution:
Add an explicit condition for Cloud9 wherever we check `isWeb`.

ref d2f03d5

* feat(codewhisperer): select customization by prefix (#3947)

Problem:
The `aws.codeWhisperer.connect` command was introduced to allow enterprises
to establish a default customization for onboarding developers after
establishing an IdC connection.

However, it only selected with a given ARN. Given the current behavior
for adding updated customization for CodeWhisperer, an enterprise would
need to keep the ARN up-to-date as well when calling this command.

Solution:
Provide the ability to define the customization to select with a
prefix for the customization name. This way the logic to select a
customization as updated customizations are introduced can be simplified
on the administrator side by maintaining a prefix.
e.g. MyModel-v1, MyModel-v2, etc.

Co-authored-by: Will Lovo <wlovo@amazon.com>

* perf(startup): avoid templateRegistry in awsFiletypes.ts #3962

Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.

* Release 1.96.0

* Update version to snapshot version: 1.97.0-SNAPSHOT

* feat: sm ide #3837

Problem:
New SM VSCode IDE with IAM role, we want to use the IAM role for Code Whisperer
auth. Currently Code Whisperer auth used Builder ID/SSO/Cloud9(IAM). Current IAM
auth is for Cloud9 IDE and does not allow for paginated results.

Solution:
Add new IDE type for SM VSCode that can be used for this feature and future
modifications. Use the new IDE type for conditional on connection type to use,
defaulting to IAM. Use IAM for Code Whisperer and make sure we use the correct,
`generateRecommendations`, endpoint to allow for auth with IAM and paginated
results.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: aws-toolkit-automation <>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Tai Lai <ctlai95@gmail.com>

* fix(codewhisperer): load hover images from dist folder (#3964)

* fix(codewhisperer): load hover images from dist folder

* fix tests

* codewhisperer: emit issues with fixes count #3972

* feat(codewhisperer): apply security fix command (#3918)

* Added apply security fix command
* Added diff package to apply patch
* added functionality to apply patch and update the file.
* Wrote tests

* feat(codewhisperer): code action to open webview (#3973)

* feat(CodeWhisperer): add apply security fix command for quick fix and apply fix button in WebView (#3981)

* add apply security fix command for quick fix and apply fix button in webview

* updated text and action type for view details

* codewhisperer: downgrade telemetry package (#4006)

* codewhisperer: telemetry metrics apply fix (#4007)

* codewhisperer: add metrics for apply fix

* fix tests

* move source values to component

* use different component values for tests

* revert move source values to component

* feat(codewhisperer): add file path in webview (#4011)

* added file path field in details to navigate back to the vulnerable line

* fixed css for value of fixed available

* codewhisperer: telemetry to use component metadata type (#4015)

* codewhisperer: move images to resource folder (#4021)

Severity svg images are not loading properly as icons, so creating a new folder `resources/images` instead

* codewhisperer: open file in view column one (#4028)

* codewhisperer: open file in view column one

* return thenable

* remove auto formatting

* remove auto formatting

* remove auto formatting

* remove auto formatting

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Manthan <manthanpatel.mj@gmail.com>

* CW: Adding languages to runtimeLanguageSet for Telemetry in Security Scans (#1272)

* Changes in Telemetry

* type check chnage

---------

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* Merging staging to feature/codewhisperer/asssited-coderemediation branch (#1305)

perf(codewhisperer): connection reuse for generationCompletions #4040

Problem:
[microsoft/vscode#173861](microsoft/vscode#173861)

Solution:
Inject http agent only for the GenerateCompletions API, do this per IDE session.

Tested and verified:
1. This inject won't happen for any other API calls. It only applies to
   GenerateCompletions API when user is NOT using `http.proxy` vscode feature.
2. No regression found with Toolkit features or CodeWhisperer features.
3. Regardless of user VSC proxy setting `http.proxySupport`, it still enables HTTP connection reuse.
4. Tested in AWS Cloud9.

Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>

* fix(codewhisperer): hide acr description if empty

Problem:
Backend is returning empty string or `Suggested remediation:` for some remediation description, which causes incomplete sections in the UI.

Solution:
Handle this case by hiding "Why are we recommending this?" section if description is missing/incomplete.

* CW: Adding selected JSON File into zip for the Security Scan

Problem
Zip file for security scan does not contain selected file.

Solution
Fixed this in this PR.

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>
Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Manthan <manthanpatel.mj@gmail.com>
justinmk3 added a commit that referenced this issue Nov 28, 2023
* CodeWhisperer: TS, C#, Cloud Formation[JSON & YAML/YML] & Terraform [TF & HCL] language support for Security Scans (#1182)

* CW: Add TS language for CG Security scans

* Add Csharp langauge for SecurityScans along with Test Cases

* CW: Revised Code for C# language

* CW: Adding CloudFormation support for security scans

* CW:YAML and JSON implementation in VSC

* CW:Test cases for Cloud Formation

* CW:Test cases for CF

* CW: Support for Terraform TF&HCL

* CW: Add test cases for Terraform TF & HCL

* CW: Revised Changes

* Merge branch 'feature/iaacsecurityscans' staging into feature/iaacsecurityscans

* CW: Revised changes for CSharp

* CW: Changes in TS Implementation

* CW: Change in HCL Implementation

* CW: Revised changes Terraform

* CW: Add TS language for CG Security scans

* Add Csharp langauge for SecurityScans along with Test Cases

* CW: Revised Code for C# language

* CW: Adding CloudFormation support for security scans

* CW:YAML and JSON implementation in VSC

* CW:Test cases for Cloud Formation

* CW:Test cases for CF

* CW: Support for Terraform TF&HCL

* CW: Add test cases for Terraform TF & HCL

* CW: Revised Changes

* Merge branch 'feature/iaacsecurityscans' staging into feature/iaacsecurityscans

* CW: Revised changes for CSharp

* CW: Changes in TS Implementation

* CW: Change in HCL Implementation

* CW: Revised changes Terraform

* External fix(ecs): exec command requires SimulatePrincipalPolicy permissions #3993

Problem:
We attempt `SimulatePrincipalPolicy` to verify the container task role
has proper permissions before running exec command. Users may not have
access to simulate policies, but may otherwise be able to run exec
command without issue. #3969

Solution:
Only attempt `SimulatePrincipalPolicy` if exec command fails. Otherwise,
there is no need to simulate policies.

* CW: Revised changes

* CW:Revised Code

* CW:Revised Changes according to PR Comments

* CW:Revised Changes

* CW: Various Changes

* CW: various changes according to PR

* CW: Adding a Test Case for CSharp Security Scans

---------

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* fix(codewhisperer): Add connection reuse for generationCompletions (#1214)

* Add connection reuse for generationCompletions

* Merge from public (#1275)

* CodeWhisperer: Security Issue Hover Provider (#3884)

* add hover provider for security issues

* add unit tests

* codewhisperer: add markdown content for hover (#3890)

* add markdown content for hover

* allow multiple add/deletions in the same diff

* codewhisperer: security hover update range and format (#3908)

## Problem

Hovers positions are not being updated if the document changes.

## Solution

Add an event handler which either removes the hover or offsets the line
number depending on what was changed (similar to how [diagnostics are
updated](https://github.com/aws/aws-toolkit-vscode/blob/0974becd8d26bc12a640b34bfbefc2e20fe8cb17/src/codewhisperer/service/diagnosticsProvider.ts#L61-L93
)) 
## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

* codewhisperer: add quick fix code actions for issues (#3932)

* codewhisperer: create webview panel for security issue (#3896)

* create webview panel for security issue

* update webview html

* refactor to use vue webview factory

* clean up

* update webview styles

* hide apply fix button when no suggested fix available

* update model

* fix tests

* codewhisperer: telemetry metrics for hover #3955

Problem
We want to track metrics for the number of times a user hovered on a vulnerability line.

Solution
Added metric event codewhisperer_codeScanIssueHover that will emit every time an issue is hovered over.

* Merge master into feature/codewhisperer/assisted-code-remediation (#3929)

* auth: ellipsis + right click options for `Developer Tools` (#3925)

This commit allows user to right click to root CW or CC
Node or click the new ellipsis icon, and they will get
the options to Add Connection or Signout (if appropriate)

![Screenshot 2023-10-20 at 10 50 42
AM](https://github.com/aws/aws-toolkit-vscode/assets/118216176/c934c3b6-4b8b-40b8-a24e-2c8a7a1988c6)

![Kapture 2023-10-20 at 10 36
27](https://github.com/aws/aws-toolkit-vscode/assets/118216176/aa8b0309-4981-475c-a5bd-47d4c00db478)

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>

* fix(codewihsperer): mapping language code before calling sendTelemetry API (#3928)

* fix(codewhisperer): no auto trigger in Cloud9 #3927

* feat(settings): check that user settings.json is valid #3924

Problem:
vscode notifies the user if `settings.json` is complete nonsense, but is
silent if there are only "recoverable" JSON syntax errors. So _reading_
settings will appear to work, but _writing_ settings will throw an
exception. #3910

Solution:
On startup, check that we can actually _write_ settings, and show an
error message if not.

* watchedfiles: add watch patterns once to avoid rebuilding n times (#3931)

Rrebuilding after each additional watch pattern meant we were
processing globs n times, with each run containing `{1, 2, 3, ... , n-1,
n}` patterns. Swapping this to an array and enforcing adding the
patterns once ensures we only process 1 time, for n globs on initial
load. We aren't adding globs dynamically at any point; if we ever feel
the need to, we can implement some fancy caching/expiry business.

FWIW it seems like getting the files in the glob is fairly fast, so if
processing files is the bottleneck, this might be the cure? I'm sure we
can improve more going forward regardless.

<!---
    REMINDER:
    - Read CONTRIBUTING.md first.
    - Add test coverage for your changes.
    - Update the changelog using `npm run newChange`.
    - Link to related issues/commits.
    - Testing: how did you test your changes?
    - Screenshots
-->

## License

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>

* test: skip e2e tests #3935

Reverts 7f98260 #3827

e2e tests are still always failing because:
- webdriver html target is outdated
- we are constantly throttled

* build(deps): Bump the github-actions group with 1 update (#3937)

Bumps the github-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).

- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(redshift): stale cache in connection wizard #3926

Problem:
1. When the connection parameters is removed, the re-launched connection wizard still has the earlier connection parameters.
2. When a sql query is successful but doesn't return any record, the output message is not clear.

Solution:
1. Remove the connection wizard from the redshiftWarehouseNode constructor. When a connection wizard is launched, a new instance is created.
2. Modify the output message when a sql query is successful but doesn't return any record.

* fix: Toolkit always opens Output panel on startup #3939

Problem:
Output panel always opens at VS Code launch. #3930

Solution:
Instead of showing Output panel at Redshift activation, change to show Output panel only when a message is added.

* auth: Helper methods to check if connection exists (#3747)

* auth: funcs to indicate if the connection exists

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codewhisperer: method that indicates if valid connection exists

For the add connection telemetry we want to know if a CW auth'
connection already exists, not necessarily the currently active
one.

This adds 2 methods that return true if the valid CW connection
exists and is known by the toolkit.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: create isSsoConnection() alternatives

A sso connection contains different types of sso connections,
such as Builder ID or AWS Identity Center (Base).

This commit creates functions to enable a user to check
with specificity of if a connection is of a specific type
of sso connection.

Additionally, it updates existing uses to the appropriate
implementation.

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* codecatalyst: function if toolkit is aware of valid builder id

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: fix circular dep issue

Moves isValidCodeCatalystConnection() to the
auth/connections.ts module and it fixes the circular dep

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>

* refactor: rename 'base' sso to 'idc' sso

This naming is easier to understand even though
the term Identity Center (idc) is purely a brand
name and subject to change in the future.

Signed-off-by: nkomonen <nkomonen@amazon.com>

---------

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Signed-off-by: nkomonen <nkomonen@amazon.com>

* feat(cloudwatchlogs): preserve position while loading items #3934

Problem:
When trying to select a CloudWatch Log Stream, the UI scrolls to the top
while fetching all streams, which is very difficult to use.

Solution:
Set `keepScrollPosition = true` by default.
Closes #2379

* codewhisperer: switch to default model when receiving ResouceNotFoundException (#3941)

* filewatcher: template watcher lazy-loads if enableCodeLenses is off (#3938)

## Problem
The template file watcher always ran regardless of SAM hint setting

## Solution
The template file watcher now loads on demand. This appears to work even when toggling from off to on (codelenses appear on the template file)
* ~~This may hit the startup function multiple times? Will do some more testing~~ should be resolved with 0b1df9d
* Confirmed SAM debug works, when coming from startup with codelenses disabled
* Confirmed the registry builds when codelenses are enabled

* deps: bump @types/vscode to 1.68 #3880

previous: 5439f95

* refactor(watchedfiles): rename getRegisteredItem => getItem

Problem:
getRegisteredItem implies there is some other kind of "item", which is
confusing.

Solution:
Rename to getItem.

* refactor(watchedfiles): rename registeredItems => items

Problem:
The name `registeredItems` implies there is some other kind of "item",
which is confusing and noisy, and unnecessarily verbose.

Solution:
Rename to `items`.

* codewhisperer: reduce token infilling suggestions (#3944)

* refactor(redshift): logging and output messages #3943

Problem:
There are similar logging and output message in node explorer. Refactoring code to centralize logging and message output makes it easy for maintenance.

Solution:
Create message functions and add them in utils.

* feat(lambda): increase timeout to 5 minutes #3954

* fix(sam): "Invalid (or missing) template file"

Problem:
SAM debug may fail to find template.yaml even if it is explicitly given
by `invokeTarget.templatePath` in the vscode launch config. #2614

Solution:
- Always call addItem() in validate(), instead of depending on the
  workspace-wide "scan".
- Log a message when process() fails to process the file contents.

* fix(sam): "Add SAM Debug Configuration" does nothing

Problem:
"AWS: Add SAM Debug Configuration" only works the first time it is
invoked. regression from 89b8a94

Solution:
Move samDebugConfigCmd() out of the if-condition.

* changelog #3957

* cloud9: skip "!isWeb" check #3956

Problem:
Cloud9 sets `isWeb` even though it has "compute".

Solution:
Add an explicit condition for Cloud9 wherever we check `isWeb`.

ref d2f03d5

* feat(codewhisperer): select customization by prefix (#3947)

Problem:
The `aws.codeWhisperer.connect` command was introduced to allow enterprises
to establish a default customization for onboarding developers after
establishing an IdC connection.

However, it only selected with a given ARN. Given the current behavior
for adding updated customization for CodeWhisperer, an enterprise would
need to keep the ARN up-to-date as well when calling this command.

Solution:
Provide the ability to define the customization to select with a
prefix for the customization name. This way the logic to select a
customization as updated customizations are introduced can be simplified
on the administrator side by maintaining a prefix.
e.g. MyModel-v1, MyModel-v2, etc.

Co-authored-by: Will Lovo <wlovo@amazon.com>

* perf(startup): avoid templateRegistry in awsFiletypes.ts #3962

Problem:
The AWS Documents handler (`awsFiletypes.ts`) is triggered frequently.
It calls `globals.templateRegistry` which triggers an expensive
"Scanning CloudFormation templates..." process. #3510

Solution:
Extract the validation logic out of `CloudFormationTemplateRegistry.process()`
so that `awsFiletypes.ts` can use it without requesting the full registry.

* Release 1.96.0

* Update version to snapshot version: 1.97.0-SNAPSHOT

* feat: sm ide #3837

Problem:
New SM VSCode IDE with IAM role, we want to use the IAM role for Code Whisperer
auth. Currently Code Whisperer auth used Builder ID/SSO/Cloud9(IAM). Current IAM
auth is for Cloud9 IDE and does not allow for paginated results.

Solution:
Add new IDE type for SM VSCode that can be used for this feature and future
modifications. Use the new IDE type for conditional on connection type to use,
defaulting to IAM. Use IAM for Code Whisperer and make sure we use the correct,
`generateRecommendations`, endpoint to allow for auth with IAM and paginated
results.

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: aws-toolkit-automation <>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Tai Lai <ctlai95@gmail.com>

* fix(codewhisperer): load hover images from dist folder (#3964)

* fix(codewhisperer): load hover images from dist folder

* fix tests

* codewhisperer: emit issues with fixes count #3972

* feat(codewhisperer): apply security fix command (#3918)

* Added apply security fix command
* Added diff package to apply patch
* added functionality to apply patch and update the file.
* Wrote tests

* feat(codewhisperer): code action to open webview (#3973)

* feat(CodeWhisperer): add apply security fix command for quick fix and apply fix button in WebView (#3981)

* add apply security fix command for quick fix and apply fix button in webview

* updated text and action type for view details

* codewhisperer: downgrade telemetry package (#4006)

* codewhisperer: telemetry metrics apply fix (#4007)

* codewhisperer: add metrics for apply fix

* fix tests

* move source values to component

* use different component values for tests

* revert move source values to component

* feat(codewhisperer): add file path in webview (#4011)

* added file path field in details to navigate back to the vulnerable line

* fixed css for value of fixed available

* codewhisperer: telemetry to use component metadata type (#4015)

* codewhisperer: move images to resource folder (#4021)

Severity svg images are not loading properly as icons, so creating a new folder `resources/images` instead

* codewhisperer: open file in view column one (#4028)

* codewhisperer: open file in view column one

* return thenable

* remove auto formatting

* remove auto formatting

* remove auto formatting

* remove auto formatting

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Manthan <manthanpatel.mj@gmail.com>

* CW: Adding languages to runtimeLanguageSet for Telemetry in Security Scans (#1272)

* Changes in Telemetry

* type check chnage

---------

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* Merging staging to feature/codewhisperer/asssited-coderemediation branch (#1305)

perf(codewhisperer): connection reuse for generationCompletions #4040

Problem:
[microsoft/vscode#173861](microsoft/vscode#173861)

Solution:
Inject http agent only for the GenerateCompletions API, do this per IDE session.

Tested and verified:
1. This inject won't happen for any other API calls. It only applies to
   GenerateCompletions API when user is NOT using `http.proxy` vscode feature.
2. No regression found with Toolkit features or CodeWhisperer features.
3. Regardless of user VSC proxy setting `http.proxySupport`, it still enables HTTP connection reuse.
4. Tested in AWS Cloud9.

Co-authored-by: Lei Gao <97199248+leigaol@users.noreply.github.com>

* fix(codewhisperer): hide acr description if empty

Problem:
Backend is returning empty string or `Suggested remediation:` for some remediation description, which causes incomplete sections in the UI.

Solution:
Handle this case by hiding "Why are we recommending this?" section if description is missing/incomplete.

* CW: Adding selected JSON File into zip for the Security Scan

Problem
Zip file for security scan does not contain selected file.

Solution
Fixed this in this PR.

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* CW: Terraform is supported using other ext extensions (#1380)

* CW: Terraform is supported using other ext extensions

* CW: ADD test cases

---------

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* codewhisperer: update styles for hover and webview (#1384)

* codewhisperer: update styles for hover and webview

* update padding

* hide no newline indicator

* Iac language expansion for VSCode (#1352)

* Changes to add new languages json, yaml and tf.

* hds

* sdch

* changes for adding new languages json, yaml and tf

* changing endpoint to gamma IAD

* revisions for Iac Language Support for Json, Yaml and Tf along with added Unit Test

* correction for endpoint and added comments for language Ids

* corrections for unit tests to add plaintext

* updating telemetry for languages

* fix build failure

* fix pkg

* Add change log for security scan new language support (#1418)

Change log

Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>

* codewhisperer: update code diff styles (#1407)

* codewhisperer: update code diff styles

* add change log

* remove extra release notes

---------

Signed-off-by: nkomonen <nkomonen@amazon.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
Co-authored-by: aws-toolkit-automation <43144436+aws-toolkit-automation@users.noreply.github.com>
Co-authored-by: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com>
Co-authored-by: Laxman Reddy <141967714+LaxmanReddyAileni@users.noreply.github.com>
Co-authored-by: Tai Lai <ctlai95@gmail.com>
Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
Co-authored-by: Will Lo <96078566+Will-ShaoHua@users.noreply.github.com>
Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
Co-authored-by: Bryce Ito <bryceito@amazon.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yi-jin-0 <141669322+yi-jin-0@users.noreply.github.com>
Co-authored-by: Zoe Lin <60411978+zixlin7@users.noreply.github.com>
Co-authored-by: Santiago Martin <143631912+sannicm@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@users.noreply.github.com>
Co-authored-by: Will Lovo <wlovo@amazon.com>
Co-authored-by: Jed A <103950110+JedML@users.noreply.github.com>
Co-authored-by: Manthan <manthanpatel.mj@gmail.com>
Co-authored-by: Tai Lai <tlaiamz@amazon.com>
Co-authored-by: invictus <149003065+ashishrp-aws@users.noreply.github.com>
@justinmk3
Copy link
Contributor

justinmk3 commented Dec 14, 2023

Currently it will still trigger if you open a SAM template.yaml file, even if the aws.samcli.enableCodeLenses is set to false.

In AWS Toolkit 2.3.0, aws.samcli.enableCodeLenses now also controls whether codelenses are enabled in template.yaml files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug We can reproduce the issue and confirmed it is a bug. pending-release performance service:cloudformation
Projects
None yet
Development

No branches or pull requests

8 participants