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

Enable auto-select support in ClusterTask/TaskRun if only one is present #1154

Merged

Conversation

vinamra28
Copy link
Member

@vinamra28 vinamra28 commented Sep 9, 2020

Changes

  • When only one clustertask is present then instead of prompting to user to select the clustertask at the time of running the clustertask describe command then clustertask will be autoselected and the output will be displayed.
  • When only one taskrun is present then instead of prompting to user to select the taskrun at the time of running the taskrun describe command then taskrun will be autoselected and the output will be displayed.
  • Also extracted allClusterTaskNames function from pkg/cmd/clustertask/delete.go to pkg/clustertask/clustertask.go in order to maintain the code consistency and also added unit tests for it.

Closes #1112

Signed-off-by: vinamra28 vinjain@redhat.com

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

- Enable auto-select support in ClusterTask describe command if only one is present
- Enable auto-select support in TaskRun describe command if only one is present

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Sep 9, 2020
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 9, 2020
@vinamra28 vinamra28 force-pushed the vinamra28/auto-select-describe branch from ab95c19 to 06740b2 Compare September 9, 2020 05:05
@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/clustertask/clustertask.go 66.7% 53.1% -13.6
pkg/cmd/clustertask/describe.go 66.1% 67.2% 1.0

@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/clustertask/clustertask.go 66.7% 53.1% -13.6
pkg/cmd/clustertask/describe.go 66.1% 67.2% 1.0

@vinamra28 vinamra28 force-pushed the vinamra28/auto-select-describe branch from 06740b2 to 4a8df0f Compare September 9, 2020 05:24
@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/clustertask/clustertask.go 66.7% 69.4% 2.7
pkg/cmd/clustertask/describe.go 66.1% 67.2% 1.0

@vinamra28 vinamra28 force-pushed the vinamra28/auto-select-describe branch from 4a8df0f to d191e82 Compare September 9, 2020 07:09
@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/clustertask/clustertask.go 66.7% 69.4% 2.7
pkg/cmd/clustertask/delete.go 92.6% 93.6% 1.0
pkg/cmd/clustertask/describe.go 66.1% 70.3% 4.2

@vinamra28 vinamra28 changed the title WIP: Enable auto-select support in ClusterTask/TaskRun if only one is present Enable auto-select support in ClusterTask/TaskRun if only one is present Sep 9, 2020
@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 Sep 9, 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/clustertask/clustertask.go 66.7% 69.4% 2.7
pkg/cmd/clustertask/delete.go 92.6% 93.6% 1.0
pkg/cmd/clustertask/describe.go 66.1% 70.3% 4.2
pkg/cmd/taskrun/describe.go 58.0% 60.0% 2.0

pkg/clustertask/clustertask.go Outdated Show resolved Hide resolved
pkg/cmd/clustertask/describe.go Outdated Show resolved Hide resolved
pkg/cmd/clustertask/describe_test.go Outdated Show resolved Hide resolved
When only one clustertask is present then instead of prompting to user to select the clustertask at the time of running the clustertask describe command then clustertask will be autoselected and the output will be displayed. Also extracted to allClusterTaskNames function from pkg/cmd/clustertask/delete.go to pkg/clustertask/clustertask.go in order to maintain code consistency and also added unit tests for the same.

Signed-off-by: vinamra28 <vinjain@redhat.com>
@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/clustertask/clustertask.go 66.7% 69.4% 2.7
pkg/cmd/clustertask/delete.go 92.6% 93.6% 1.0
pkg/cmd/clustertask/describe.go 66.1% 73.8% 7.6
pkg/cmd/taskrun/describe.go 58.0% 60.0% 2.0

When only one taskrun is present then instead of prompting to user to select the taskrun at the time of running the taskrun describe command it will be autoselected and the output will be displayed.

Signed-off-by: vinamra28 <vinjain@redhat.com>
@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/clustertask/clustertask.go 66.7% 69.4% 2.7
pkg/cmd/clustertask/delete.go 92.6% 93.6% 1.0
pkg/cmd/clustertask/describe.go 66.1% 73.8% 7.6
pkg/cmd/taskrun/describe.go 58.0% 64.7% 6.7

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 14, 2020
Copy link
Contributor

@piyush-garg piyush-garg 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 Sep 16, 2020
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielhelfand, piyush-garg

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:
  • OWNERS [danielhelfand,piyush-garg]

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 merged commit 4881d88 into tektoncd:master Sep 16, 2020
danielhelfand added a commit that referenced this pull request Sep 30, 2020
#1167 | [Daniel Helfand] update condition tests from test builders to structs | 2020/09/16-11:10
#1154 | [vinamra28] Enable auto-select support in ClusterTaskDescribe if only one is present | 2020/09/16-17:00
#1154 | [vinamra28] Enable auto-select support in TaskRunDescribe if only one is present | 2020/09/16-17:00
#1173 | [Daniel Helfand] update README versions for v0.12.1 | 2020/09/16-17:21
#1176 | [Bart] Artwork/Logo added to the top of the README. | 2020/09/16-18:14
#1172 | [Chmouel Boudjnah] Fix rpm build for release | 2020/09/17-14:34
#1168 | [Daniel Helfand] update clustertask tests from test builders to structs | 2020/09/18-13:26
#1177 | [Vincent Demeester] tests: import pipeline internal builders 🏒 | 2020/09/18-17:31
#1179 | [vinamra28] Use --prefix-name option for tkn clustertask start | 2020/09/18-23:07
#1182 | [Daniel Helfand] update pipelineresource tests from test builders to structs | 2020/09/21-14:29
null | [Vincent Demeester] Remove release-note block indentation in PR template 🌮 | 2020/09/22-11:57
null | [savitaashture] Modify tkn version to accept ldflag and namespace flag | 2020/09/24-10:14
null | [savitaashture] Fix deployment fetch issue for multiple namespaces | 2020/09/25-11:54
null | [PuneetPunamiya] This patch fixes: | 2020/09/28-19:27
null | [Divyansh42] Modify tkn version output to hide Triggers and Dashboard version if they are not installed and added required unit tests. | 2020/09/29-04:57
null | [Piyush Garg] Bump pipeline and triggers dep | 2020/09/29-13:55
null | [Divyansh42] Enable auto-select support in pipelineDescribe if only one pipeline is present | 2020/09/29-17:29
null | [vinamra28] Add --use-taskrun for ClusterTask start | 2020/09/30-11:08
null | [Divyansh42] Enable auto select support in PipelineRunDescribe if only one PipelineRun is present | 2020/09/30-13:13

Signed-off-by: Daniel Helfand <helfand.4@gmail.com>
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Enable auto selection of the ClusterTask/TaskRun for describe command if only one is present
4 participants