Skip to content

Commit a883685

Browse files
authored
Merge branch 'testMetrics' into main
2 parents fefcb99 + 5c91df6 commit a883685

File tree

33 files changed

+292
-162
lines changed

33 files changed

+292
-162
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Amazon Q Feature Dev: Add error messages when the upload URL expires"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix toolkit connection dropdown getting hidden when panel width is small."
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix inability to sign out in reauth view in Q chat panel"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Raise max `@workspace` indexing size to 4GB"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Automatically pause and resume `@workspace` indexing when OS CPU load is high"
4+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/QLoginWebview.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package software.aws.toolkits.jetbrains.services.amazonq
66
import com.intellij.openapi.Disposable
77
import com.intellij.openapi.actionSystem.AnActionEvent
88
import com.intellij.openapi.actionSystem.DataContext
9+
import com.intellij.openapi.application.runInEdt
910
import com.intellij.openapi.components.Service
1011
import com.intellij.openapi.components.service
1112
import com.intellij.openapi.project.Project
@@ -177,13 +178,15 @@ class QWebviewBrowser(val project: Project, private val parentDisposable: Dispos
177178
ToolkitConnectionManager.getInstance(project)
178179
.activeConnectionForFeature(QConnection.getInstance()) as? AwsBearerTokenConnection
179180
)?.let { connection ->
180-
SsoLogoutAction(connection).actionPerformed(
181-
AnActionEvent.createFromDataContext(
182-
"qBrowser",
183-
null,
184-
DataContext.EMPTY_CONTEXT
181+
runInEdt {
182+
SsoLogoutAction(connection).actionPerformed(
183+
AnActionEvent.createFromDataContext(
184+
"qBrowser",
185+
null,
186+
DataContext.EMPTY_CONTEXT
187+
)
185188
)
186-
)
189+
}
187190
}
188191
}
189192

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/auth/AuthController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class AuthController {
8888
AuthFollowUpType.FullAuth,
8989
-> runInEdt {
9090
UiTelemetry.click(project, "amazonq_chatAuthenticate")
91-
requestCredentialsForQ(project, connectionInitiatedFromQChatPanel = true)
91+
requestCredentialsForQ(project, connectionInitiatedFromQChatPanel = true, isReauth = false)
9292
}
9393

9494
AuthFollowUpType.ReAuth,

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/explorerActions/SignInToQAction.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SignInToQAction : SignInToQActionBase(message("q.sign.in")) {
2424
UiTelemetry.click(project, "auth_start_Q")
2525

2626
if (!isQWebviewsAvailable()) {
27-
requestCredentialsForQ(project)
27+
requestCredentialsForQ(project, isReauth = false)
2828
} else {
2929
ToolWindowManager.getInstance(project).getToolWindow(AmazonQToolWindowFactory.WINDOW_ID)?.show()
3030
}
@@ -42,7 +42,7 @@ abstract class SignInToQActionBase(actionName: String) : DumbAwareAction(actionN
4242
reauthConnectionIfNeeded(project, it, isReAuth = true)
4343
} ?: run {
4444
runInEdt {
45-
if (requestCredentialsForQ(project)) {
45+
if (requestCredentialsForQ(project, isReauth = false)) {
4646
if (!openMeetQPage(project)) {
4747
return@runInEdt
4848
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/FeatureDevConstants.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,16 @@ enum class ModifySourceFolderErrorReason(
2525

2626
override fun toString(): String = reasonText
2727
}
28+
29+
enum class FeatureDevOperation(private val operationName: String) {
30+
StartTaskAssistCodeGeneration("StartTaskAssistCodeGenerator"),
31+
CreateConversation("CreateConversation"),
32+
CreateUploadUrl("CreateUploadUrl"),
33+
GenerateCode("GenerateCode"),
34+
GetTaskAssistCodeGeneration("GetTaskAssistCodeGenerator"),
35+
ExportTaskAssistArchiveResult("ExportTaskAssistArchiveResult"),
36+
UploadToS3("UploadToS3"),
37+
;
38+
39+
override fun toString(): String = operationName
40+
}

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqFeatureDev/FeatureDevExceptions.kt

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,69 @@ package software.aws.toolkits.jetbrains.services.amazonqFeatureDev
66
import software.aws.toolkits.jetbrains.services.amazonq.RepoSizeError
77
import software.aws.toolkits.resources.message
88

9-
open class FeatureDevException(override val message: String?, override val cause: Throwable? = null) : RuntimeException()
9+
/**
10+
* FeatureDevException models failures from feature dev operations.
11+
*
12+
* - Each failure is annotated based on className, operation, and a short desc. Use the `reason()` and `reasonDesc()` members for instrumentation.
13+
* - To throw an exception without modeling, throw FeatureDevException directly.
14+
*/
15+
open class FeatureDevException(override val message: String?, val operation: String, val desc: String?, override val cause: Throwable? = null) :
16+
RuntimeException() {
17+
fun reason(): String = this.javaClass.simpleName
1018

11-
class ContentLengthError(override val message: String, override val cause: Throwable?) : RepoSizeError, RuntimeException()
19+
fun reasonDesc(): String =
20+
when (desc) {
21+
desc -> "$operation | Description: $desc"
22+
else -> operation
23+
}
24+
}
1225

13-
class ZipFileError(override val message: String, override val cause: Throwable?) : RuntimeException()
26+
class NoChangeRequiredException(operation: String, desc: String?, cause: Throwable? = null) :
27+
FeatureDevException(message("amazonqFeatureDev.exception.no_change_required_exception"), operation, desc, cause)
1428

15-
class CodeIterationLimitError(override val message: String, override val cause: Throwable?) : RuntimeException()
29+
class EmptyPatchException(operation: String, desc: String?, cause: Throwable? = null) :
30+
FeatureDevException(message("amazonqFeatureDev.exception.guardrails"), operation, desc, cause)
1631

17-
class MonthlyConversationLimitError(override val message: String, override val cause: Throwable?) : RuntimeException()
32+
class ContentLengthException(
33+
override val message: String = message("amazonqFeatureDev.content_length.error_text"),
34+
operation: String,
35+
desc: String?,
36+
cause: Throwable? = null,
37+
) :
38+
RepoSizeError, FeatureDevException(message, operation, desc, cause)
1839

19-
internal fun featureDevServiceError(message: String?): Nothing =
20-
throw FeatureDevException(message)
40+
class ZipFileCorruptedException(operation: String, desc: String?, cause: Throwable? = null) :
41+
FeatureDevException("The zip file is corrupted", operation, desc, cause)
2142

22-
internal fun codeGenerationFailedError(): Nothing =
23-
throw FeatureDevException(message("amazonqFeatureDev.code_generation.failed_generation"))
43+
class UploadURLExpired(operation: String, desc: String?, cause: Throwable? = null) :
44+
FeatureDevException(message("amazonqFeatureDev.exception.upload_url_expiry"), operation, desc, cause)
2445

25-
internal fun uploadCodeError(): Nothing =
26-
throw FeatureDevException(message("amazonqFeatureDev.exception.upload_code"))
46+
class CodeIterationLimitException(operation: String, desc: String?, cause: Throwable? = null) :
47+
FeatureDevException(message("amazonqFeatureDev.code_generation.iteration_limit.error_text"), operation, desc, cause)
2748

28-
internal fun conversationIdNotFound(): Nothing =
29-
throw FeatureDevException(message("amazonqFeatureDev.exception.conversation_not_found"))
49+
class MonthlyConversationLimitError(message: String, operation: String, desc: String?, cause: Throwable? = null) :
50+
FeatureDevException(message, operation, desc, cause)
3051

31-
internal fun apiError(message: String?, cause: Throwable?): Nothing =
32-
throw FeatureDevException(message, cause)
52+
class GuardrailsException(operation: String, desc: String?, cause: Throwable? = null) :
53+
FeatureDevException(message("amazonqFeatureDev.exception.guardrails"), operation, desc, cause)
3354

34-
internal fun exportParseError(): Nothing =
35-
throw FeatureDevException(message("amazonqFeatureDev.exception.export_parsing_error"))
55+
class PromptRefusalException(operation: String, desc: String?, cause: Throwable? = null) :
56+
FeatureDevException(message("amazonqFeatureDev.exception.prompt_refusal"), operation, desc, cause)
57+
58+
class ThrottlingException(operation: String, desc: String?, cause: Throwable? = null) :
59+
FeatureDevException(message("amazonqFeatureDev.exception.throttling"), operation, desc, cause)
60+
61+
class ExportParseException(operation: String, desc: String?, cause: Throwable? = null) :
62+
FeatureDevException(message("amazonqFeatureDev.exception.export_parsing_error"), operation, desc, cause)
63+
64+
class CodeGenerationException(operation: String, desc: String?, cause: Throwable? = null) :
65+
FeatureDevException(message("amazonqFeatureDev.code_generation.failed_generation"), operation, desc, cause)
66+
67+
class UploadCodeException(operation: String, desc: String?, cause: Throwable? = null) :
68+
FeatureDevException(message("amazonqFeatureDev.exception.upload_code"), operation, desc, cause)
69+
70+
class ConversationIdNotFoundException(operation: String, desc: String?, cause: Throwable? = null) :
71+
FeatureDevException(message("amazonqFeatureDev.exception.conversation_not_found"), operation, desc, cause)
3672

3773
val denyListedErrors = arrayOf("Deserialization error", "Inaccessible host", "UnknownHost")
3874
fun createUserFacingErrorMessage(message: String?): String? =

0 commit comments

Comments
 (0)