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

Add feature to start task #347

Merged
merged 1 commit into from
Oct 18, 2019
Merged

Conversation

piyush-garg
Copy link
Contributor

@piyush-garg piyush-garg commented Oct 3, 2019

Changes

This will add the feature of starting
a task or creating a taskrun from cli

Command will be like tkn task start ..

Add -i flag for input resources
Add -o flag for output resources
Add -p flag for param
Add -l flag for labels
Add --last flag for starting on basis of last run
Add -s flag for serviceaccount

Add docs and tests

Refactoring to remove duplicate code

Fix #320

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)
  • Includes docs (if user facing)
  • Regenerate the manpages and docs with make docs and make man if needed.
  • Run the code checkers with make check
  • Commit messages follow commit message best practices

See the contribution guide
for more details.

Release Notes

Feature to start task from cli

@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 3, 2019
@piyush-garg
Copy link
Contributor Author

/work-in-progress

@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/start.go 91.7% 90.7% -1.0
pkg/cmd/task/start.go Do not exist 13.5%
pkg/helper/params/mergeparams.go Do not exist 100.0%
pkg/helper/pipeline/pipelinelastrun.go 84.6% 92.3% 7.7
pkg/helper/task/tasklastrun.go Do not exist 92.3%

@piyush-garg
Copy link
Contributor Author

/status in-progress

@piyush-garg
Copy link
Contributor Author

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 3, 2019
@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 4, 2019
@piyush-garg piyush-garg changed the title Add start task feature Add feature to start task Oct 4, 2019
@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/start.go 92.0% 91.6% -0.3
pkg/cmd/task/start.go Do not exist 95.9%
pkg/helper/params/mergeparams.go Do not exist 100.0%
pkg/helper/pipeline/pipelinelastrun.go 84.6% 92.3% 7.7
pkg/helper/task/tasklastrun.go Do not exist 92.3%

@piyush-garg
Copy link
Contributor Author

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 2019
@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/start.go 92.0% 91.0% -1.0
pkg/cmd/task/start.go Do not exist 96.2%
pkg/helper/labels/mergelabels.go Do not exist 100.0%
pkg/helper/params/mergeparams.go Do not exist 100.0%
pkg/helper/pipeline/pipelinelastrun.go 84.6% 92.3% 7.7
pkg/helper/task/tasklastrun.go Do not exist 92.3%

@piyush-garg
Copy link
Contributor Author

/cc hrishin

@tekton-robot tekton-robot requested a review from hrishin October 9, 2019 13:32
@piyush-garg
Copy link
Contributor Author

/cc pradeepitm12

@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/start.go 92.0% 91.0% -1.0
pkg/cmd/task/start.go Do not exist 96.2%
pkg/helper/labels/mergelabels.go Do not exist 100.0%
pkg/helper/params/mergeparams.go Do not exist 100.0%
pkg/helper/pipeline/pipelinelastrun.go 84.6% 92.3% 7.7
pkg/helper/task/tasklastrun.go Do not exist 92.3%

@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

2 similar comments
@pradeepitm12
Copy link
Contributor

/test pull-tekton-cli-unit-tests

@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/start.go 90.9% 89.7% -1.2
pkg/cmd/task/start.go Do not exist 96.2%
pkg/helper/labels/mergelabels.go Do not exist 100.0%
pkg/helper/params/mergeparams.go Do not exist 100.0%
pkg/helper/pipeline/pipelinelastrun.go 84.6% 92.3% 7.7
pkg/helper/task/tasklastrun.go Do not exist 92.3%

This will add the feature of starting
a task or creating a taskrun from cli

Command will be like `tkn task start ..`

Add -i flag for input resources
Add -o flag for output resources
Add -p flag for param
Add -l flag for labels
Add --last flag for starting on basis of last run
Add -s flag for serviceaccount

Add docs and tests

Refactoring to remove duplicate code

Fix tektoncd#320
@tekton-robot
Copy link
Contributor

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

File Old Coverage New Coverage Delta
pkg/cmd/pipeline/start.go 90.9% 89.7% -1.2
pkg/cmd/task/start.go Do not exist 96.2%
pkg/helper/labels/mergelabels.go Do not exist 100.0%
pkg/helper/params/mergeparams.go Do not exist 100.0%
pkg/helper/pipeline/pipelinelastrun.go 84.6% 92.3% 7.7
pkg/helper/task/tasklastrun.go Do not exist 92.3%

@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

1 similar comment
@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

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
/cc @hrishin @chmouel

@@ -26,6 +26,8 @@ import (
"github.com/tektoncd/cli/pkg/cli"
"github.com/tektoncd/cli/pkg/cmd/pipelinerun"
"github.com/tektoncd/cli/pkg/flags"
"github.com/tektoncd/cli/pkg/helper/labels"
Copy link
Member

Choose a reason for hiding this comment

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

nit: I am not a huge fine of the helper package but it's already there, so can be changed in a follow-up anyway 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is required for both, start pipeline and start task so I put this in helper

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 17, 2019
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 Oct 18, 2019
@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

2 similar comments
@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

@piyush-garg
Copy link
Contributor Author

/test pull-tekton-cli-unit-tests

@tekton-robot tekton-robot merged commit 7426d83 into tektoncd:master Oct 18, 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Ability to Start Task Run via CLI
5 participants