Show size of uploaded artifacts and caches in the build log
What does this MR do?
Causes gitlab-ci-multi-runner to output the size of the cache and artifact ZIP files that it uploads.
Are there points in the code the reviewer needs to double check?
- Are we happy with the output format? Adding a separate line for the file size didn't look very good to my eyes.
- Should I be smarter with the units? Intelligently display closest KiB / MiB / GiB ?
- Merging the HTTP client code in
commands/helpers/cache_archiver.go
intonetwork/gitlab.go
would permit a common approach - A new MIT-licensed dependency is introduced. It would be trivial to embed, rather than vendor, it.
- There are no tests for build log contents that I could find, so I didn't add any. We should definitely consider adding comprehensive tests for this at some point.
Why was this MR needed?
Sensible suggestion from user
What are the relevant issue numbers?
Closes #1320
Screenshots (if relevant)
Creating cache build/master...
./cache: found 1 matching files
Uploading cache.zip size=4278 bytes
# [...]
Uploading artifacts...
./artifact: found 1 matching files
Uploading artifacts to coordinator... ok id=616 responseStatus=201 Created size=4529 bytes token=Sasexv-d
Build succeeded