Skip to content

fix(apis): allow debug.breakpoints.beforeSteps without onFailure - #10909

Open
NUAAwqy wants to merge 2 commits into
tektoncd:mainfrom
NUAAwqy:fix-taskrun-debug-breakpoints-beforesteps
Open

NUAAwqy wants to merge 2 commits into
tektoncd:mainfrom
NUAAwqy:fix-taskrun-debug-breakpoints-beforesteps

Conversation

@NUAAwqy

@NUAAwqy NUAAwqy commented Oct 17, 2026 •

Copy link
Copy Markdown

Problem

TaskRun validation rejects any debug.breakpoints block that does not set onFailure, so this valid configuration is refused:

spec:
  debug:
    breakpoints:
      beforeSteps:
        - my-step

validateDebug returns "onFailure breakpoint is empty, it is only allowed to be set as enabled" whenever breakpoints is non-nil and onFailure is empty. Both breakpoint fields are optional per TEP-0097, and the reconciler/entrypoint already treat them independently - only the validation gate couples them.

Fix

Validate onFailure only when it is explicitly set, in both pkg/apis/pipeline/v1 and pkg/apis/pipeline/v1beta1. The existing rule that a non-empty onFailure must equal enabled is unchanged.

Testing

Replaced the "empty onFailure breakpoint" table case with a valid beforeSteps-only case.

$ go test ./pkg/apis/pipeline/v1/... ./pkg/apis/pipeline/v1beta1/...

(passes; output in CI)

Fixes #9719

Fixes the issue described in this PR (see description above).

/kind bug

TaskRun validation rejected any debug.breakpoints block that did not
set onFailure, even though both breakpoint fields are optional per
TEP-0097 and the reconciler treats them independently. This forced
users to also set onFailure=enabled just to use beforeSteps.

Validate onFailure only when it is explicitly set, in both the v1 and
v1beta1 TaskRun validation, and replace the table test case that
asserted the coupling with a valid beforeSteps-only case.

Signed-off-by: NUAAwqy <146524024+NUAAwqy@users.noreply.github.com>
@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Oct 17, 2026
@tekton-robot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign dibyom after the PR has been reviewed.
You can assign the PR to them by writing /assign @dibyom 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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: NUAAwqy / name: NUAAwqy (c93b68c)

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 17, 2026
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 21, 2026
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.74%. Comparing base (42b45a0) to head (c93b68c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10909      +/-   ##
==========================================
- Coverage   90.74%   90.74%   -0.01%     
==========================================
  Files         298      298              
  Lines       22603    22599       -4     
==========================================
- Hits        20512    20508       -4     
  Misses       2089     2089              
  Partials        2        2              
Flag Coverage Δ
unit-tests 90.74% <ø> (-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.

@NUAAwqy

NUAAwqy commented Oct 22, 2026

Copy link
Copy Markdown
Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debug validation bug: beforeSteps cannot be used without onFailure

2 participants