aws-greengrass-gdk-cli icon indicating copy to clipboard operation
aws-greengrass-gdk-cli copied to clipboard

(gdk): `component build` Hidden directories are included in component's zip artifact when using 'zip' build system

Open jfduque opened this issue 2 years ago • 2 comments

https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/a2b4a4b7b6867a39e12d52a2a3997b9a4a605ac2/gdk/commands/component/BuildCommand.py#L221

Describe the bug Hidden directories in the component's root directory should not be included in the component's zip artifact

To Reproduce Run gdk component publish with some hidden folder (.venv, .cache, .git) in the component's root directory

Expected behavior Component's zip artifact should not include hidden files and directories

Actual behavior Component's zip artifact includes hidden files and directories, causing excessive file size

jfduque avatar Oct 01 '22 20:10 jfduque

Hey @jfduque,

Thanks for pointing this out, the team will look into this.

Nelsonochoam avatar Oct 04 '22 16:10 Nelsonochoam

Hi, @Nelsonochoam
we encounter the "excessive file size" issue mentioned by @jfduque A proposed solution is to modify https://github.com/aws-greengrass/aws-greengrass-gdk-cli/blob/a2b4a4b7b6867a39e12d52a2a3997b9a4a605ac2/gdk/commands/component/BuildCommand.py#L183 into shutil.copytree(utils.current_directory, artifacts_zip_build, ignore=shutil.ignore_patterns(*self._ignore_files_during_zip(None, None)))

wengchenyang1 avatar Oct 10 '22 17:10 wengchenyang1

This is fixed in GDK 1.2.0.

saranyailla avatar Mar 01 '23 19:03 saranyailla