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-dev-execution #5987

Merged
merged 122 commits into from
Dec 3, 2024

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

## Problem
For the current /dev experience for code review, user needs to review
the entire file list of generated code, reject the changes they do not
want, and then accept the remaining changes in bulk at the end.

This PR introduces improvements in user experience around the code
review experience in which user can now review the file changes and
accept them one at a time. User can start editing the file right away
after accepting the changes without having to go through the entire
generated file list.

## Solution
- introduces a new action button for accepting file change for each
change suggested on the file list
- accepted changes are now highlighted in green
- when accepting changes in bulk, the file list is updated to reflect
the status if a change is rejected or accepted
- minor text changes / improvements
## Problem
The overall supplemental context has a timeout of 50ms, each sub promise
has a timeout of 50ms. Problem is these 2 timeout are very tight,
leaving no buffer time for node js runtime to do context switch. The
poll interval of each sub promise is 10ms, which does not precisely
timeout at 50ms.

## Solution
Add a 10ms buffer time for supplemental context.
Reduce poll duration
@aws-toolkit-automation aws-toolkit-automation requested a review from a team as a code owner November 12, 2024 23:01
leigaol and others added 25 commits November 12, 2024 17:42


## Problem
The chat workspace context requires user to manually input `@workspace`
in the chat window, but when user do not have such prompt, workspace
context can still be useful, we want to always send the relevant
document and let service decide when to utilize it.

## Solution

Enable implicit `@workspace` context for Amzn users. For these users, if
they do not have `@workspace` in the chat prompt, the
relevantTextDocument is still added to the chat API. This will be AB
tested

Also remove the outdated data collection experiment.
- Add types to some RuleContext fields
- Add some informative log statements for debugging
- Add a test for getRuleContext()
- Add case-insenstive rule checks
- Fix getRuleContext to properly capture authTypes
- Remove a few unneeded lines of code
- Add red icon for emergency notifications

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…g files #5990

## Problem
within inline suggestion code path, `isLanguageSupported()` relies on
`vscode.editor.document.langaugeId` to determine whether the given
language is supported Q inline suggestion functionality. However, it's
possible that some languages are not recognized by VSCode IDE itself
without 3rd party extensions, for example: VSCode doesn't recognize
`.sv`, `svh`, `vh` files which is bound to SystemVerilog language if
users do not have the 3rd party extension installed and enabled, in this
case, `vscode.editor.document.languageId` will simply return
`plaintext`.

This is the root cause why autotrigger doesn't work for systemverilog
files, because at the beginning, we don't even register keyStrokeHandler
for files with `.sv`, `svh`, `vh` files.

## Solution
if language check return false, we should also check file extension
## Problem
Need some more metrics emitted to capture lines of code submitted, lines
of code changed, and characters of code changed.

## Solution
Emit said metrics after parsing them from the download ZIP.
## Problem
fix #6000 
Fix flaky test here 
https://github.com/aws/aws-toolkit-vscode/actions/runs/11822049864/job/32938204047?pr=5988


## Solution
The flaky issue happens when the file failed to be created before test run
move file preparation step into `beforeEach` so it will be more reliable.
## Problem
Deeply nested objects fail to show up in the logger due to use of `%O`
instead of `JSON.stringify`. Some customers use this information for
debugging or other purposes.
Ex. 
``` 
2024-11-12 13:23:39.682 [info] request from tab: tab-1 conversationID: 619df9a2-3ab2-4676-9896-9eb608d80582 request: {
  conversationState: {
    currentMessage: { userInputMessage: [Object] },
    chatTriggerType: 'MANUAL',
    customizationArn: undefined
  }
}
```

## Solution
- Change codewhisper chat request/response log messages (which are very
deeply nested) back to `JSON.stringify`.
## Problem

Static start urls are scattered

## Solution

Move them to the auth constants file

## Additional

Created a file for datetime related code. It includes static values
which represent certain amounts of time in milliseconds.
Future work will use this.

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

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

Known scenario where a new icon is added in Q but not synced to Toolkit.
Due to not being synced, whenever Toolkit is built during development
the package.json is updated.

## Solution:

Do the sync and merge the change

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

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

## Solution
The check for executeCommand is not important to these tests, and can be
removed.

fix #5996
Unit testing for notifications rendering

Using locally generated notifications, test covers:

- new notification on-receive modal/toast windows
- panel on-click txt/url pop up
- modal button actions (update&restart, txt, url)
## Problem
`getLogger('foo')` returns a global singleton, so the "current topic"
only is stored until the next `getLogger` call.

## Solution
Modify `getLogger('foo')` to return a wrapper which stores its topic.
This allows modules to declare their own module-local shared logger:

    const logger = getLogger('foo')
…ial in launch config #6011

## Problem
Appbuilder added `--region` parameter to `sam local invoke`, however
this region is always reading region prop from default toolkit
connection. Ignoring region set in sam debug config.

## Solution
region and credential set in sam debug config should override region and
credential in current active toolkit connection.
## Problem
retry message without problem statement

## Solution
Move latestMessage setter call outside of session in controller as it
interrupts with retryMessage functionality
## Problem
I was working on a CDK project, and after synthesizing my CDK template,
I noticed that the app-builder is showing a misleading notification to
customers: No IaC templates found in the workspace. This seems
incorrect, as I do have IaC templates in the workspace, including both
raw and synthesized CDK templates.

While I understand the intention behind the message, it needs to be more
precise to avoid confusion. I suggest we roll it back to something more
accurate, like No SAM templates found in the workspace, to clearly
indicate the specific missing template type.

## Solution
Solution is to change all instance where IAC is mentioned to the
customer to SAM, we would roll back to IaC once we start support CDK.

Remove redundant Logic.
## Problem
update inline suggestion project context ab test config

#### CONTROL
- use bm25 opentabs context 

#### TREATMENT_1
- use repomap + bm25 open tabs context 

#### TREATMENT_2
- use bm25 global project context
…er` (#6013)

Depends on aws/aws-toolkit-common#914

## Problem

On the condition of:

- SSO session is BuilderID or Internal Amazon IdC
- Subsequent login for same SSO session happened earlier than 90 days
(the expected session expiration)

We need to know on the client side to be able to report this information
so that CloudWatch alarms can consume this.

## Solution

By adding the existing sessionDuration field, which is `currentTime -
whenThePreviousSessionWasCreated`, to `aws_loginWithBrowser` we will
have all the information we need to alarm on.


---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Signed-off-by: nkomonen-amazon <[email protected]>
…ing (#5980)

## Problem

Follow up PR from #5853 

## Solution

Added more unit test coverage
## Problem
#5994 is causing CI test failure
misuse of `sinon.alwaysReturned()`

## Solution
should use `sinon.returns()`

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Problem:
Log messages have literal format strings such as "%s", even though
values were passed to the log function:

    2024-11-14 11:00:33.778 [info] CloudFormationTemplateRegistry: processed … %s
    2024-11-14 11:00:34.634 [debug] schema service: handle … -> %s

Solution:
Regression introduced by `TopicLogger`. Fix the call.
We have both ActiveExtensions (checks what extensions are installed and active), and InstalledExtensions (just what extensions are installed).
This removes InstalledExtensions because most of the intention behind it is captured by ActiveExtensions. When would we only care about whats installed but not active?

Removing a criteria decreases complexity and confusion in both code and for those drafting notifications, so this is an easy removal.
nkomonen-amazon and others added 27 commits November 22, 2024 22:58
Use the topic logger, removing the old prefixes since the topic is
automatically prepended


---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Signed-off-by: nkomonen-amazon <[email protected]>
…d confirmed string changes (#6084)

## Problem
Selective transformation changes were released under an IDE feature flag
due to backend changes that needed to be fixed.

## Solution
In this PR, we are removing the feature flag on the IDE side so the
users will now be able to see the form to select if they want to view
their changes in one or multiple diffs. If they select multiple diffs in
this form, then selective transformation will be invoked.

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…6102)

## Problem
- workspace is no longer beta

## Solution
- remove beta indiciators
## Problem
`Dockerfile` files are not currently supported by /dev

## Solution
Add a list of file prefixes that are considered code files for /dev.
This approach supports not only `Dockerfile` but also popular variants
of this such as `Dockerfile.build`, `Dockerfile-prod`, etc.

I manually tested some prompts in /dev with requests. I set breakpoints
to see that the file was being zipped up in workspace upload.
## Problem
We close source gate during the start of a release to prevent unwanted
commits coming in, but we have to remember to manually open it again.

We want to automatically re-open the source gate after a release is
triggered.

This PR creates the buildSpec file to be used by codeBuild project in
our release pipeline to open the source transition.

Related infra CR:
https://code.amazon.com/reviews/CR-162245234/revisions/1#/diff

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…and miss Q sendTelemetryEvent (#6106)

## Problem
same purpose as #6053 to fix telemetry sending for empty suggestion case

```
there are 2 scenarios where we consider "Empty"
1. empty list of suggestion : `[]`
2. non empty list of suggestion with empty content: `['', '']`

Currently, only (2) will have plugins send out `userTriggerDecision` event whereas (1) doesn't.

```
But #6053 only fixed Toolkit telemetry and missed Q sendTelemetryEvent
API

## Solution
…users (#6098)

## Problem
enable implicit workspace ab test for broader groups of users but not
only internal users

## Solution
remove isInternalUser predicate
…elected (#6089)

## Problem
When --watch flag is used, the sync process remains alive. The region
and stack_name info get written to config file only after the process
finishes. This means customer would not be able to see (or refresh) the
latest deployed resoures during the sync process.

## Solution
Write to samconfig.toml before running sam sync

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem

When a build error occurs, the error details are correctly shown under
the "Terminal" tab. However, the toast notification says "build failed"
with a button to "See logs." Clicking this button incorrectly redirects
the user to the "Output" tab, which only shows a generic message (Error:
sam build exited with a non-zero exit code: 1 [NonZeroExitCode]),
instead of the detailed logs from the "Terminal" tab. This creates
confusion and makes troubleshooting more difficult.

## Solution
Redirect view logs action to open the terminal instead of output channel

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
- Add a generic dev menu item to reset the state of a feature. Simply
extend with a function handler to add an item to the menu. The initial
item resets in-ide notification state.

![image](https://github.com/user-attachments/assets/042bdad2-2bac-4694-a7ff-801a857bddd3)

![image](https://github.com/user-attachments/assets/43fa90aa-af58-4b6f-af0d-ca38fb01f5b7)

- Add a way to test notifications locally without modifying code. Using
a dev menu item you can add a notification to global state and receive
it in your IDE for visualization.

![image](https://github.com/user-attachments/assets/2a0f267c-e792-4535-a1a4-170f8f6f32ca)

![image](https://github.com/user-attachments/assets/dd08402c-c4db-422c-9b60-20cd4f9340a2)

- Refactor notifications controller to not require a RuleEngine when
polling is requested.

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem


## Solution
Disable the task for now. 


---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Problem:
unreliable test "zipCode performance".

Solution:
increase cpu threshold for performance test to avoid flakiness
fix #6117
re-invent 2024 release

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Co-authored-by: Ashish Reddy Podduturi <[email protected]>
Co-authored-by: Avi Alpert <[email protected]>
Co-authored-by: Blake Lazarine <[email protected]>
Co-authored-by: Bodie Weedop <[email protected]>
Co-authored-by: Chay Nabors <[email protected]>
Co-authored-by: Grant Gurvis <[email protected]>
Co-authored-by: Hweinstock <[email protected]>
Co-authored-by: Justin M. Keyes <[email protected]>
Co-authored-by: KevinDing1 <[email protected]>
Co-authored-by: Laxman Reddy <[email protected]>
Co-authored-by: Matt Lee <[email protected]>
Co-authored-by: Maxim Hayes <[email protected]>
Co-authored-by: Nikolas Komonen <[email protected]>
Co-authored-by: Tai Lai <[email protected]>
Co-authored-by: Vikash Agrawal <[email protected]>
Co-authored-by: Zoe Lin <[email protected]>
Co-authored-by: juusticeTG <[email protected]>
## Problem
/docs should be /doc

## Solution
fix it

---

<!--- REMINDER: Ensure that your PR meets the guidelines in
CONTRIBUTING.md -->

License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
Ignore pattern that is only needed on the vscode minimum version of 1.68,
but we have bumped to 1.83.0.

## Solution
Remove pattern for this case.
@willyyhuang willyyhuang requested a review from a team as a code owner December 3, 2024 21:39
@justinmk3 justinmk3 merged commit 927bf77 into feature/q-dev-execution Dec 3, 2024
10 of 11 checks passed
@justinmk3 justinmk3 deleted the autoMerge/feature/q-dev-execution branch December 3, 2024 21:48
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.