Skip to content

feat: emit a Warning event when signing fails - #2137

Open
cvas22 wants to merge 3 commits into
tektoncd:mainfrom
cvas22:feat/984-signing-failure-reason
Open

cvas22 wants to merge 3 commits into
tektoncd:mainfrom
cvas22:feat/984-signing-failure-reason

Conversation

@cvas22

@cvas22 cvas22 commented Nov 16, 2026

Copy link
Copy Markdown

Changes

When signing fails, Chains only sets chains.tekton.dev/signed: failed, so anyone without access to the controller logs has no idea why. This emits a Warning event on the TaskRun/PipelineRun with the error. The reason is SigningRetrying while there are retries left and SigningFailed once Chains gives up, so a plain kubectl describe taskrun shows things like a missing signer or a registry push error.

It uses the event recorder the generated reconcilers already put in the context, so there's nothing new to wire up, and it does nothing when there's no recorder. The message is capped at 1024 bytes since a multierror with several storage failures can get long. I added a short note to the troubleshooting section in docs/signing.md.

Fixes #984

/kind feature

Notes

Events expire, so this doesn't replace an annotation if folks want the reason kept on the object. I went with events first since they don't add to the object size (#1076). Happy to add an annotation too if you'd rather have that. Tests are added but I haven't run them locally, CI will be the first run.

I used some help from AI, please don't yell at me. Thx.

Submitter 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

Chains now emits a Warning event (reason SigningRetrying or SigningFailed) with the error on a TaskRun or PipelineRun it fails to sign.

When Chains can't sign a run it only sets chains.tekton.dev/signed=failed,
so users without access to the controller logs can't tell why.

Emit a Warning event on the TaskRun or PipelineRun with the error, using
reason SigningRetrying while retries are left and SigningFailed once Chains
gives up. The message is capped at 1024 bytes. Document it in signing.md.

Fixes tektoncd#984

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 16, 2026
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 16, 2026
@infernus01

Copy link
Copy Markdown
Member

/ok-to-test

@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.29%. Comparing base (252e2ab) to head (3ccae07).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2137      +/-   ##
==========================================
+ Coverage   80.23%   80.29%   +0.05%     
==========================================
  Files          59       59              
  Lines        3395     3410      +15     
==========================================
+ Hits         2724     2738      +14     
- Misses        669      670       +1     
  Partials        2        2              
Flag Coverage Δ
unit-tests 80.29% <ø> (+0.05%) ⬆️

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.

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Comment thread docs/signing.md Outdated

### Why did signing fail?

When Chains can't sign a run it emits a `Warning` event on the TaskRun or

@anithapriyanatarajan anithapriyanatarajan Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you trace the error exits from ObjectSigner.Sign and clarify which failures this event is intended to cover? The docs currently imply an event is emitted for any signing failure, but some errors return before the event-recording path. Please either handle the relevant early-return cases and add focused tests, or narrow the docs to describe the cases that are covered.

Ex: The event is currently emitted only on the accumulated-error path (signing.go, line 289). For example, errors from Rekor client initialization and signer wrapping return directly before reaching that path (signing.go, lines 163–169, lines 193–197).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Went with narrowing the docs in 3ccae07. They now say the event covers payload, signing, tlog and storage failures, and that early errors (no signable artifacts, Rekor client init, signer wrap) only show up in the controller logs.

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign anithapriyanatarajan after the PR has been reviewed.
You can assign the PR to them by writing /assign @anithapriyanatarajan in a comment when ready.

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

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Propagate error to Run resources

4 participants