jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
519 stars 224 forks source link

Issues using `--archive=zip` flag in the upload command #2538

Open yahavi opened 1 month ago

yahavi commented 1 month ago

Describe the bug

In the CreateUploadAsZipFunc, there are a couple of display and efficiency issues.

Current behavior

  1. While uploading a directory with the --archive=zip flag, the progress bar updates for each file being read. image
  2. It seems like there's excessive reading of files. We call readFilesAsZip twice.
  3. There's a possibility that the getReaderFunc function in uploadFileFromReader is invoked multiple times in the retry executor uploadFileFromReader, leading to reading all files again and again.

Reproduction steps

Upload your ~/.m2/repository directory to a generic repository in Artifactory. For example: jf rt u ~/.m2/repository/ generic-local/repo.zip --archive=zip --threads 1

Expected behavior

  1. Perhaps we should consider consolidating the progress into one for all files.
  2. It might be more efficient to create the zip once and perform a checksum upload.
  3. This could be resolved by simply reading and uploading the archive instead of all individual files.

JFrog CLI version

2.56.0

Operating system type and version

MacOS

JFrog Artifactory version

N/A

JFrog Xray version

N/A