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): UTG build and execute for internal users. #5436

Open
wants to merge 29 commits into
base: feature/build-execute
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
24a0832
add build-execute code
Randall-Jiang Feb 21, 2025
4168e78
address comment
Randall-Jiang Feb 21, 2025
b5de261
create progress bar for fixing build failure
Randall-Jiang Feb 21, 2025
9cf1786
fix the bug which might cause user can not execute the build command …
Randall-Jiang Feb 24, 2025
ca2c128
fix format error
Randall-Jiang Feb 24, 2025
9151dce
correct the logic to send the telemetry
Randall-Jiang Feb 25, 2025
b5792bc
addressed comment
Randall-Jiang Feb 25, 2025
5231789
nit
Randall-Jiang Feb 25, 2025
9e323fe
addressing comments
Randall-Jiang Feb 25, 2025
3601d49
add PATH
Randall-Jiang Feb 28, 2025
fc8d07b
add gradle file for groovy version of the gradle build script
Randall-Jiang Feb 28, 2025
d195b1a
fix UI error
Randall-Jiang Mar 3, 2025
7e6a367
Fix lint errors
laileni-aws Mar 3, 2025
2c3ddba
Merge branch 'feature/build-execute' into build-execute
laileni-aws Mar 3, 2025
43dced6
Merge from Feature/build-execute
laileni-aws Mar 4, 2025
bc510d0
Merge branch 'feature/build-execute' into randal/build
laileni-aws Mar 4, 2025
3c6c33c
Refactoring Build and execute
laileni-aws Mar 4, 2025
d139695
Revert "Refactoring Build and execute"
laileni-aws Mar 4, 2025
b257fed
Refactoring Build and execute
laileni-aws Mar 4, 2025
1b76a80
Fixing build and execute command issue
laileni-aws Mar 4, 2025
e87fe92
Bug fixes in build and execute
laileni-aws Mar 6, 2025
3e129b2
Progress bar cancel UX changes
laileni-aws Mar 6, 2025
3dcde41
Fixes
laileni-aws Mar 7, 2025
22b1e81
Merge branch 'feature/build-execute' into randal/build
laileni-aws Mar 7, 2025
931fca3
Fixes
laileni-aws Mar 7, 2025
27b22d5
Modified impl of progress bar cancel functionality and some UX change…
laileni-aws Mar 7, 2025
6d039ae
Merge branch 'feature/build-execute' into randal/build
laileni-aws Mar 7, 2025
f7d450e
Minor fixes and refactoring in CTCChatController, CWSPRUTGChatManager…
laileni-aws Mar 7, 2025
e770e53
Removing commented code
laileni-aws Mar 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
laileni-aws committed Mar 7, 2025
commit 931fca3a1a057b8b0227d2ea7f1726e1e4889c45
Original file line number Diff line number Diff line change
@@ -53,9 +53,8 @@
import software.aws.toolkits.jetbrains.settings.CodeWhispererSettings
import software.aws.toolkits.jetbrains.utils.isQConnected
import software.aws.toolkits.resources.message
import software.aws.toolkits.telemetry.AmazonqTelemetry

Check warning on line 56 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/CodeWhispererUTGChatManager.kt

GitHub Actions / qodana

Usage of redundant or deprecated syntax or deprecated symbols

'AmazonqTelemetry' is deprecated. Use type-safe metric builders
import software.aws.toolkits.telemetry.MetricResult
//import software.aws.toolkits.telemetry.Status
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.File
Original file line number Diff line number Diff line change
@@ -103,7 +103,6 @@
import software.aws.toolkits.telemetry.FeatureId
import software.aws.toolkits.telemetry.InteractionType
import software.aws.toolkits.telemetry.MetricResult
//import software.aws.toolkits.telemetry.Status
import software.aws.toolkits.telemetry.UiTelemetry
import java.io.File
import java.nio.file.Files
@@ -448,7 +447,7 @@
val session = codeTestChatHelper.getActiveSession()
when (message.vote) {
"upvote" -> {
AmazonqTelemetry.feedback(

Check warning on line 450 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

GitHub Actions / qodana

Usage of redundant or deprecated syntax or deprecated symbols

'AmazonqTelemetry' is deprecated. Use type-safe metric builders
featureId = FeatureId.AmazonQTest,
interactionType = InteractionType.Upvote,
credentialStartUrl = getStartUrl(project = context.project),
@@ -599,7 +598,7 @@

codeTestChatHelper.updateUI(
promptInputDisabledState = true,
promptInputPlaceholder = message("testgen.placeholder.select_an_option"),

Check warning on line 601 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

GitHub Actions / qodana

Usage of redundant or deprecated syntax or deprecated symbols

'message(String, vararg Any): String' is deprecated. Use extension-specific localization bundle instead
)

codeTestChatHelper.updateAnswer(
@@ -669,7 +668,7 @@
"Successfully sent test generation telemetry. RequestId: ${
testGenerationEventResponse.responseMetadata().requestId()}"
}
AmazonqTelemetry.utgGenerateTests(
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
isFileInWorkspace = true,
@@ -792,7 +791,7 @@
message = """
You have gone through both iterations and this unit test generation workflow is complete.
""".trimIndent(),
type = ChatMessageType.Answer,
)
)
codeTestChatHelper.updateUI(
@@ -886,7 +885,7 @@
"Successfully sent test generation telemetry. RequestId: ${
testGenerationEventResponse.responseMetadata().requestId()}"
}
UiTelemetry.click(

Check warning on line 888 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

GitHub Actions / qodana

Usage of redundant or deprecated syntax or deprecated symbols

'UiTelemetry' is deprecated. Use type-safe metric builders
null as Project?,
if (session.listOfTestGenerationJobId.size == 1) {
"unitTestGeneration_rejectDiff"
@@ -919,7 +918,7 @@
// status = Status.REJECTED
)
} else {
AmazonqTelemetry.unitTestGeneration(
count = session.listOfTestGenerationJobId.size.toLong() - 1,
cwsprChatProgrammingLanguage = session.programmingLanguage.languageId,
hasUserPromptSupplied = session.hasUserPromptSupplied,
@@ -945,7 +944,7 @@
requestId = session.startTestGenerationRequestId,
update = session.updateBuildCommands,
)
}

sessionCleanUp(message.tabId)
}
@@ -1072,7 +1071,7 @@
}

// TODO: only go to future iterations when buildExitCode or testExitCode > 0, right now iterate regardless
if (taskContext.buildExitCode > 0) {

Check warning on line 1074 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

GitHub Actions / qodana

Constant conditions

Condition 'taskContext.buildExitCode \> 0' is always true
// handle build failure case

taskContext.progressStatus = BuildAndExecuteProgressStatus.BUILD_FAILED
@@ -1131,7 +1130,7 @@
return
}
"stop_fixing_test_cases" -> {
UiTelemetry.click(null as Project?, "unitTestGeneration_cancelFixingTest")
session.isGeneratingTests = false
session.buildStatus = BuildStatus.CANCELLED
return
@@ -1150,10 +1149,10 @@
sessionCleanUp(codeTestChatHelper.getActiveSession().tabId)
}

suspend fun updateBuildAndExecuteProgressCard(

Check notice on line 1152 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqCodeTest/controller/CodeTestChatController.kt

GitHub Actions / qodana

Class member can have 'private' visibility

Function 'updateBuildAndExecuteProgressCard' could be private
currentStatus: BuildAndExecuteProgressStatus,
messageId: String?,
): String? {
val updatedText = constructBuildAndExecutionSummaryText(currentStatus, codeTestChatHelper)

if (currentStatus == BuildAndExecuteProgressStatus.RUN_BUILD) {
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ const val CODE_TEST_TAB_NAME = "codetest"
enum class CodeTestButtonId(val id: String) {
StopTestGeneration("stop_test_generation"),
StopTestGenBuildAndExecution("stop_test_gen_build_and_execution"),
StopFixingTestCases("stop_fixing_test_cases")
StopFixingTestCases("stop_fixing_test_cases"),
}

data class Button(
Loading