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 delete taskrun command #238

Merged
merged 3 commits into from
Aug 30, 2019

Conversation

16yuki0702
Copy link
Member

Changes

Add deleting the taskrun feature for #193.

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.

Release Notes

you can delete taskrun from tkn.

@tekton-robot
Copy link
Contributor

Hi @16yuki0702. 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 Aug 24, 2019
@hrishin
Copy link
Member

hrishin commented Aug 26, 2019

/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 Aug 26, 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/taskrun/delete.go Do not exist 92.9%

@16yuki0702
Copy link
Member Author

/retest

@chmouel
Copy link
Member

chmouel commented Aug 28, 2019

same comment as #236 (comment) @16yuki0702 any chances we can have the same as #235, defaulting to ask if we really want to delete unless -f ?

@vdemeester vdemeester added this to the 0.3.0 🐱 milestone Aug 28, 2019
@16yuki0702 16yuki0702 force-pushed the add_delete_taskrun_command branch from 5667ffd to e17f61f Compare August 28, 2019 13:17
@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/taskrun/delete.go Do not exist 93.3%

@16yuki0702
Copy link
Member Author

/retest

1 similar comment
@chmouel
Copy link
Member

chmouel commented Aug 28, 2019

/retest

@chmouel
Copy link
Member

chmouel commented Aug 28, 2019

The CI error seems unreleated to your code, i have added an issue here tektoncd/pipeline#1252

@16yuki0702
Copy link
Member Author

The CI error seems unreleated to your code, i have added an issue here tektoncd/pipeline#1252

I got it, thanks!!

@16yuki0702
Copy link
Member Author

/retest

### Examples


# Delete a TaskRun of name 'foo' in namespace 'bar'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is no need to have a H1 for Delete a TaskRun of name 'foo' in namespace 'bar'.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for your review!!
another docs also have a H1 these. https://github.com/tektoncd/cli/blob/master/docs/cmd/tkn_resource_describe.md
I think we need make a rule about document format.
(after that, we need correct these!)

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree.

# Delete a TaskRun of name 'foo' in namespace 'bar'
tkn taskrun delete foo -n bar

tkn tr rm foo -n bar",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why there is a single "?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I didn't realize it, thanks!!
I should correct it together with other documents, so how about making another PR after this??

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool.

}

if err := cs.Tekton.TektonV1alpha1().TaskRuns(p.Namespace()).Delete(trName, &metav1.DeleteOptions{}); err != nil {
return fmt.Errorf("Failed to delete taskrun %q: %s", trName, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Error string should not be capitalized.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I found that there are a lot of Capitalized error (I run git grep fmt.Errorf)
I think It depends on project rule (if we really need to make it).
how about ??

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I didn't know it, thank you very much!!
I should correct it at least my PR 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Fix it !! thanks 👍

Copy link
Member

@chmouel chmouel Aug 29, 2019

Choose a reason for hiding this comment

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

Interesting that golangci doesnt pick this up, i have created #248

func deleteTaskRun(s *cli.Stream, p cli.Params, trName string) error {
cs, err := p.Clients()
if err != nil {
return fmt.Errorf("Failed to create tekton client")
Copy link
Contributor

Choose a reason for hiding this comment

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

Error string should not be capitalized.

if t == "y" {
break
} else if t == "n" {
return fmt.Errorf("Canceled deleting taskrun %q", trName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Error string should not be capitalized.

@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/taskrun/delete.go Do not exist 93.3%

@chmouel
Copy link
Member

chmouel commented Aug 29, 2019

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 16yuki0702, khrm, 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 Aug 30, 2019
@tekton-robot tekton-robot merged commit c7a67c0 into tektoncd:master Aug 30, 2019
@16yuki0702 16yuki0702 deleted the add_delete_taskrun_command branch August 31, 2019 10:13
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

8 participants