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.41k stars 346 forks source link

feat(feature dev): Filter out non-code files at preparation state #5238

Open willyyhuang opened 1 week ago

willyyhuang commented 1 week ago

Problem

Feature dev compiles a compressed file with relevant local files to prepare response. This process would allow some irrelevant files to be added into the zip without many filters.

The current filtering pattern: ignore the gitignores and files that are big in size (> 1024000 kb).

Solution

Implement an allowlist behaviour checking file extensions, we will be proactive to see which other files should be added in this list.

Filter out any files that aren't in the allowlist.

Tested by building extension locally, verified the s3 artifact size, also added unit test to reflect this behaviour.

Follow up: emit telemetry event, once it's defined.

License

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


Tested using the same repository, but 2 different extension version

Before, master branch behaviour Screenshot 2024-06-27 at 12 37 09 PM

After, wlsun/filter-non-code-files-feature-dev branch behaviour Screenshot 2024-06-27 at 12 37 04 PM

justinmk3 commented 1 week ago

this has customer/product impact, right? so "chore" is not the right category. it's either a "fix" or a "feat".

willyyhuang commented 6 days ago

this has customer/product impact, right? so "chore" is not the right category. it's either a "fix" or a "feat".

fixed, thanks!