Skip to content

Conversation

@ashishrp-aws
Copy link
Contributor

@ashishrp-aws ashishrp-aws commented Jan 14, 2025

Problem

  • The test generation for unsupported language files and external files is unreliable and flaky.
  • Telemetry updated to include new metadata for existing metadata.

Solution


Before:
https://github.com/user-attachments/assets/90ed6629-4753-41e6-9d11-b6d4dd0d6e7c

After fix:

Screen.Recording.2025-01-15.at.12.22.15.PM.mov
  • 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.

@ashishrp-aws ashishrp-aws requested review from a team as code owners January 14, 2025 18:42
@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@justinmk3 justinmk3 changed the title fix(Amazon Q): fix for unsupproted languages test generation query fix(amazonq): fix for unsupproted languages test generation query Jan 14, 2025
@justinmk3 justinmk3 changed the title fix(amazonq): fix for unsupproted languages test generation query fix(amazonq): unsupported languages test generation query Jan 14, 2025
@justinmk3 justinmk3 closed this Jan 14, 2025
@justinmk3 justinmk3 reopened this Jan 14, 2025
@justinmk3
Copy link
Contributor

Essentially same PR : #6323 was closed last week due to build issues

There's no need to recreate the PR. Just close-and-reopen the existing PR, that will trigger a new lint-commits job. This is explained in the lint-commits CI log.

…1a2-bda3-9bc8bfa19b75.json

Co-authored-by: Justin M. Keyes <[email protected]>
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Amazon Q: test generation for unsupported was sometimes unreliable"
Copy link
Contributor

@ctlai95 ctlai95 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This will be listed under Amazon Q extension so no need to mention Amazon Q: here

Maybe instead you can prefix with /test:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


const triggerPayload = {
query: `Generate unit tests for the following part of my code: ${message}`,
query: `Generate unit tests for the following part of my code: ${message?.trim() || fileName}`,
Copy link
Contributor

@ctlai95 ctlai95 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please describe how this fixes the issue in the PR description? (I'm assuming this is the fix)

Before/after screenshots would be helpful as well, if possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Copy link
Contributor

@hayemaxi hayemaxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In future PRs please consider giving functions an options arguments instead of a bunch of arguments. It gets more and more confusing as arguments are added.

e.g.

// bad
myFunc(a, b, c, d ,e, f, g, ...) {}

// good
myFunc(options: Options) {}

type Options = {
    a: int
    b: string
    ....
}

@hayemaxi hayemaxi merged commit 73c0926 into aws:master Jan 15, 2025
16 of 17 checks passed
karanA-aws pushed a commit to karanA-aws/aws-toolkit-vscode that referenced this pull request Jan 17, 2025
## Problem
- The test generation for unsupported language files and external files
is unreliable and flaky.
- Telemetry updated to include new metadata for existing metadata.

## Solution
- Fix to add file name as fallback in case of empty prompt or no code
selection.
- Telemetry updated and values passed to it in controller and messenger.
Essentially same PR :
aws#6323 was closed last week
due to build issues.
---
Before:

https://github.com/user-attachments/assets/90ed6629-4753-41e6-9d11-b6d4dd0d6e7c

After fix:


https://github.com/user-attachments/assets/d0993345-cd2c-47ac-a8b5-1e9badf8fbac




- 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]>
kevluu-aws pushed a commit to kevluu-aws/aws-toolkit-vscode that referenced this pull request Jan 23, 2025
## Problem
- The test generation for unsupported language files and external files
is unreliable and flaky.
- Telemetry updated to include new metadata for existing metadata.

## Solution
- Fix to add file name as fallback in case of empty prompt or no code
selection.
- Telemetry updated and values passed to it in controller and messenger.
Essentially same PR :
aws#6323 was closed last week
due to build issues.
---
Before:

https://github.com/user-attachments/assets/90ed6629-4753-41e6-9d11-b6d4dd0d6e7c

After fix:


https://github.com/user-attachments/assets/d0993345-cd2c-47ac-a8b5-1e9badf8fbac




- 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]>
@ashishrp-aws ashishrp-aws deleted the queryfix branch February 7, 2025 22:31
s7ab059789 pushed a commit to s7ab059789/aws-toolkit-vscode that referenced this pull request Feb 19, 2025
## Problem
- The test generation for unsupported language files and external files
is unreliable and flaky.
- Telemetry updated to include new metadata for existing metadata.

## Solution
- Fix to add file name as fallback in case of empty prompt or no code
selection.
- Telemetry updated and values passed to it in controller and messenger.
Essentially same PR :
aws#6323 was closed last week
due to build issues.
---
Before:

https://github.com/user-attachments/assets/90ed6629-4753-41e6-9d11-b6d4dd0d6e7c

After fix:


https://github.com/user-attachments/assets/d0993345-cd2c-47ac-a8b5-1e9badf8fbac




- 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]>
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.

5 participants