buildkite / buildkite/agent

Print a checksum of the artifact when uploading and downloading it

Open
#2,706 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.1k
Forks
378
Avg merge
2d 6h
Merged PRs (30d)
74

Description

**Is your feature request related to a problem? Please describe.**

I'm trying to debug an apparent problem in either my Buildkite pipeline or in the buildkite-agent binary where one of our artifacts is getting corrupted. It would be useful to know at what point the corruption happens (before the upload? after the download? etc.)

**Describe the solution you'd like**

When running `buildkite-agent artifact upload` or `buildkite-agent artifact download`, print a checksum of the file (for example, a SHA256 checksum). Right now, the only "checksum" printed is the abbreviated size of the artifact (e.g. 36 KiB).

I'm attempting to debug an issue where the artifact uploaded from one step has a size equal (down to the last byte) to the same artifact when downloaded on a subsequent step, but somehow certain bytes are different.

A checksum would be useful to know if somehow the archive is getting corrupted after the download step.

**Describe alternatives you've considered**

The current alternative is to just print the (rounded) size of the artifact, which is not precise enough to detect a difference in size of e.g. one byte, nor enough to detect a difference when the sizes are equal.

**Additional context**

If you're curious about the underlying corruption in the artifacts, see here:

- [Where we upload it](https://buildkite.com/sorbet/sorbet/builds/30749#018e7e55-afcc-439c-8bdf-624006f853eb/320-326)
- [Where we download it](https://buildkite.com/sorbet/sorbet/builds/30749#018e7e55-afe3-458a-93eb-3652dca5f399/96-103)
- [Where we realize it's corrupted](https://buildkite.com/sorbet/sorbet/builds/30749#018e7e55-afe3-458a-93eb-3652dca5f399/127-161)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.