Skip to content

feat: support structured JSON/YAML output for bulk delete operations - #3334

Open
arvindk-softwaredev wants to merge 1 commit into
tektoncd:mainfrom
arvindk-softwaredev:feat/structuredOutput-delete-command
Open

arvindk-softwaredev wants to merge 1 commit into
tektoncd:mainfrom
arvindk-softwaredev:feat/structuredOutput-delete-command

Conversation

@arvindk-softwaredev

@arvindk-softwaredev arvindk-softwaredev commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2850

Changes

Extend -o json/yaml support to bulk delete --all scenarios across task, pipeline,
pipelinerun, eventlistener, triggerbinding, triggertemplate, and
clustertriggerbinding delete commands.

TaskRun is excluded (covered by #3086).

The bulk delete result is returned as machine-readable output.
-o json/-o yaml skips the confirmation prompt (same as -f) so the
command can run non-interactively.

Example:

$ tkn pipelinerun delete --all -n ns -o json
{
    "deleted": [
        "foo1",
        "bar2"
    ]
}
$ tkn pipelinerun delete --all -n ns -o yaml
deleted:
- foo1
- bar2

Above output structure is the same for all resources.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Run the code checkers with make check
  • Regenerate the manpages, docs and go formatting with make generated
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

Add --output json/yaml support for bulk delete commands with --all flag across
task, pipeline, pipelinerun, eventlistener,
triggerbinding, triggertemplate, and clustertriggerbinding.
Using -o skips the confirmation prompt.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 8, 2026
@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 vinamra28 after the PR has been reviewed.
You can assign the PR to them by writing /assign @vinamra28 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

@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 8, 2026
@arvindk-softwaredev
arvindk-softwaredev marked this pull request as draft October 8, 2026 10:27
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 8, 2026
@arvindk-softwaredev
arvindk-softwaredev force-pushed the feat/structuredOutput-delete-command branch from ce3e614 to a1a845c Compare October 8, 2026 10:44
@arvindk-softwaredev

arvindk-softwaredev commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Note : This PR extends support for -o json/yaml for the bulk delete on top of PR for delete command - #3318

Hence this contains multiple commits, which will be rebased after #3318 is merged

This PR is rebased with main

@arvindk-softwaredev
arvindk-softwaredev marked this pull request as ready for review October 8, 2026 10:50
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 8, 2026
@arvindk-softwaredev

Copy link
Copy Markdown
Contributor Author

/retest

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 8, 2026
@arvindk-softwaredev
arvindk-softwaredev force-pushed the feat/structuredOutput-delete-command branch from a1a845c to 1f23a1e Compare October 9, 2026 04:44
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 9, 2026
@arvindk-softwaredev

Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@divyansh42

Copy link
Copy Markdown
Member

/retest

@divyansh42

Copy link
Copy Markdown
Member

/retest

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

PipelineRun retention can bypass structured output, and the release note incorrectly claims CustomRun bulk support.

2 open findings
What changed in this PR

Extends machine-readable JSON/YAML output to bulk delete operations across Tekton CLI resources.

Changes:

  • Enables structured output for bulk deletion and skips confirmation prompts.
  • Adds coverage for JSON/YAML output, selectors, retention, and partial failures.
  • Regenerates command and manpage documentation.
File Description
pkg/​cmd/​triggertemplate/​delete.go Enables structured bulk-delete output.
pkg/​cmd/​triggertemplate/​delete_test.go Tests JSON/YAML bulk deletion.
pkg/​cmd/​triggerbinding/​delete.go Enables structured bulk-delete output.
pkg/​cmd/​triggerbinding/​delete_test.go Tests JSON/YAML bulk deletion.
pkg/​cmd/​task/​delete.go Adds structured --all results.
pkg/​cmd/​task/​delete_test.go Tests Task bulk output and validation.
pkg/​cmd/​pipelinerun/​delete.go Adds structured bulk and filtered results.
pkg/​cmd/​pipelinerun/​delete_test.go Tests bulk, retention, selectors, and failures.
pkg/​cmd/​pipeline/​delete.go Adds structured --all results.
pkg/​cmd/​pipeline/​delete_test.go Tests output, validation, and partial failures.
pkg/​cmd/​eventlistener/​delete.go Enables structured bulk-delete output.
pkg/​cmd/​eventlistener/​delete_test.go Tests JSON/YAML bulk deletion.
pkg/​cmd/​clustertriggerbinding/​delete.go Enables cluster-wide structured deletion.
pkg/​cmd/​clustertriggerbinding/​delete_test.go Tests JSON/YAML bulk deletion.
docs/​man/​man1/​tkn-triggertemplate-delete.1 Documents bulk structured output.
docs/​man/​man1/​tkn-triggerbinding-delete.1 Documents bulk structured output.
docs/​man/​man1/​tkn-task-delete.1 Documents bulk and related output.
docs/​man/​man1/​tkn-pipelinerun-delete.1 Documents bulk and filtered output.
docs/​man/​man1/​tkn-pipeline-delete.1 Documents bulk and related output.
docs/​man/​man1/​tkn-eventlistener-delete.1 Documents bulk structured output.
docs/​man/​man1/​tkn-clustertriggerbinding-delete.1 Documents cluster-wide output.
docs/​cmd/​tkn_triggertemplate_delete.md Updates command examples.
docs/​cmd/​tkn_triggerbinding_delete.md Updates command examples.
docs/​cmd/​tkn_task_delete.md Updates command examples.
docs/​cmd/​tkn_pipelinerun_delete.md Updates command examples.
docs/​cmd/​tkn_pipeline_delete.md Updates command examples.
docs/​cmd/​tkn_eventlistener_delete.md Updates command examples.
docs/​cmd/​tkn_clustertriggerbinding_delete.md Updates command examples.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/cmd/pipelinerun/delete.go
Comment thread pkg/cmd/pipeline/delete.go
Extend -o json/yaml support to bulk delete scenarios across task, pipeline,
pipelinerun, eventlistener, triggerbinding, triggertemplate, and
clustertriggerbinding delete commands.

Signed-off-by: Arvind Krishnamurthy <arvkrish@redhat.com>
Assisted-by: Grok 4.7 (via Cursor)
@arvindk-softwaredev
arvindk-softwaredev force-pushed the feat/structuredOutput-delete-command branch from 1f23a1e to 02bed88 Compare October 12, 2026 13:00
@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 12, 2026
@divyansh42

Copy link
Copy Markdown
Member

/retest

@divyansh42
divyansh42 requested a balanced review from Copilot October 12, 2026 15:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation consistently emits structured successful-deletion results and includes comprehensive regression coverage and generated documentation.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

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

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants