Skip to content
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

Merged

Conversation

shuheiktgw
Copy link
Contributor

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 30, 2019

CLA Check
All committers are now authorized under a signed CLA.

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 30, 2019
@@ -91,11 +91,11 @@ func TestPipelinesDescribe_with_run(t *testing.T) {
}

expected := []string{
"Name: pipeline",
"Name: pipeline",
Copy link
Contributor Author

@shuheiktgw shuheiktgw Jun 30, 2019

Choose a reason for hiding this comment

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

"Tasks",
"No tasks found\n",
"No tasks\n",
Copy link
Contributor Author

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

@hrishin
Copy link
Member

hrishin commented Jun 30, 2019

/ok-to-test

@tekton-robot tekton-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 30, 2019
Copy link
Member

@hrishin hrishin left a comment

Choose a reason for hiding this comment

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

if len(runs.Items) == 0 {
fmt.Fprintln(w, "No runs found")
return
panic(err)
Copy link
Member

@hrishin hrishin Jun 30, 2019

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? 🤔

Copy link
Member

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)

Copy link
Member

Choose a reason for hiding this comment

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

How about #132

Copy link
Contributor Author

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!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

@hrishin
Copy link
Member

hrishin commented Jul 1, 2019

/lgtm

@sthaha one more review round?

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 1, 2019
Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2019
@tekton-robot tekton-robot merged commit 23fce06 into tektoncd:master Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants