aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.47k stars 409 forks source link

fix(amazonq): always show latest build logs #5316

Closed dhasani23 closed 2 months ago

dhasani23 commented 2 months ago

Problem

When users download the pre-build error logs, then run another transformation without clicking the "Start a new transformation" button, if another pre-build error occurs, the old logs will show up. This could happen if they close the Q Chat tab and re-run a transformation, or if they close the IDE between job runs. If they do click the "Start a new transformation" button, everything works fine, but we need to handle these other situations.

Solution

Use makeTemporaryToolkitFolder() which creates a new folder with a random name, so that the logs are downloaded there, meaning we don't have to deal with deleting the old logs that would otherwise be in the same folder as the new logs.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.