Skip to content

Conversation

@witness-me
Copy link
Contributor

@witness-me witness-me commented Feb 18, 2025

Problem

Auto-merge is failing due to merge conflict

Solution

Resolving the conflict and merging master into feature/stepfunctions-workflow branch, also fixed several lint issues


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

hayemaxi and others added 30 commits February 6, 2025 13:36
I could not find a lint rule (or a configuration of a lint rule) to achieve this, so I just made one. I tried some things from eslint-plugin-import (namely no-cycles), but I was not happy with the results.

This will prevent you from importing from index.ts files while working in packages/core/, which has been a source of annoying and hard to understand circular dependency issues.

It only affects imports in core, and only in src/ dirctories that do not start with test/
ci(lint): rule to detect index.ts imports in core
…lemetry (aws#6521)

## Problem
We are mistakenly counting several client-side failures as service
faults, which is affecting our availability metrics.

## Solution
Exclude frequent client errors from faults, they should be errors.

there are multiple layers of errors, some of those are categorized to
toolkit level errors, for example this part:
```
case MonthlyConversationLimitError.name:
case CodeIterationLimitError.name:
case PromptRefusalException.name:
case NoChangeRequiredException.name:
```
Others are defaulting to ToolkitError with messages.

Ideally we should add more error models to toolkit, but for now to make
a quick fix, I just looked into the error msg, similar to what we do
here:
https://github.com/aws/aws-toolkit-vscode/blob/02d21a2fafc7479fb398ea078aa3e3adf7c62e7a/packages/core/src/amazonqFeatureDev/client/featureDev.ts#L198



---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Yuxin Lin <[email protected]>
## Problem

This is aimed to resolve
[jscpd](https://github.com/aws/aws-toolkit-vscode/actions/runs/12778633640/job/35621822359?pr=6370)

## Solution

Refactor SessionState in doc and featureDev

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Avi Alpert <[email protected]>
…s#6549)

## Problem
- If user tries to run `/test` on the test file, Q considers test file
as source file and starts the test generation on the test file.

## Solution
- If user tries to run `/test` on the test file, Q infers the context
from the original source file and generate tests accordingly.
- No change in functionality, minor change in UX filename.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
… remove debugging. (aws#6548)

## Problem
Alternative solution to
aws#6541

## Solution
- debounce very aggressively (once per day).
- remove debugging `function_call`. 

## Notes 
debounce ignores args, so regardless of the telemetry metadata, it will
only be emitted once per day. That is, regardless of the value of
`credentialsSourceId`, it is emitted once per day.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
- If user gives user input prompt more than 4096 characters, this fails
at RTS as model supports only 4096 input characters.
`Value at 'userInput' failed to satisfy constraint: Member must have
length less than or equal to 4096`
- Ideally we should not get more than 4096 char input from user input
but still features like `/test`, `/dev` were able to get the message
length more than 4096.

## Solution
- To resolve this issue, we are adding a truncation logic to continue
the test generation workflow instead of failing at RTS.
- No new tests were added as the functionality is not impacted.
)

## Problem:

In our development build we spawn a webpack server that serves the Vue
files used by our webviews. It is served on port 8080, but sometimes an
existing process is already using it, and this causes the webpack server
to use the next available port. But because we assume it will use 8080
it silently breaks, and when developing the Q webview would not load as
expected.

## Solution:

Explicitly require 8080 in the webpack server cli command, also create a
custom script to catch the error early and explain how to resolve it.

Now in the build tasks if 8080 is in use the dev can see the failed task
with the solution explicitly stated.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

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

After entering JDK path, chat is sometimes frozen until the local build
completes.


## Solution

Pause after user enters JDK path, to give chat time to update before
starting the local build.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Co-authored-by: David Hasani <[email protected]>
## Problem

https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/src/codewhisperer/util/customizationUtil.ts#L116-L130

The flaw of previous implementation won't override customization if
users have selected one.

The team is asking 
1. Ability to override regardless users are with a customization or not
2. Should respect users' selection afterward when users switch back to
the customization they prefer
3. When ab service provides a new override customization arn, plugins
should be able to do override again

```
// as long as there is a customization selected, override will not happen no matter what
 if (selectedCustomization && selectedCustomization.name !== '') {
        return selectedCustomization
    } else {
        const customizationFeature = FeatureConfigProvider.getFeature(Features.customizationArnOverride)
        const arnOverride = customizationFeature?.value.stringValue
        const customizationOverrideName = customizationFeature?.variation
        if (arnOverride === undefined) {
            return baseCustomization
        } else {
            return {
                arn: arnOverride,
                name: customizationOverrideName,
                description: baseCustomization.description,
            }
        }

```

## Solution
1. Persist a value of "previous override arn" and do override when the
provided customization arn is different than "previous override arn"



---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…ws#6560)

## Problem
- /test and /review are missing thumbs up/down telemetry
- /test is missing feedback functionality

<img width="545" alt="Screenshot 2025-02-11 at 1 58 42 PM"
src="https://github.com/user-attachments/assets/11a46136-46a6-4d35-a7e1-e92f45b1034a"
/>
<img width="558" alt="Screenshot 2025-02-11 at 1 58 48 PM"
src="https://github.com/user-attachments/assets/80288c37-a98c-4e8f-9e32-810238ee2695"
/>


## Solution
- send telemetry event for thumps up/down for /test and /review
- send user feedback for /test which routes to SIM folder
- No tests were added as this is UX change

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
fix(amazonq): Auto-trigger review flow on scan button click
…e invoke aws#6559

Problem:
Remote Invoke call ListRemoteTestEvent every time the webview is instantiated. 

Solution:
Introduce a condition for which this api calls can be
made thereby reducing the spike in number failures we see in our
dashboard.
## Problem

Due to Java 21 support coming out, the target JDK version was no longer
hardcoded as JDK17. So for SQL conversions, the target JDK was
`undefined` and the `startJob` API was failing.


## Solution

Hardcode JDK17 as a dummy target JDK so that we don't encounter an
invalid request exception.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

Co-authored-by: David Hasani <[email protected]>
## Problem
The duplicate code detection can fail when the current branch is not
rebased with the most recent version of master. This is a fairly common
false-negative. To avoid this, the PR must be kept up to date with its
target branch. However, the tool doesn't provide any hints/indication
this is the case.

## Solution
- add a hint message on failure that suggests rebasing.
…ompletion (aws#6567)

This reverts commit 50c9121.

## Problem
In the previous change, we applied prefect to every responses. However,
this introduced issues with inline completion, causing it to behave
inconsistently and produce unexpected completions in the next response.

## Solution
To mitigate this, this PR rolls back the responses prefect change to
restore stable inline completion behavior.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
This scripts creates a report of skipped tests in the amazon q folder

## Solution
Run: `npm run skippedTestReport`

```
Skipped Tests Report
Total skipped tests: 5
Files affected: 4
===================

📁 packages/amazonq/test/e2e/amazonq/featureDev.test.ts
     Skipped tests:
      • /dev {msg} entry (line 165)
      • file-level accepts (line 220)

📁 packages/amazonq/test/e2e/amazonq/template.test.ts
     Skipped tests:
      • Amazon Q Test Template (line 16)

📁 packages/amazonq/test/e2e/amazonq/testGen.test.ts
     Skipped tests:
      • ${language} file (line 168)

📁 packages/amazonq/test/e2e/amazonq/transformByQ.test.ts
     Skipped tests:
      • Running a Java upgrade from start to finish (line 345)
```



---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
Features that depend on global state can cause test failures locally
because the tests will use your current global state settings instead of
a fake state for integ/e2e tests

## Solution
integ/e2e tests should use a fake global state instead that
automatically gets reset after each test

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
… packages. (aws#6474)

## Problem
The auth code relies on old versions of `@aws-sdk/*` that have since
been deprecated or are no longer backward compatible, making versions
bumps impossible.
- `@aws-sdk/credential-provider-imds` has since been
[deprecated](https://www.npmjs.com/package/@aws-sdk/credential-provider-imds)
- `fromIni` from `@aws-sdk/credential-provider-ini` no longer supports
passing a `loadedConfig`.
- `AssumeRoleParams` is no longer exported by
`@aws-sdk/credential-provider-ini`.

We need to be able to bump these `@aws-sdk/*` package versions to
continue to consume newer generated clients. Being pinned to older
versions is also a security risk. See
aws#6439 for more
information.

## Solution
- write custom credentials provider to replace `fromIni` with
`loadedConfig` option.
- drop dependency on `@aws-sdk/credential-provider-ini` since its no
longer used.
- add direct dependency on `@aws-sdk/credential-provider-env` since this
was installed as part of `@aws-sdk-credential-provider-ini` before.
- Fix many (not all) of the deprecation warnings in auth code related to
credentials provider.

### Custom Credentials Provider
Before, we used `fromIni` with the `loadedConfig` option which allows us
to avoid reading the config file from disk on each credentials fetch and
allows us to merge the current credentials with those found in the
`.ini` file. To achieve the same behavior without the `loadedConfig`
option, we need to write our own credentials provider that supports MFA
and role assumption, and returns the desired merged credentials, rather
than reading from disk.

### Testing
- Manually verify this role assumption works by following the steps
[here](https://docs.aws.amazon.com/sdkref/latest/guide/access-assume-role.html).
- Manually verify MFA works via adapting
[this](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-role.html#:~:text=This%20policy%20allows%20the%20user,they%20authenticate%20by%20using%20MFA.&text=Next%2C%20add%20a%20line%20to,by%20the%20role's%20trust%20policy.&text=The%20mfa_serial%20setting%20can%20take,command%20with%20this%20profile%20fails.&text=The%20second%20profile%20entry%2C%20role,%22:%20%5B%20%7B%20...).
(Used DuoMobile)
- Add unit tests with API calls stubbed. 

## Future Work
- There are two tests that can now be re-enabled because of this version
bump, undoing
aws@db27ebb
- The steps to test role assumption could become an integ/e2e test.
Right now requires setting many resources up in console, but perhaps
this can all be done by the SDKs with an account on admin access.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
jpinkney-aws and others added 14 commits February 14, 2025 12:21
)

## Problem
- after
aws@19d0346
the listener adds messages in a buffer until the ui is ready. It looks
like some messages get caught in the buffer during tests since the mynah
ui activation is slightly different there
- The waitUntil was waiting until an event evaluated to true and then
afterwords checks to see if that same event is still true. This was
causing an issue where if the event originally evaluated to true and
then instantly evaluated to false, your tests would fail

## Solution
- manually set the ui ready after we've created the mynah ui instance in
tests

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
The two streaming clients committed to the repo are generated via
different versions of `smithy-typescript-codegen`. Each version of
codegen pins the generated client to use specific versions of
`@aws-sdk/*` and `@smithy/*` packages. The root project also consumes
different versions of these packages. Therefore, the project is
currently consuming three different versions of many `@aws-sdk/*` and
`@smithy/*` packages.

This is problematic because it can cause dependency conflicts. Certain
versions of `@aws-sdk/*` and `@smithy/*` packages are only compatible
with certain other versions. For more information on this, see the
discussion involving help from an SDK team member explaining this
problem.

## Solution
- Regenerate both clients with the same version of codegen `0.25.x`. 
- Pin all necessary versions to ensure a single version of `@aws-sdk/*`
and `@smithy/*` packages.
- Add documentation to the build instructions that these clients must
stay in-sync (in terms of codegen).
- Add documentation regarding updating `@aws-sdk/*` packages. 

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…ws#6583

## Problem
Users have to re-select a debug config every time when open the Invoke
and Debug webview

## Solution
Automatically load the first matching debug configuration when the local
invoke view is opened
Update the src.gen dependencies of Amazon Q using new API models.
## Problem
1. The /test command can occasionally create test files in directories
unrelated to the source file location (this is a known science issue
that will be addressed)
2. Unit tests generated after the "Clicks on accept" test may possibly
accumulate in the CI since testFixtures isn't reset for each build. This
can lead to bloated test environments as these tests should be isolated
and start with a clean state.

## Solution
1. Add a dedicated testgen folder within testFixtures to isolate from
other files. This prevents cross-contamination (ex: python tests
appearing in java directories)
2. Clean up generated unit tests after "Clicks on accept" test
---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…q_utgGenerateTests event (aws#6598)

## Problem
- IDE does not emit requestId if it fails at `uploadArtifactToS3` in
`/test`

## Solution
- Added requestId for Test Generation without impacting the `/review`
- `requestId` is stored in /test session and emits if something fails in
the test generation workflow.
- Helps in debugging the root cause for the
`UploadTestArtifactToS3Error: "PUT" request failed with code "403"`
error in RTS logs.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
aws#6594

The `getMfaCodeFromUser` currently uses a deprecated version of
`createInputBox` and the following `promptUser` function:

https://github.com/aws/aws-toolkit-vscode/blob/0fa1b5b47ab642458df934192832a4ffcb6c9d1e/packages/core/src/shared/ui/input.ts#L72-L135

Based on the stack trace, there is a race condition here that can lead
to a type error, but unsure how?
Stack trace: 
```
TypeError: inputBox.hide is not a function
      at promptUser (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/shared/ui/input.ts:133:18)
      at async getMfaTokenFromUser (/Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/auth/credentials/utils.ts:124:19)
      at async /Users/runner/work/aws-toolkit-vscode/aws-toolkit-vscode/packages/core/src/auth/providers/sharedCredentialsProvider.ts:422:38
```
### Investigation Notes:
- The error only happens when running the test suite as a whole. 
- The error only happens in CI (unable to reproduce locally). 

## Solution
- avoid use of deprecated `createInputBox`
[function](https://github.com/aws/aws-toolkit-vscode/blob/0fa1b5b47ab642458df934192832a4ffcb6c9d1e/packages/core/src/shared/ui/input.ts#L31-L58),
prefer new version instead.
- Ran the tests 4x with 1000x on the test, and did not see a failure. 

## Future Work 
- Migrate existing cases away from this deprecated `createInputBox` if
there is evidence it leads to flaky tests or unreliable behavior.
)

## Problem
Stuck on "Uploading code..." for /dev and /doc in a multi-root workspace
with the same file paths in it multiple times.

## Solution
Add a check to prevent same file from being added to archive twice

Fixes issue aws#6566

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
Will enable for prod once I confirm it outputs the proper messages.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
## Problem
View Summary button wasn't working after users accept changes, since we
save the `summary.md` to where their project is locally.

## Solution
Update summary file path.
## Problem
- For RIV 2024, team planned to drop the build and execute due to SDE
bandwidth.

## Solution
- Adding back build and execute logic for internal amazon users to fix
the errors in generated test code and to improve test code coverage.
… using build quickpick (aws#6603)

## Problem
When users use appbuilder to build their lambda functions, they choose
between using their samconfig file or manually selecting the build
parameters/flags. The problem is that when the user selects build flags
and intentionally doesn't select the ```--use-container``` flag, the
command will still be run with --use-container if the samconfig file has
```use_container``` is set to true.

## Solution
Whenever the user manually selects the build flags and doesn't select
```--use-container```, we add the negative version of
```--use-container```, which is ```--no-use-container```. This serves as
an override if the samconfig file has ```--use-container``` set to true.

---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.
…s#6572)

## Problem
- Follow up to
aws#6564 (review).

## Solution
- It appears that there is an undocumented "feature" that GHA don't run
when there is a merge conflict. See
[here](https://github.com/orgs/community/discussions/11265)
- This means we don't have to handle the failure case where a merge
fails.
- Add fake config identity to mitigate this error: 
<img width="913" alt="image"
src="https://github.com/user-attachments/assets/cd426ec7-e1ca-4d13-a3b1-3985b5593c07"
/>


## Notes
Going to let this sit and make sure it works as changes are merged into
master.


---

- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.

---------

Co-authored-by: Justin M. Keyes <[email protected]>
@witness-me witness-me requested review from a team as code owners February 18, 2025 22:10
@witness-me witness-me marked this pull request as draft February 18, 2025 22:25
@witness-me witness-me marked this pull request as ready for review February 18, 2025 23:02
@justinmk3 justinmk3 merged commit 43ed70f into aws:feature/stepfunctions-workflow Feb 19, 2025
16 of 17 checks passed
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.