← Back to issue list

Add source-checksum option

View original Github issue

Metadata

Project
snapcraft
Number
#619
Type
pull request
State
closed
Author
tsimonq2
Labels
Created
Updated
Closed

Current evaluation

Adding a source-checksum option for download integrity was closed due to inactivity. Reviewers requested naming adjustments and SHA-3 support, but the author did not address the final feedback.

Suggested action:

No scores available.

Issue body

This adds an optional `source-checksum` tag to ensure download integrity by checking the checksum. ## Features - It supports the following `source-type`s: - `source-type: tar` - `source-type: zip` - It supports the following checksums: - `md5` - `sha1` - `sha224` - `sha256` - `sha384` - `sha512` - You can use it in the following ways: - `source-checksum: HASH` - raw hash - `source-checksum: checksum.txt` - local file - `source-checksum: http(s)://example.com/checksum` - remote URL ## Failsafes It has the following failsafes to ensure the code always works as intended: - Special exception for a checksum that doesn't match - Raises an exception for a checksum that is invalid, or incompatible with the checksums supported ## Testing coverage I have the following testing in place: - Unit tests: - Testing of each checksum in raw form with a created file (tar/zip) that has a static checksum - Creation of a checksum file and checking the checksum with that local file - Pulling http://tsimonq2.net/misc/snapcraft-checksum-tar and http://tsimonq2.net/misc/snapcraft-checksum-zip respectively and checking the checksum of the static file with those - Checking for an invalid checksum - Integration tests: - Testing of each checksum in raw form with a created file (tar/zip) that has a static checksum in the `snapcraft.yaml` files for `simple-tar` and `simple-zip` ## Discrepancies between this specification and the source If you find any difference between the code in this PR and the specification above, please comment, as that wasn't intended.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Adding a source-checksum option for download integrity was closed due to inactivity. Reviewers requested naming adjustments and SHA-3 support, but the author did not address the final feedback.
qwen3.6-35b-a3b-mtp-q6 Proposed a source-checksum option for download integrity. Reviewers requested code changes and asked about SHA-3-384 autodetection. The author updated the code but did not answer, leading to closure due to inactivity.
qwen3.6-35b-a3b-mtp-q6 The source-checksum feature was abandoned. Reviewers requested refactoring and asked about sha-3 support. The author addressed initial feedback but did not respond to the final question, resulting in closure due to inactivity.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#26 sources: add support for source checksum craft-parts merged Merged: adds file checksum computation to validate the source-checksum part property. Approved by two reviewers and passed CI checks.
70%