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
Amazon Q: Added telemetry metrics and modified customer facing messages for Q Codescans. #4442
Conversation
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanManager.kt
Show resolved
Hide resolved
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanManager.kt
Show resolved
Hide resolved
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanManager.kt
Show resolved
Hide resolved
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanSession.kt
Outdated
Show resolved
Hide resolved
...ws/toolkits/jetbrains/services/codewhisperer/codescan/sessionconfig/CodeScanSessionConfig.kt
Show resolved
Hide resolved
val connection = it.connection as HttpURLConnection | ||
connection.setFixedLengthStreamingMode(fileToUpload.length()) | ||
IoUtils.copy(fileToUpload.inputStream(), connection.outputStream) | ||
} catch (e: IOException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we catch and rethrow here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed try catch at parent function createUploadUrlAndUpload
and tried to add this at individual step to get precise error message to telemetry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the catch blocks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a potential chance of IOException so I handled IOException too in the catch block. We need catch block to throw uploadArtifactFailedError
if required, we can remove catch for IOException.
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanSession.kt
Outdated
Show resolved
Hide resolved
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanSession.kt
Outdated
Show resolved
Hide resolved
...tware/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererCodeScanSession.kt
Show resolved
Hide resolved
val connection = it.connection as HttpURLConnection | ||
connection.setFixedLengthStreamingMode(fileToUpload.length()) | ||
IoUtils.copy(fileToUpload.inputStream(), connection.outputStream) | ||
} catch (e: IOException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the catch blocks here?
@@ -168,6 +169,15 @@ class CodeWhispererCodeFileScanTest : CodeWhispererCodeScanTestBase(PythonCodeIn | |||
) | |||
} | |||
|
|||
@Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought to write test for both File scan and project scan but removed this.
Quality Gate failedFailed conditions |
Types of changes
Description
Solution
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.