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

feat(amazonq): Add command to generate unit tests for selected code #4869

Merged
merged 43 commits into from
Oct 1, 2024

Conversation

bweedop
Copy link
Contributor

@bweedop bweedop commented Sep 6, 2024

Adds command to Amazon Q to generate unit tests for selected code. The feature will be limited to internal Amazon users to collect usage metrics and, subsequently, will be released to all users.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

  • Adds "Test Code" command to context menu. The command will send the selected code to the chat with the following prompt: "Generate unit tests for the following part of my code for me:"
image

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

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

bweedop and others added 24 commits August 27, 2024 12:37
* Added authType to loginWithBrowser metric

* Add open and close sign in metrics

* detekt

* addressed feedback

* feedback

* moved the util function
* Added UI click metrics on all login options

* Combined calls for continue and back button
* Revert open and close sign in webview telemetry

* add changelog

* added issue in changelog

* Update bugfix-64bb0c4b-8d3b-45b0-b615-8722bb3e9e4a.json

---------

Co-authored-by: Richard Li <[email protected]>
* telemetry(amazonq): update telemetry

* remove unused import

---------

Co-authored-by: David Hasani <[email protected]>
@bweedop bweedop marked this pull request as ready for review September 17, 2024 18:06
@bweedop bweedop requested review from a team as code owners September 17, 2024 18:06
Copy link
Contributor

@rli rli left a comment

Choose a reason for hiding this comment

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

lint is failing

val prompt = "${message.command} the following part of my code for me: $codeSelection"
val prompt = if (EditorContextCommand.GenerateUnitTests == message.command)
"${message.command.verb} the following part of my code for me: $codeSelection" else
"${message.command} the following part of my code for me: $codeSelection";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Redundant Semicolon.

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, Clear the unused imports.

@bweedop bweedop merged commit 7ff4f29 into aws:main Oct 1, 2024
9 of 12 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.

7 participants