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 118 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 <davhasan@amazon.com>
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.
Fixes: #4658

Signed-off-by: Nikolas Komonen <nkomonen@amazon.com>
* 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 <118216176+nkomonen-amazon@users.noreply.github.com>

---------

Co-authored-by: Nikolas Komonen <118216176+nkomonen-amazon@users.noreply.github.com>
* 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 <nkomonen@amazon.com>
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 <nkomonen@amazon.com>
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 <jmkeyes@amazon.com>

---------

Co-authored-by: Justin M. Keyes <jmkeyes@amazon.com>
aws-toolkit-automation and others added 30 commits May 21, 2024 18:09
#5025)

Problem: Some telemetry (auth_addConnection) is using a 'region' field instead of the built in 'awsRegion' field. This provides misleading results in telemetry, since 'awsRegion' is guessed based on toolkit usage.

Solution: Remove 'region' field and just use 'awsRegion'. Also, updating the 'awsRegion' guess function to account for amazon Q.

- Remove checking tree nodes from the region guess function, since it was unused functionality.
- If a region can't be determined, return undefined. It is up to the caller to define the default instead now.
* Chore - refactor Amazon Q Transform service utils

* Chore - rename files
- add file handler
- rename root service folder

* Chore - resolve refactor import issues

* Chore - fix upstream merge conflicts

* Chore - add updated import path

* Chore - move remaining API steps to apiHandler file

* Chore - revert startTransformByQ refactor

* chore - revert stopTransformByQ fnc location

* chore - Add direct import for model.TransformationCandidateProject statements

* Chore - push test to see CI results

* Chore - make lowercase"

* Chore - use fsPath instead

* Chore - us fsPath instead of path for humanInTheLoopManager class

* Chore - remove file from downstream fork

---------

Co-authored-by: Nick Ardecky <nardeck@amazon.com>
* feat(IamPolicyChecks): remove from Experiments and enabling by default, update error messages, fix bugs

* Create helper function for error message handling

* Create helper function for error message handling
Co-authored-by: Leonardo Araneda Freccero <araneda@amazon.com>
Problem:
Release fails because OVSX_PAT is not available.

Solution:
Temporarily disable this check, to unblock the release.
…5033

Problem:
SessionId remains the same for different transformation jobs while it should
reset for different transformation jobs.

Solution:
Call the preExisting `setSessionId()` which recalculates the hash before the
introduction for Q Code Transform is written to chat. (this method was never
called before, or its invocations must have been mistakenly removed)
Problem:
The codecatalyst commands:

    "Open Dev Environment"
    "Clone Repository"

fail if their menu forms are used AFTER the treenode forms.

Steps to reproduce:
1. click the "Open Dev Environment" tree node in the codecatalyst panel.
2. close the wizard.
3. in the codecatalyst panel, expand the "..." root menu and choose "Open CodeCatalyst Dev Environment"
4. it fails because the TreeNode from step (1) is passed as the first arg, which breaks `openDevEnv()`.

Solution:
Follow the instructions from the `VsCodeCommandArg` docstring:
https://github.com/aws/aws-toolkit-vscode/blob/4decdf6341a38c58db0e9f778ba57b5514434b0b/packages/core/src/shared/vscode/commands2.ts#L23-L41

TODO:
Note that the bug does NOT occur if you use the "..." menu command
FIRST. It seems like the TreeNode is stored as state on the
`CommandResource`; is that actually necessary?
Problem
Update font-sizes in Login Page for AWS Toolkits and Amazon Q

Solution
- Use CSS Variables
- Initially used `rem` though now using `var(--vscode-font-size)` for base font size. This way the extension's base font will be as set by user for their VSCode
- fixed colors for dark and light theme
Problem:
After updating to @typescript-eslint/parser 7.x, importing '@typescript-eslint/types/dist/generated/ast-spec' fails:

    lib/rules/no-await-on-vscode-msg.ts(15,34): error TS2307: Cannot find module '@typescript-eslint/types/dist/generated/ast-spec' or its corresponding type declarations.
    lib/rules/no-await-on-vscode-msg.ts(40,13): error TS2322: Type '"error"' is not assignable to type 'RuleRecommendation | RuleRecommendationAcrossConfigs<never[]> | undefined'.
    lib/rules/no-only-in-tests.ts(13,62): error TS2307: Cannot find module '@typescript-eslint/types/dist/generated/ast-spec' or its corresponding type declarations.
    lib/rules/no-only-in-tests.ts(32,13): error TS2322: Type '"error"' is not assignable to type 'RuleRecommendation | RuleRecommendationAcrossConfigs<never[]> | undefined'.
    lib/rules/no-only-in-tests.ts(60,25): error TS2322: Type '`${any}OnlyErrMsg`' is not assignable to type '"describeOnlyErrMsg" | "itOnlyErrMsg"'.

Solution:
Import from '@typescript-eslint/utils' instead.
Anything that is still used was moved to src/login.
* fix(amazonq): increase fuzz factor for diff patch

* fix tests
Problem
Content in Login Page gets clipped with width is decreased beyond min width and only partial content is visible.

Solution
Update margin to auto for auth container.
Problem:
When `sam local` is invoked for `cSharp`, the invocation gets blocked when
trying to attach a debugger. `vsdbg` is not supported for `arm64` architecture. 

Solution:
Disable `debug` mode for cases when the template architecture is `arm64` or the
developer is using `arm64` architecture machines, for eg - Apple M1/M2/M3 chips.
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