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/q-transform-staging #4938

Open
wants to merge 79 commits into
base: feature/q-transform-staging
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/q-transform-staging
git merge origin/master
git commit
git push origin HEAD:refs/heads/autoMerge/feature/q-transform-staging

…ooner, fix minor styling issues (#4928)

* fix(amazonq): add jobId to history tab and ensure summary/icons get saved

* update changelog

* fix failing test

* fix lint issue

* fix circular dep

* address comments

* remove unneeded await

* small fix to error notifications

---------

Co-authored-by: David Hasani <[email protected]>
aws-toolkit-automation and others added 26 commits May 6, 2024 23:08
Problem:
Node v20.12.2 has introduced an issue with spawnSync (execFileSync) on Windows:
nodejs/node#52554

```
> ts-node ./scripts/build/handlePackageJson

<ref *1> Error: spawnSync vsce ENOENT
    at Object.spawnSync (node:internal/child_process:1124:20)
    at spawnSync (node:child_process:876:24)
    at Object.execFileSync (node:child_process:919:15)
    at main (C:\Users\rbbarad\Desktop\vscode-toolkit\aws-toolkit-vscode-staging\scripts\package.ts:156:23)
    at Object.<anonymous> (C:\Users\rbbarad\Desktop\vscode-toolkit\aws-toolkit-vscode-staging\scripts\package.ts:181:1)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module.m._compile (C:\Users\rbbarad\Desktop\vscode-toolkit\aws-toolkit-vscode-staging\node_modules\ts-node\src\index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Object.require.extensions.<computed> [as .ts] (C:\Users\rbbarad\Desktop\vscode-toolkit\aws-toolkit-vscode-staging\node_modules\ts-node\src\index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1206:32) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawnSync vsce',
  path: 'vsce',
  spawnargs: [ 'package', '--ignoreFile', '../.vscodeignore.packages' ],
  error: [Circular *1],
  status: null,
  signal: null,
  output: null,
  pid: 0,
  stdout: null,
  stderr: null
}
```

Solution:
Set the "shell" flag when on Windows OS. This is because `vsce` is a `.cmd` file
which needs a shell to run.

Testing:
- Ran `npm install`, `npm run compile`, `npm run package` locally. confirmed packaging was successful

Related:
- aws/aws-toolkit-azure-devops#552
- nodejs/node#52554
Problem
Security scans don't work for multi-root workspaces.

Solution
- Gather all open workspace folders for security scan payload instead of from the active file
- Since we no longer require the active file, remove the requirement of having a file open to run scans
Problem
Add Help link in Login Page.

Solution
- Introducing BEM naming convention for classes/CSS - https://getbem.com/.
- Use ? for icon.
- Record Telemetry data when a user clicks the help link.
Problem
`collectFiles` method uses a different max payload size value than security scans.

Solution
- Pass the desired max value to `collectFiles`
- Use 500MB as the max size
Problem
Q chat may hang when processing fragments of ts/js code. The
Tsx.findNames and Tsx.findNamesWithInExtent functions hang (Promise does
not resolve). These functions invoke WASM/rust code.

- #4935
- #4810

Solution
Remove uses of Tsx.findNames and Tsx.findNamesWithInExtent.

The fully qualified names (FQN) library is used to help service build
prompts with variable names in user's IDE to reduce hallucinations, but
they are not required for normal functionality.
* feate(amazonq): only display open chat codelens if authenticated

* fix tests

* use sync method to fix tests

* Update packages/core/src/test/codewhispererChat/editor/codelens.test.ts

Co-authored-by: Nikolas Komonen <[email protected]>

---------

Co-authored-by: Nikolas Komonen <[email protected]>
* Revert "fix(amazonq): update cross file context config #4922"

This reverts commit e6d9b50.

* revert cross file config change
Problem:

With the recent addition for the null extension fix in debug mode,
we ran the hack during actual packaging of the AWS Toolkit extension.
This hack caused the vsix to not work

Solution:

Only run the hack during development. We did this by
adding a flag to the handlePackageJson script to do
the hack if the '--development' flag is given.

Signed-off-by: Nikolas Komonen <[email protected]>
Amazon Q is not fully working in web, but this gets
the Debug setup working so we can start developing

Signed-off-by: Nikolas Komonen <[email protected]>
Problem:
Icons are not displayed on for existing connections.

Solution:
Use type to render icons
* feat(auth): navigate login page with keyboard

- Use tab/shift+tab to navigate the login.
- Press enter on start url field to shortcut continue (if the form is valid).
- Press enter on any of the IAM credential fields to continue (if the form is valid).
- Autofocus the start url field.
- Autofocus IAM profile name field.

* add support for focus/enter on IAM creds

* changelog items
Problem:
Messages get lost in the code path where customers do not need to provide a JAVA_HOME.
This leads to missing chat bubbles for:
1. "Building your project"
2. "I was able to build your project"
3. "I am starting to transform your code"

Solution:
Issue was due to typo when translating  `tabId` to `tabID`.
Search in the code shows that `tabID` is 10x more common than `tabId` so aligning Q Code Transform to this format.
After aligning the usages the missing messages are shown again and are animated where required.
* fix(feedback): rename last CodeWhisperer strings to Amazon Q

* Update packages/core/src/feedback/vue/submitFeedback.vue

Co-authored-by: Justin M. Keyes <[email protected]>

---------

Co-authored-by: Justin M. Keyes <[email protected]>
hayemaxi and others added 30 commits May 15, 2024 08:04
This function does not accept a 4th arg, but somehow the previous
PR did not fail CI.

Signed-off-by: Nikolas Komonen <[email protected]>
Problem:

It is common for want to view/modify the Auth Profile store.
The Profile Store is our source of truth for auth connections that
the extension is aware of and using.
We sometimes want to read and modify this source of truth for debugging
purposes.

The issue is that this option is hard to find since you need to dig through
multiple menus. Also once you get to it, the content you see will become stale
if it every changes.

Solution:

- Add a new item to our Developer Menu to open the auth profile store editor.
- Fix issue where the text document editor was not refreshing with the latest changes.

Signed-off-by: Nikolas Komonen <[email protected]>
* fix(amazonq): move view details and explain to quickfix

* add changelog
Problem:

When a Dev Env is spun up, the AWS Toolkit extension automatically creates
an SSO profile in the Dev Env using the the sso session metadata in the ~/.aws/config file.

In the scenario the ~/.aws/config file contained the session for a non-builder id session
the SSO profile created would be incorrect due to the startUrl and Region being reversed
with eachother when the SSO profile was created.

This led to an invalid SSO profile, so any attempts to reauthenticate would fail.

Solution:

correctly create the SSO profile.

Signed-off-by: Nikolas Komonen <[email protected]>
Amazon Q Transform Bugfixes
- Chore - fix spelling error
- Bugfix - uploadId overwriting jobId causing issues calling getTransformation
- Bugfix - fix Human in the loop chat messages
* fix: add more logs to Dev Env heartbeat

We want more logs to help determine if the dev env
heartbeat is working as expected

Signed-off-by: Nikolas Komonen <[email protected]>

* refactor: fix circular dependency

The command that shows the login vue was having circular
dependency issues.

This moves that logic in to its own file to fix this.

Signed-off-by: Nikolas Komonen <[email protected]>

* devEnv: try start activity heartbeat on connection change

Problem:

We only tried to start the activity heartbeat on extension startup. So if
that failed due to something like an invalid connection, the heartbeat mechanism
would not start

Solution:

Try and start the heartbeat mechanism when the CC connection changes as well.
But if it is already running then we just skip it.

Signed-off-by: Nikolas Komonen <[email protected]>

---------

Signed-off-by: Nikolas Komonen <[email protected]>
* fix(amazonq): avoid apply fix if already applied

* fix tests
Amazon Q Code Transform: Improve UploadZip logging
* Updated Q feature dev name

* added changelog

* Revert "added changelog"

This reverts commit 9439145.
* fix(auth): enforce 5 scopes when reauthing amazon q

Problem: Users can keep an old 3 scope connection if they continue to reauth with the notification once auth expires.

Solution: Any call to the amazon q's reauth function enforces 5 scopes, which will fix the reauth notification.

- Does NOT update the case where user reauths an amazon q connection via toolkit quickpick. That is more difficult.

* update tests
Problem: Clicking anything other than 'open' in the VSC redirect url modal for the auth page would result in cancelling the auth attempt.

Solution: Do not expect a specific response from the url modal. Allow the auth flow to continue even if the user hits 'Cancel' or 'Copy'. To cancel the auth flow, the user should click 'Cancel' in the login ui OR leave the login ui.
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.

None yet