← Back to issue list

fix: prefix base digest with sha256 in OCI annotation and rock metadata

View original Github issue

Metadata

Project
rockcraft
Number
#1401
Type
pull request
State
open
Author
Shahzeb-DataEngineer
Labels
—
Created
Updated
Closed
—

Current evaluation

Prefixes base-image digests with sha256: in the OCI annotation and /.rock/metadata.yaml; tests are updated and the PR awaits maintainer review.

Suggested action: needs review

Reason: The current code emits base_digest.hex() for both values, and the proposed change adds the required sha256: prefix while updating both expectations. The author reports 91 unit tests and ruff passing, the CLA check passes, and there are no failing checks, review comments, or unresolved feedback.

Evaluated by: mr-cal-bot

Impact: 48 Quick Win: 35 Complexity: 10 Confidence: 92 Actionability: 80

Issue body

Fixes #908. `Project.generate_metadata` wrote the base image digest as bare hex in both places it is recorded: - the `org.opencontainers.image.base.digest` OCI annotation in the image manifest, and - the `base-digest` entry of `/.rock/metadata.yaml` (same problem, noted in the issue comments). OCI digests take the form `<algorithm>:<hex>`, and base images are inspected with skopeo, which reports their sha256 digest. Both values are now written as `sha256:<hex>`. Testing: updated the expectations in `tests/unit/test_project.py`; `tests/unit/test_project.py` and `tests/unit/services/test_package.py` pass (91 tests), and ruff check/format are clean on the changed files. I have signed the Canonical CLA.

Evaluation history

Date Model Scores Action Summary
minimax/minimax-m3.1-flash:free
Impact: 48
Quick Win: 35
Complexity: 10
Confidence: 92
Actionability: 80
needs review Prefixes base-image digests with sha256: in the OCI annotation and /.rock/metadata.yaml; tests are updated and the PR awaits maintainer review.

Update history

Date Change
created

Related work

  • Likely Fixed By: rockcraft#908 (confidence 100%)

    The PR explicitly says it fixes #908, whose request matches the bare-hex digest behavior in project.py.

  • Related To: rockcraft#1131 (confidence 95%)

    Merged PR #1131 introduced omission of base digest metadata for bare-based rocks; this change preserves that existing conditional.

Related issues

Issue Project State Summary Similarity
#1131 fix: remove base.digest for bare-based rocks rockcraft merged Merged PR #1131 (commit b3d29d12) by external contributor zhijie-yang: project.py now only emits base-digest metadata and the OCI org.opencontainers.image.base.digest annotation when base != 'bare'. Shipped in rockcraft 1.17.2.
78%
#46 Issues/45/add base metadata rockcraft merged Merged PR #46 (commit 24fb822f), adding base name and digest to ROCK metadata and recording the digest in labels/annotations; fixes #45.
72%
#45 fix: missing base information in the .rock metadata file rockcraft closed Fixed in merged PR #46 (commit 24fb822f), adding base and base-digest fields and annotations to .rock metadata.
72%
#908 Add `sha256` prefix to the `org.opencontainers.image.base.digest` annotations field in the image manifest. rockcraft open Add sha256 prefix to org.opencontainers.image.base.digest annotation and base-digest metadata. An open PR (#1401) addresses this.
72%