Repository navigation
Conversation
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
itowlson
force-pushed
the
digest-digest-digest-the-word-has-lost-all-meaning-digest-digest-digest
branch
from
December 2, 2026 02:37
3ed38ac to
f64f4b6
Compare
Contributor
Author
|
While running unit tests, I found the |
lann
reviewed
Dec 2, 2026
Comment on lines
+7
to
+8
| /// A digest value in text form. The text may be a hex string | ||
| /// or may be prefixed with a scheme (e.g. `sha256:...`). |
Contributor
There was a problem hiding this comment.
I would strongly encourage storing only the prefixed form and using explicit methods to convert to/from unprefixed. I think most of the advantage of having a wrapper type like this comes from getting the same behavior out of it no matter where it was constructed.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proposes a strong-typed (well, less weakly typed) Digest type, specifically for use at cache boundaries although this has knock-on effects in a bunch of places. The idea is that Digest values can be trusted to be, well, if not yer actual digests, at least predictable in their format. It also provides some type-level documentation to make it harder to mix digests up with strings representing descriptions, component IDs, etc.
(Why yes, yes I would like types for those other things too.)
I am not sure if this particular approach is right (in various ways e.g. naming, strictness, code location) but anyway putting it up to see how folks feel about such things.
Behaviourally this is almost a pure refactoring, except that some ill-formed digests will now raise errors.