-
Notifications
You must be signed in to change notification settings - Fork 253
fix(amazonq): auto scan use unsaved content #4527
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
Conversation
/retryBuilds |
...ws/toolkits/jetbrains/services/codewhisperer/codescan/sessionconfig/CodeScanSessionConfig.kt
Outdated
Show resolved
Hide resolved
Can we add tests? |
private fun zipFile(filePath: Path): File = createTemporaryZipFile { | ||
try { | ||
val relativePath = filePath.relativeTo(projectRoot.toNioPath()) | ||
val virtualFile = VirtualFileManager.getInstance().findFileByNioPath(filePath) |
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.
these two lines are error prone in case of remote development cases. i'll make the changes for these two once i complete testing for remote cases.
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.
Discussed offline, this will be addressed in a separate PR
/retryBuilds |
|
… for ZipOutputStream using bufferedStream instead of bytes array. This reverts commit 8c109af.
Types of changes
Description
Problem
Zip file artifact created from auto scans don't have the latest text document content because we are reading the file contents from disk. This means auto scans are never scanning the latest version of the content.
Solution
Get the file contents from
FileDocumentManager
which has the latest changes and write that to the zip file instead of relying on file path / reading from disk.Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.