Skip to content

Commit e81a539

Browse files
committed
config(amazonq): disable auto-review by default
1 parent de44d06 commit e81a539

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "removal",
3+
"description" : "Disable auto scan by default"
4+
}

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererZipUploadManager.kt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class CodeWhispererZipUploadManager(private val project: Project) {
6464
var requestId: String? = null
6565
var requestServiceType: String? = null
6666
var httpStatusCode: String? = null
67-
var id2: String? = null
6867
try {
6968
// Throw error if zipFile is invalid.
7069
if (!zipFile.exists()) {
@@ -79,7 +78,7 @@ class CodeWhispererZipUploadManager(private val project: Project) {
7978
val url = createUploadUrlResponse.uploadUrl()
8079
LOG.debug { "$featureUseCase: Uploading $artifactType using the presigned URL." }
8180

82-
val connection = uploadArtifactToS3(
81+
uploadArtifactToS3(
8382
url,
8483
createUploadUrlResponse.uploadId(),
8584
zipFile,
@@ -88,8 +87,6 @@ class CodeWhispererZipUploadManager(private val project: Project) {
8887
createUploadUrlResponse.requestHeaders(),
8988
featureUseCase
9089
)
91-
requestId = connection?.getHeaderField("x-amz-request-id")
92-
id2 = connection?.getHeaderField("x-amz-id-2")
9390
return createUploadUrlResponse
9491
} catch (e: Exception) {
9592
result = MetricResult.Failed
@@ -99,12 +96,10 @@ class CodeWhispererZipUploadManager(private val project: Project) {
9996
requestId = e.requestId
10097
requestServiceType = e.requestServiceType
10198
httpStatusCode = e.httpStatusCode
102-
id2 = e.id2
10399
}
104100
throw e
105101
} finally {
106102
if (featureUseCase == CodeWhispererConstants.FeatureName.CODE_REVIEW) {
107-
LOG.info("Upload to S3 details: x-amz-request-id: $requestId and x-amz-id-2: $id2")
108103
AmazonqTelemetry.createUpload(
109104
amazonqConversationId = "",
110105
amazonqUploadIntent = if (taskType == CodeWhispererConstants.UploadTaskType.SCAN_PROJECT) {
@@ -118,7 +113,6 @@ class CodeWhispererZipUploadManager(private val project: Project) {
118113
duration = (System.currentTimeMillis() - startTime).toDouble(),
119114
credentialStartUrl = getStartUrl(project),
120115
requestId = requestId,
121-
id2 = id2,
122116
requestServiceType = requestServiceType,
123117
httpStatusCode = httpStatusCode
124118
)
@@ -135,7 +129,7 @@ class CodeWhispererZipUploadManager(private val project: Project) {
135129
kmsArn: String?,
136130
requestHeaders: Map<String, String>?,
137131
featureUseCase: CodeWhispererConstants.FeatureName,
138-
) : HttpURLConnection? {
132+
) {
139133
var connection: HttpURLConnection? = null
140134
RetryableOperation<Unit>().execute(
141135
operation = {
@@ -173,7 +167,6 @@ class CodeWhispererZipUploadManager(private val project: Project) {
173167
codeScanServerException(
174168
"CreateUploadUrlException: $errorMessage",
175169
connection?.getHeaderField("x-amz-request-id"),
176-
connection?.getHeaderField("x-amz-id-2"),
177170
"s3",
178171
(e as? HttpRequests.HttpStatusException)?.statusCode.toString()
179172
)
@@ -187,7 +180,6 @@ class CodeWhispererZipUploadManager(private val project: Project) {
187180
}
188181
}
189182
)
190-
return connection
191183
}
192184

193185
fun createUploadUrl(

0 commit comments

Comments
 (0)