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

Provides --last option of the describe of PipelineRun/TaskRun to describe the most recent PipelineRun/TaskRun #960

Merged
merged 1 commit into from
May 22, 2020
Merged

Provides --last option of the describe of PipelineRun/TaskRun to describe the most recent PipelineRun/TaskRun #960

merged 1 commit into from
May 22, 2020

Conversation

anshulvermapatel
Copy link
Contributor

$Title

Fixes #871

Changes

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

release-note

@tekton-robot
Copy link
Contributor

Hi @anshulvermapatel. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 4, 2020
@danielhelfand
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 5, 2020
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/describe.go 51.2% 56.0% 4.8
pkg/cmd/taskrun/describe.go 51.2% 56.0% 4.8

pkg/cmd/pipelinerun/describe_test.go Outdated Show resolved Hide resolved
version := "v1alpha1"
tdc := testDynamic.Options{}
dynamic, err := tdc.Client(
cb.UnstructuredPR(pipelineRuns[0], version),
Copy link
Member

Choose a reason for hiding this comment

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

To include all the test data, wouldn't you want the second PipelineRun as well? Not familiar with using the dynamic client with tests. /cc @pradeepitm12

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yaa, I think I should add pipelineRuns[1] as well, my bad.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, resources should be added in the dynamic client, but it is not necessary to do add all, the resources which are accessed(get, list, watch, delete, etc) with the help of the dynamic client will give return nil if the resource is not added in the test-dynamic client.
Hope this helps, for any other thing please do let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, already added.

pkg/cmd/pipelinerun/describe_test.go Show resolved Hide resolved
pkg/cmd/pipelinerun/describe_test.go Show resolved Hide resolved
pkg/cmd/pipelinerun/describe_test.go Show resolved Hide resolved
pkg/cmd/taskrun/describe_test.go Outdated Show resolved Hide resolved
pkg/cmd/taskrun/describe_test.go Show resolved Hide resolved
pkg/cmd/taskrun/describe_test.go Show resolved Hide resolved
pkg/cmd/taskrun/describe_test.go Show resolved Hide resolved
@danielhelfand
Copy link
Member

Build test failure is from go-critic. Wants you to rewrite if/else if/else as switch:

pkg/cmd/pipelinerun/describe.go:81:4: ifElseChain: rewrite if-else to switch statement (gocritic)
			if len(args) == 0 && !opts.Last {
			^
pkg/cmd/taskrun/describe.go:80:4: ifElseChain: rewrite if-else to switch statement (gocritic)
			if len(args) == 0 && !opts.Last {

@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 12, 2020
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/describe.go 51.2% 56.0% 4.8
pkg/cmd/taskrun/describe.go 51.2% 56.0% 4.8

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/describe.go 51.2% 56.0% 4.8
pkg/cmd/taskrun/describe.go 51.2% 56.0% 4.8

Copy link
Member

@danielhelfand danielhelfand left a comment

Choose a reason for hiding this comment

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

Just two last nits, and I think this should be good:

pkg/cmd/pipelinerun/describe.go Outdated Show resolved Hide resolved
pkg/cmd/taskrun/describe.go Outdated Show resolved Hide resolved
…describe the most recent PipelineRun/TaskRun

Fixes #871
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-cli-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/cmd/pipelinerun/describe.go 51.2% 56.0% 4.8
pkg/cmd/taskrun/describe.go 51.2% 56.0% 4.8

@danielhelfand
Copy link
Member

/test pull-tekton-cli-integration-tests

1 similar comment
@danielhelfand
Copy link
Member

/test pull-tekton-cli-integration-tests

Copy link
Member

@danielhelfand danielhelfand 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 tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 14, 2020
@pradeepitm12
Copy link
Contributor

@anshulvermapatel it would be really nice if you could mark all the comments as resolved. Then we can move forward with it.

@anshulvermapatel
Copy link
Contributor Author

@anshulvermapatel it would be really nice if you could mark all the comments as resolved. Then we can move forward with it.

@pradeepitm12 , Marked them resolved.

Copy link
Contributor

@pradeepitm12 pradeepitm12 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: danielhelfand

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 May 22, 2020
@tekton-robot tekton-robot merged commit b6193d2 into tektoncd:master May 22, 2020
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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--last Flag for PipelineRun/TaskRun Describe Commands
4 participants