Skip to content

fix(ci): fix broken release, address issue during attestation step#1589

Merged
viccuad merged 2 commits intokubewarden:mainfrom
flavio:fix-attestation-during-release
Mar 19, 2026
Merged

fix(ci): fix broken release, address issue during attestation step#1589
viccuad merged 2 commits intokubewarden:mainfrom
flavio:fix-attestation-during-release

Conversation

@flavio
Copy link
Copy Markdown
Member

@flavio flavio commented Mar 18, 2026

The SLSA provenance predicate was changed to a different value, this caused a digest to be empty, leading to a cascaded failure.

  • Replace slsa.dev/provenance/v0.2 with v1 (docker/build-push-action v6 generates v1): this is the actual fix
  • Add empty-digest guards on attestation, provenance, and SBOM lookup steps: this will provide a more clear message if something like that happens again.
  • Add missing -r flag to jq in SBOM digest step: this is a minor improvemnt. It prevents double quuotes to land into the crane command later on.

The SLSA provenance predicate was changed to a different value, this
caused a digest to be empty, leading to a cascaded failure.

- Replace `slsa.dev/provenance/v0.2` with `v1` (`docker/build-push-action` v6 generates v1): this is the
  actual fix
- Add empty-digest guards on attestation, provenance, and SBOM lookup steps: this will
  provide a more clear message if something like that happens again.
- Add missing `-r` flag to jq in SBOM digest step: this is a minor
  improvemnt. It prevents double quuotes to land into the `crane`
  command later on.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Assisted-by: Claude Sonnet 4.6
@flavio flavio requested a review from a team as a code owner March 18, 2026 18:09
Copilot AI review requested due to automatic review settings March 18, 2026 18:09
@flavio flavio self-assigned this Mar 18, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a broken release workflow by aligning SLSA predicate-type detection with the provenance version produced by current container build tooling, and improves failure diagnostics when expected digests/attestations are missing.

Changes:

  • Update provenance predicate lookup from https://slsa.dev/provenance/v0.2 to https://slsa.dev/provenance/v1.
  • Add guards to fail early with clearer error messages when attestation/provenance/SBOM digests are empty.
  • Use jq -r for SBOM digest extraction to avoid quoted output being passed into later commands.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/attestation.yml Outdated
Comment on lines +82 to +83
DIGEST=$(crane manifest ghcr.io/${{github.repository_owner}}/${{ inputs.component }}@${{ env.ATTESTATION_MANIFEST_DIGEST}} | \
jq '.layers | map(select(.annotations["in-toto.io/predicate-type"] == "https://spdx.dev/Document")) | map(.digest) | join(" ")')
jq -r '.layers | map(select(.annotations["in-toto.io/predicate-type"] == "https://spdx.dev/Document")) | map(.digest) | join(" ")')
Copy link
Copy Markdown
Member

@viccuad viccuad Mar 19, 2026

Choose a reason for hiding this comment

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

This concern is valid, although we don't hit it for now. Tried locally the command, and it has a syntax error. It should be:

$ crane manifest ghcr.io/kubewarden/policy-server@sha256:b26b51ad913d21eccfdda6637e6783b8a04801dcb4c71adea59739d5df14c2dc | jq -r '.layers | map(select(.annotations["in-toto.io/predicate-type"] == "https://spdx.dev/Document")) | map(.digest) | if length == 0 then empty elif length == 1 then .[0] else error("ERROR: Multiple SBOM layers found in attestation manifest") end'
sha256:ba74f6c49f8403307a17f02db70f01be6e3ca551eb6c89b00a1f93f0fae437b7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added it with 7cff672

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.93%. Comparing base (e9a6208) to head (7cff672).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1589      +/-   ##
==========================================
- Coverage   80.02%   79.93%   -0.09%     
==========================================
  Files         127      127              
  Lines       16573    16573              
==========================================
- Hits        13262    13248      -14     
- Misses       3311     3325      +14     
Flag Coverage Δ
rust-tests 79.93% <ø> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@viccuad viccuad mentioned this pull request Mar 19, 2026
9 tasks
Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
@viccuad viccuad force-pushed the fix-attestation-during-release branch from 7fc419a to 7cff672 Compare March 19, 2026 09:36
Copy link
Copy Markdown
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

Thanks again for the investigation!

@viccuad viccuad merged commit 6e717c0 into kubewarden:main Mar 19, 2026
25 checks passed
@github-project-automation github-project-automation Bot moved this from Pending review to Done in Kubewarden Admission Controller Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants