Skip to content

fix(storage): forward RekorEntry to signature bundle in sigstore-bundle mode#1831

Open
anithapriyanatarajan wants to merge 1 commit into
tektoncd:mainfrom
anithapriyanatarajan:fix/oci-sig-bundle-tlog-entry
Open

fix(storage): forward RekorEntry to signature bundle in sigstore-bundle mode#1831
anithapriyanatarajan wants to merge 1 commit into
tektoncd:mainfrom
anithapriyanatarajan:fix/oci-sig-bundle-tlog-entry

Conversation

@anithapriyanatarajan

Copy link
Copy Markdown
Contributor

Changes

In the OCI sigstore-bundle encoding path (#1691), the signature bundle was stored without a transparency log entry (tlogEntries=[]) even when Rekor upload had succeeded.

Root cause: legacy.go uploadSignature constructed the signing.Bundle for the StoreRequest without setting RekorEntry, so storeWithSigstoreBundle always received a nil RekorEntry and makeSigBundleBytes passed nil to cbundle.MakeProtobufBundle, producing a bundle with no tlogEntries.

The attestation path was unaffected: storeWithProtobufBundle in attestation.go already read req.Bundle.RekorEntry directly from the StorageOpts-populated field added in #1691.

Fix: set RekorEntry: storageOpts.RekorEntry in the signing.Bundle constructed by uploadSignature. The field is nil-safe: MakeProtobufBundle skips tlog embedding when rekorEntry is nil, so behaviour is unchanged when transparency is disabled or Rekor upload failed.

Also correct two log messages in attestation.go that referred to "protobuf bundle format" instead of the user-facing term "sigstore bundle format" used elsewhere.

Add TestMakeSigBundleBytes_TlogEntries to guard the nil-rekorEntry path and document the expected behaviour.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

Assisted-by: Claude Sonnet 4.6 (via GitHub Copilot)

…le mode

In the OCI sigstore-bundle encoding path, the signature bundle was
stored without a transparency log entry (tlogEntries=[]) even when
Rekor upload had succeeded.

Root cause: legacy.go uploadSignature constructed the signing.Bundle
for the StoreRequest without setting RekorEntry, so
storeWithSigstoreBundle always received a nil RekorEntry and
makeSigBundleBytes passed nil to cbundle.MakeProtobufBundle, producing
a bundle with no tlogEntries.

The attestation path was unaffected: storeWithProtobufBundle in
attestation.go already read req.Bundle.RekorEntry directly from the
StorageOpts-populated field added in tektoncd#1691.

Fix: set RekorEntry: storageOpts.RekorEntry in the signing.Bundle
constructed by uploadSignature. The field is nil-safe:
MakeProtobufBundle skips tlog embedding when rekorEntry is nil, so
behaviour is unchanged when transparency is disabled or Rekor upload
failed.

Also correct two log messages in attestation.go that referred to
"protobuf bundle format" instead of the user-facing term
"sigstore bundle format" used elsewhere.

Add TestMakeSigBundleBytes_TlogEntries to guard the nil-rekorEntry
path and document the expected behaviour.

Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
Assisted-by: Claude Sonnet 4.6 (via GitHub Copilot)
Signed-off-by: Anitha Natarajan <anataraj@redhat.com>
@tekton-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please ask for approval from anithapriyanatarajan after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 24, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.94%. Comparing base (b5ecaf7) to head (7f6638b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1831   +/-   ##
=======================================
  Coverage   61.93%   61.94%           
=======================================
  Files          64       64           
  Lines        4067     4068    +1     
=======================================
+ Hits         2519     2520    +1     
  Misses       1266     1266           
  Partials      282      282           
Flag Coverage Δ
unit-tests 61.94% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants