You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix structured output handling for TaskRun deletion, keeping warnings off stdout and allowing eligible TaskRuns to be deleted when others are protected by running PipelineRuns.
Follow-up to #3086, addressing the review feedback on structured TaskRun deletion behavior.
This pull-request has been approved by:
To complete the pull request process, please assign pratap0007 after the PR has been reviewed.
You can assign the PR to them by writing /assign @pratap0007 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:
Hey @divyansh42 , I’ve opened a follow-up PR addressing the structured TaskRun deletion fixes as suggested. Whenever you get some time, could you please take a look? Thanks !
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The v1beta1 test runner ignores assertStreams, so the all-protected case can pass without verifying valid JSON output containing an empty, non-null deleted array.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
v1beta1 tests ignore stream assertions and never validate JSON output
pkg/cmd/taskrun/delete_test.go:1462
assertStreams is never read by the v1beta1 test runner, so this case checks only the returned error and passes even if stdout contains a prompt or no JSON. Handle the flag with separate SetOut/SetErr buffers and direct Execute(), as in the v1 runner. Assert that the all-protected case emits valid JSON with an empty, non-null deleted array.
Hi @divyansh42, I've addressed the remaining review suggestion and pushed the fix. The E2E workflow is now failing with a CI error, which seems unrelated to the changes in this PR. Could you please rerun the failed workflow when you get a chance? Thanks!
The reason will be displayed to describe this comment to others. Learn more.
Few improvements in the help text as well :
can we add -o yaml examples, the "Using -o json or -o yaml skips the confirmation prompt" line, and a note that TaskRuns owned by running PipelineRuns need --force ?
Also, Can we add a partial delete-failure case and one or two YAML cases
@divyansh42 I have addressed the suggested improvements, PTAL when you get a chance, Thanks!
Thanks @Debashich for doing the changes.
I think one last pending change from my side would be to add one -o yaml example to the help text (for instance tkn taskrun delete --all -n quux -o yaml )?
It is a small gap, since the prompt line mentions yaml but no example shows it. Then make generated should refresh the docs and man page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
release-noteDenotes a PR that will be considered when it comes time to generate release notes.size/LDenotes a PR that changes 100-499 lines, ignoring generated files.
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
deletedarray when no TaskRuns are deleted in structured output.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you review them:
make checkmake generatedSee [the contribution guide](https://github.com/tektoncd/cli/blob/master/CONTRIBUTING.md) for more details.
Release Notes
Follow-up to #3086, addressing the review feedback on structured TaskRun deletion behavior.