feat: added support for --output json and --output yaml for cancel command for pipelinerun and taskrun - #3241
Conversation
|
/hold Note: This PR depends on |
There was a problem hiding this comment.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Generated command documentation is stale, and SetTypeMeta does not support pointer slices as its generic API implies.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Balanced
78e6c22 to
d5ff20c
Compare
d5ff20c to
d57c9f7
Compare
|
/unhold |
d57c9f7 to
682df74
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pratap0007 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold We might need to re-think on the output format to meet the k8s standards. We can remove the hold once we conculde the discussion |
98e9e41 to
021f76e
Compare
|
@vdemeester the format is now updated for -o yaml and -o json for the format mentioned here |
|
/lgtm |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
TaskRun structured output does not match the documented status contract, and the helper documentation contains stale API references.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (4)
Use consistent Cancelled value in TaskRun status output · New Remove documentation references to nonexistent managed-fields helpers · New The new flag and examples are absent from the checked-indocs/cmd/tkn_taskrun_cancel.mdand… The new flag and examples are absent from the checked-indocs/cmd/tkn_pipelinerun_cancel.mdand…
Resolved since last review (1)
021f76e to
e36d5bd
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
TaskRun reports an inaccurate requested status, and PipelineRun grace statuses lack structured-output test coverage.
Review effort: Balanced
Findings: None
Resolved since last review (4)
Use consistent Cancelled value in TaskRun status output Remove documentation references to nonexistent managed-fields helpers The new flag and examples are absent from the checked-indocs/cmd/tkn_taskrun_cancel.mdand… The new flag and examples are absent from the checked-indocs/cmd/tkn_pipelinerun_cancel.mdand…
|
/retest |
|
/hold cancel |
|
/retest |
|
/lgtm Thanks @anwesha-palit-redhat |
…mmand for pipelinerun and taskrun
e36d5bd to
916fe57
Compare
|
/lgtm |


Changes
Added
-o/--outputflag topipelinerun cancelandtaskrun cancel.--output jsonor--output yamlis set, prints a structured result instead of the plain-text message.--outputflag) is unchanged — still printsPipelineRun cancelled:--outputvalues (e.g.csv) return a clear error:--output, so failures are never mistaken for valid structured output:pkg/formatted.PrintStructuredOutput/IsStructuredhelpers; introduces aCancelResult{Kind, Name, Status}struct local to each command package.--helpexamples for both commands to demonstrate-o json/-o yamlusage.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