-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(amazonq): Add command to generate unit tests for selected code (#…
…4869) * feat (Amazon Q): Add basic UX and logic for generating unit tests * Update cwspr model with GENERATE_UNIT_TESTS user intent * fix (Amazon Q): Pass context specific intent and trigger type to chat (#4842) * Added authType to loginWithBrowser metric (#4843) * 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 (#4838) * Added UI click metrics on all login options * Combined calls for continue and back button * Updating version to 3.25 * Updating SNAPSHOT version to 3.26-SNAPSHOT * Revert open and close sign in webview telemetry (#4850) * 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]> * Updating version to 3.26 * Updating SNAPSHOT version to 3.27-SNAPSHOT * telemetry(amazonq): update telemetry (#4847) * telemetry(amazonq): update telemetry * remove unused import --------- Co-authored-by: David Hasani <[email protected]> * feat(amazonq): Reduce @workspace indexing time by 50% (#4846) * Hash startUrl * Revert CodeWhisperer endpoint back gamma endpoint * Revert adding user intent to interact with message metadata * Add changelog * Refactor for consistent hashing of startUrl * Remove hashing logic on startUrl and changelog entry * Add (Beta) suffix to generate unit tests command * Add check for startUrl when getting user intent from prompt * Update TestCodeAction to resolve lint failure Co-authored-by: Richard Li <[email protected]> * address comments: Better GenerateUnitTest Action naming * Refactor to use more specific command for UTG * Change name of action to GenerateUnitTests * Fix linting errors * Override 'getActionUpdateThread' * Reorder MessageBundle.properties * Fix syntax error --------- Co-authored-by: manodnyab <[email protected]> Co-authored-by: aws-toolkit-automation <> Co-authored-by: Richard Li <[email protected]> Co-authored-by: David <[email protected]> Co-authored-by: David Hasani <[email protected]> Co-authored-by: Lei Gao <[email protected]> Co-authored-by: David Lin <[email protected]>
- Loading branch information
1 parent
b88f7d8
commit 7ff4f29
Showing
11 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...nity/src/software/aws/toolkits/jetbrains/services/cwc/commands/GenerateUnitTestsAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.jetbrains.services.cwc.commands | ||
|
||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.actionSystem.CommonDataKeys | ||
import software.aws.toolkits.jetbrains.core.credentials.AwsBearerTokenConnection | ||
import software.aws.toolkits.jetbrains.core.credentials.ToolkitConnectionManager | ||
import software.aws.toolkits.jetbrains.core.credentials.pinning.QConnection | ||
|
||
class GenerateUnitTestsAction : CustomAction(EditorContextCommand.GenerateUnitTests) { | ||
override fun getActionUpdateThread() = ActionUpdateThread.BGT | ||
|
||
override fun update(e: AnActionEvent) { | ||
val project = e.getData(CommonDataKeys.PROJECT) ?: return | ||
val connection = ToolkitConnectionManager.getInstance(project).activeConnectionForFeature(QConnection.getInstance()) as? AwsBearerTokenConnection | ||
e.presentation.isEnabledAndVisible = connection?.startUrl == "https://amzn.awsapps.com/start" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters