-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templatize describe Pipeline #131
Templatize describe Pipeline #131
Conversation
@@ -91,11 +91,11 @@ func TestPipelinesDescribe_with_run(t *testing.T) { | |||
} | |||
|
|||
expected := []string{ | |||
"Name: pipeline", | |||
"Name: pipeline", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to align with describe pipelinerun
!
https://github.com/tektoncd/cli/blob/master/pkg/cmd/pipelinerun/describe.go#L33
"Tasks", | ||
"No tasks found\n", | ||
"No tasks\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same with the comment. Since describe pipelinerun
says No resources
, I remove found
to print the same message.
https://github.com/tektoncd/cli/blob/master/pkg/cmd/pipelinerun/describe.go#L52
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/cmd/pipeline/describe.go
Outdated
if len(runs.Items) == 0 { | ||
fmt.Fprintln(w, "No runs found") | ||
return | ||
panic(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for panic instead of returning an error? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 2 places where it panics
template.Must
- within
template.Execute
see: errRecover
But errRecover does return/set the err in some cases, where we could just exit by writing StdErr
(use cli.Stream)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about #132
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! I fixed to simply return an error instead of panicing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm @sthaha one more review round? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shuheiktgw, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
I've changed to use template for describing a pipeline! Thanks! 👍
Related Issues
Related PRs
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide
for more details.