Skip to content

Commit 222bef6

Browse files
authored
Merge branch 'main' into index_finish_bug
2 parents ffc4cc2 + 640c686 commit 222bef6

File tree

13 files changed

+180
-25
lines changed

13 files changed

+180
-25
lines changed

.changes/3.38.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"date" : "2024-11-07",
3+
"version" : "3.38",
4+
"entries" : [ {
5+
"type" : "bugfix",
6+
"description" : "Improve the position that inline chat shortcut hint is shown in editor"
7+
}, {
8+
"type" : "bugfix",
9+
"description" : "Improve `@workspace` index start stop strategy"
10+
}, {
11+
"type" : "bugfix",
12+
"description" : "Fixed an issue where Q inline won't appear in JetBrains remote 2024.2+"
13+
} ]
14+
}

.changes/next-release/bugfix-1b531ca4-5b80-48d9-89e7-ac88adc77ad5.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/next-release/bugfix-4fee3628-1445-40f3-b164-2b0d3c12bd19.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/next-release/bugfix-eb803511-b66c-454e-a832-ca189572d1af.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# _3.38_ (2024-11-07)
2+
- **(Bug Fix)** Improve the position that inline chat shortcut hint is shown in editor
3+
- **(Bug Fix)** Improve `@workspace` index start stop strategy
4+
- **(Bug Fix)** Fixed an issue where Q inline won't appear in JetBrains remote 2024.2+
5+
16
# _3.37_ (2024-10-31)
27
- **(Bug Fix)** Amazon Q /dev: Fix the issue resulting in the first request per conversation to /dev failing
38
- **(Bug Fix)** Fix inline chat shortcut hint breaking text selection on remote editors

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Toolkit Version
5-
toolkitVersion=3.38-SNAPSHOT
5+
toolkitVersion=3.39-SNAPSHOT
66

77
# Publish Settings
88
publishToken=

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/DiskCache.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import software.aws.toolkits.core.utils.touch
3232
import software.aws.toolkits.core.utils.tryDirOp
3333
import software.aws.toolkits.core.utils.tryFileOp
3434
import software.aws.toolkits.core.utils.tryOrNull
35+
import software.aws.toolkits.jetbrains.services.telemetry.scrubNames
3536
import software.aws.toolkits.telemetry.AuthTelemetry
3637
import software.aws.toolkits.telemetry.Result
3738
import java.io.InputStream
@@ -111,7 +112,7 @@ class DiskCache(
111112
source = "loadClientRegistration",
112113
result = Result.Failed,
113114
reason = "Failed to load Client Registration",
114-
reasonDesc = "Load Step:$stage failed. Unable to load file"
115+
reasonDesc = "Load Step:$stage failed. Cache file does not exist"
115116
)
116117
return null
117118
}
@@ -136,7 +137,7 @@ class DiskCache(
136137
source = "invalidateClientRegistration",
137138
result = Result.Failed,
138139
reason = "Failed to invalidate Client Registration",
139-
reasonDesc = e.message ?: e::class.java.name
140+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name
140141
)
141142
throw e
142143
}
@@ -152,7 +153,7 @@ class DiskCache(
152153
source = "invalidateAccessToken",
153154
result = Result.Failed,
154155
reason = "Failed to invalidate Access Token",
155-
reasonDesc = e.message ?: e::class.java.name
156+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name
156157
)
157158
throw e
158159
}
@@ -186,7 +187,7 @@ class DiskCache(
186187
source = "invalidateAccessToken",
187188
result = Result.Failed,
188189
reason = "Failed to invalidate Access Token",
189-
reasonDesc = e.message ?: e::class.java.name
190+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name
190191
)
191192
throw e
192193
}
@@ -282,7 +283,7 @@ class DiskCache(
282283
source = "writeKey",
283284
result = Result.Failed,
284285
reason = "Failed to write to cache",
285-
reasonDesc = e.message ?: e::class.java.name
286+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name
286287
)
287288
throw e
288289
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/SsoAccessTokenProvider.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import software.aws.toolkits.jetbrains.core.credentials.sono.SONO_URL
2424
import software.aws.toolkits.jetbrains.core.credentials.sso.pkce.PKCE_CLIENT_NAME
2525
import software.aws.toolkits.jetbrains.core.credentials.sso.pkce.ToolkitOAuthService
2626
import software.aws.toolkits.jetbrains.core.webview.getAuthType
27+
import software.aws.toolkits.jetbrains.services.telemetry.scrubNames
2728
import software.aws.toolkits.jetbrains.utils.assertIsNonDispatchThread
2829
import software.aws.toolkits.jetbrains.utils.sleepWithCancellation
2930
import software.aws.toolkits.resources.AwsCoreBundle
@@ -183,7 +184,7 @@ class SsoAccessTokenProvider(
183184
source = "accessToken",
184185
result = Result.Failed,
185186
reason = "Failed to write AccessToken to cache",
186-
reasonDesc = e.message ?: e::class.java.name,
187+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name,
187188
)
188189
throw e
189190
}
@@ -225,7 +226,7 @@ class SsoAccessTokenProvider(
225226
source = "registerDAGClient",
226227
result = Result.Failed,
227228
reason = "Failed to write DeviceAuthorizationClientRegistration to cache",
228-
reasonDesc = e.message ?: e::class.java.name
229+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name
229230
)
230231
throw e
231232
}
@@ -277,7 +278,7 @@ class SsoAccessTokenProvider(
277278
source = "registerPkceClient",
278279
result = Result.Failed,
279280
reason = "Failed to write PKCEClientRegistration to cache",
280-
reasonDesc = e.message ?: e::class.java.name
281+
reasonDesc = e.message?.let { scrubNames(it) } ?: e::class.java.name
281282
)
282283
throw e
283284
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/credentials/sso/pkce/ToolkitOAuthService.kt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ import software.aws.toolkits.jetbrains.core.credentials.sso.PKCEAuthorizationGra
3232
import software.aws.toolkits.jetbrains.core.credentials.sso.PKCEClientRegistration
3333
import software.aws.toolkits.jetbrains.core.credentials.sso.bearer.buildUnmanagedSsoOidcClient
3434
import software.aws.toolkits.resources.AwsCoreBundle
35+
import software.aws.toolkits.telemetry.AuthType
36+
import software.aws.toolkits.telemetry.AwsTelemetry
37+
import software.aws.toolkits.telemetry.MetricResult
3538
import java.math.BigInteger
3639
import java.time.Instant
3740
import java.util.Base64
@@ -189,13 +192,23 @@ internal class ToolkitOAuthCallbackHandler : OAuthCallbackHandlerBase() {
189192
"scopes" to ApplicationNamesInfo.getInstance().fullProductName
190193
)
191194
} else {
192-
val (error, errorDescription) = (oAuthResult.request as? ToolkitOAuthRequest)?.error ?: OAuthError(null, null)
195+
val toolkitRequest = (oAuthResult.request as? ToolkitOAuthRequest)
196+
val (error, errorDescription) = toolkitRequest?.error ?: OAuthError(null, null)
193197
val errorString = if (error != null && errorDescription != null) {
194198
"$error: $errorDescription"
195199
} else {
196200
errorDescription ?: error ?: AwsCoreBundle.message("general.unknown_error")
197201
}
198202

203+
AwsTelemetry.loginWithBrowser(
204+
project = null,
205+
credentialStartUrl = toolkitRequest?.registration?.issuerUrl,
206+
result = MetricResult.Failed,
207+
reason = error,
208+
reasonDesc = errorDescription,
209+
authType = AuthType.PKCE
210+
)
211+
199212
mapOf(
200213
"error" to errorString
201214
)

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/core/webview/LoginBrowser.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import software.aws.toolkits.jetbrains.core.credentials.reauthConnectionIfNeeded
3636
import software.aws.toolkits.jetbrains.core.credentials.sono.CODECATALYST_SCOPES
3737
import software.aws.toolkits.jetbrains.core.credentials.sono.IDENTITY_CENTER_ROLE_ACCESS_SCOPE
3838
import software.aws.toolkits.jetbrains.core.credentials.sono.Q_SCOPES
39+
import software.aws.toolkits.jetbrains.core.credentials.sono.SONO_REGION
3940
import software.aws.toolkits.jetbrains.core.credentials.sono.SONO_URL
4041
import software.aws.toolkits.jetbrains.core.credentials.sso.PendingAuthorization
4142
import software.aws.toolkits.jetbrains.core.credentials.sso.bearer.InteractiveBearerTokenProvider
@@ -197,7 +198,7 @@ abstract class LoginBrowser(
197198
reason = e.message,
198199
credentialSourceId = CredentialSourceId.AwsId,
199200
isReAuth = isReauth,
200-
authType = getAuthType()
201+
authType = getAuthType(SONO_REGION)
201202
)
202203
AuthTelemetry.addConnection(
203204
result = Result.Failed,
@@ -217,7 +218,7 @@ abstract class LoginBrowser(
217218
result = Result.Succeeded,
218219
credentialSourceId = CredentialSourceId.AwsId,
219220
isReAuth = isReauth,
220-
authType = getAuthType()
221+
authType = getAuthType(SONO_REGION)
221222
)
222223
AuthTelemetry.addConnection(
223224
result = Result.Succeeded,

0 commit comments

Comments
 (0)