Skip to content

composefs-oci: Use OCI Digest type for SHA-256 content digests - #278

Merged
cgwalters merged 4 commits into
composefs:mainfrom
cgwalters:oci-digest-cleanup
Apr 2, 2026
Merged

cgwalters merged 4 commits into
composefs:mainfrom
cgwalters:oci-digest-cleanup

Conversation

@cgwalters

Copy link
Copy Markdown
Collaborator

Motivated by a discussion in bootc where we were parsing a digest into a String.

We should use newtype wrappers for this in general because it's important to understand what places expect a digest.

Also of note, we want to support sha512 for OCI descriptors as well, so any place that hardcodes sha256 is in general wrong.

Assisted-by: OpenCode (Claude Opus 4)

@cgwalters
cgwalters force-pushed the oci-digest-cleanup branch from a9b1c1e to 749466a Compare April 1, 2026 14:36
@cgwalters
cgwalters requested a review from jeckersb April 1, 2026 14:36
@cgwalters
cgwalters force-pushed the oci-digest-cleanup branch 2 times, most recently from c9ed86f to 281d143 Compare April 1, 2026 15:53

@jeckersb jeckersb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me, just two spots where I think we probably don't want to ignore errors.

Comment thread crates/composefs-oci/src/oci_image.rs Resolved
Comment thread crates/composefs-oci/src/oci_image.rs Resolved
@cgwalters
cgwalters force-pushed the oci-digest-cleanup branch 3 times, most recently from d0bbad3 to 8a81a3c Compare April 1, 2026 20:47
@cgwalters
cgwalters enabled auto-merge April 1, 2026 21:19
Comment thread crates/cfsctl/src/lib.rs Resolved
@cgwalters
cgwalters force-pushed the oci-digest-cleanup branch 2 times, most recently from 255e11e to a925736 Compare April 2, 2026 13:02
Johan-Liebert1
Johan-Liebert1 previously approved these changes Apr 2, 2026

@Johan-Liebert1 Johan-Liebert1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests seem to be failing due to feature gating. Approving this so as to not block it from being merged after tests pass

@Johan-Liebert1
Johan-Liebert1 disabled auto-merge April 2, 2026 13:23
Motivated by an agent wanting to use `std::env::set_var`.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <[email protected]>
Motivated by a discussion in bootc where we were parsing a digest into
a String.

We should use newtype wrappers for this in general because it's
important to understand what places expect a digest. Also of note, we
want to support sha512 for OCI descriptors as well, so any place that
hardcodes sha256 is in general wrong.

Introduce OciReference enum in cfsctl using the `@` prefix to
unambiguously distinguish digests (`@sha256:abc...`) from named refs.
This differs from the podman/docker convention where `@` appears
between name and digest; here it is always a leading prefix. Ref names
must not start with `@`; this is enforced by tag_image/write_manifest
and flagged by fsck. CLI fields that always take a digest now use
OciDigest directly via clap's value_parser.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <[email protected]>
Fix collapsible_if warnings in composefs-http and cfsctl. Simplify the
fedora CI job to run `just check` (which includes build, clippy,
fmt-check, feature combos, and tests) instead of running each step
separately.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <[email protected]>
@jeckersb

jeckersb commented Apr 2, 2026

Copy link
Copy Markdown
Collaborator

Worth noting that the reverse dependency test broke in #268 since it changed the signature for set_insecure() and is not related to this change.

@cgwalters
cgwalters enabled auto-merge April 2, 2026 14:54
@cgwalters

Copy link
Copy Markdown
Collaborator Author

Worth noting that the reverse dependency test broke in #268 since it changed the signature for set_insecure() and is not related to this change.

Yeah, I'm trying to start a branch for fixing the revdep test in https://github.com/bootc-dev/bootc/actions/runs/23874139671/job/69615292829?pr=2113 but the thing is all these changes tie together and snowball, so what I'd like to do is land as much as possible here, then circle back with consolidated bootc side changes.

Maybe I'll just disable the revdep test here for now.

The OCI digest cleanup breaks the bootc API boundary. Re-enable
once bootc-dev/bootc#2044 lands on bootc main.

Assisted-by: OpenCode (Claude Opus 4)
Signed-off-by: Colin Walters <[email protected]>
@cgwalters
cgwalters added this pull request to the merge queue Apr 2, 2026
Merged via the queue into composefs:main with commit 0759ceb Apr 2, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants