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

Making task logs interactive. #508

Merged

Conversation

16yuki0702
Copy link
Member

Changes

Related issue is #414

adding interactive menu to task logs.

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

task logs will be interactive

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 10, 2019
@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 the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 10, 2019
@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 Dec 10, 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/task/logs.go Do not exist 87.3%
pkg/helper/options/logs.go 80.0% 81.2% 1.2
pkg/helper/task/task.go Do not exist 81.8%

@pradeepitm12
Copy link
Contributor

/test pull-tekton-cli-unit-tests

opts := options.NewLogOptions(p)

eg := `
# interactive mode: shows logs of the selected task run
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# interactive mode: shows logs of the selected task run
# interactive mode: shows logs of the selected taskrun

# interactive mode: shows logs of the selected taskrun of the given task
tkn task logs task -n namespace

# show logs of given task for last run
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# show logs of given task for last run
# show logs of given task for last taskrun

tkn task logs task -n namespace --last

# show logs for given task and taskrun
tkn task logs task run -n namespace
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tkn task logs task run -n namespace
tkn task logs taskrun -n namespace

Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming that you went with this because of what is in pipeline logs, so feel free to change it there as well. Otherwise, we can get it in a follow up pr.

DisableFlagsInUseLine: true,
Short: "Show task logs",
Example: eg,
SilenceUsage: true,
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this is needed anymore since root.go has SilenceUsage: True, but no need to dig further in this pr. It might be something we should look into.

@16yuki0702
Copy link
Member Author

@danielhelfand
Thank you for review!!
I tried to fix the resource name to 'taskrun' only task files in this PR for now (not include pipeline files) 🙏
and remove unnecessary option 🙏

@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/task/logs.go Do not exist 87.3%
pkg/helper/options/logs.go 80.0% 81.2% 1.2
pkg/helper/task/task.go Do not exist 81.8%

@danielhelfand
Copy link
Member

@danielhelfand
Thank you for review!!
I tried to fix the resource name to 'taskrun' only task files in this PR for now (not include pipeline files) 🙏
and remove unnecessary option 🙏

I think you actually removed DisableFlagsInUseLine: true,. Sorry to do this, but let's keep DisableFlagsInUseLine: true, and SilenceUsage: true for now. I'll open an issue for this, and we could go about removing across the CLI.

@16yuki0702
Copy link
Member Author

@danielhelfand Oops... I'm so sorry why I deleted DisableFlagsInUseLine: true is just a my big mistake and misunderstanding 😇

I think you actually removed DisableFlagsInUseLine: true,. Sorry to do this, but let's keep DisableFlagsInUseLine: true, and SilenceUsage: true for now. I'll open an issue for this, and we could go about removing across the CLI.

But I got it, I added the DisableFlagsInUseLine: true again for now 🙏

@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/task/logs.go Do not exist 87.3%
pkg/helper/options/logs.go 80.0% 81.2% 1.2
pkg/helper/task/task.go Do not exist 81.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.

@16yuki0702 Thanks! Can you please squash your commits?

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 13, 2019
@16yuki0702
Copy link
Member Author

@danielhelfand

@16yuki0702 Thanks! Can you please squash your commits?

Thanks!! squashed 👍

@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/task/logs.go Do not exist 87.3%
pkg/helper/options/logs.go 80.0% 81.2% 1.2
pkg/helper/task/task.go Do not exist 81.8%

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 Dec 16, 2019
@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:

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 1eda03c into tektoncd:master Dec 16, 2019
@piyush-garg piyush-garg mentioned this pull request Dec 16, 2019
@16yuki0702 16yuki0702 deleted the making_task_logs_interactive branch December 17, 2019 02:18
piyush-garg added a commit that referenced this pull request Feb 3, 2020
#513 | [Daniel Helfand] update versions in README for 0.6.0 | 2019/12/12-02:36
#514 | [Chmouel Boudjnah] Add info in README about debian installs | 2019/12/12-04:27
#515 | [Chmouel Boudjnah] Change NFPM package name | 2019/12/12-04:44
#516 | [Chmouel Boudjnah] Fix install bash and zsh completion | 2019/12/13-04:55
#518 | [Chmouel Boudjnah] Tektoncd Release 0.9.2 | 2019/12/13-05:37
#508 | [16yuki0702] Making task logs interactive. | 2019/12/16-02:57
#517 | [Daniel Helfand] test for tkn task start --filename | 2019/12/16-03:11
#525 | [Jason Hall] Attempt to fix formatting of examples | 2019/12/18-09:07
#528 | [Chmouel Boudjnah] Set default to False for Show Logs on TaskRun and PipelineRun | 2019/12/18-10:11
#533 | [Daniel Helfand] show cancelled instead of failed for pr and tr desc | 2019/12/19-10:10
null | [Vincent Demeester] Switch to gotest.tools/v3 instead of testify 🐺 | 2019/12/20-04:44
null | [Vincent Demeester] Use ./hack/tools.go instead of dummy_test.go ⚓ | 2019/12/20-05:14
null | [Vincent Demeester] Bump github.com/imdario/mergo to 0.3.8 | 2019/12/20-05:33
null | [Chmouel Boudjnah] Add piyush as an OWNER 🕺 | 2019/12/20-08:04
null | [Piyush Garg] Add triggertemplate list | 2019/12/23-00:08
null | [Piyush Garg] Fix CI | 2019/12/23-10:09
null | [Daniel Helfand] remove namespace check for clustertask | 2019/12/23-10:38
null | [Piyush Garg] Add triggerbinding list | 2019/12/23-14:36
null | [Piyush Garg] Add eventlistener list | 2019/12/26-06:12
null | [Pradeep Kumar] Adds command to delete triggertemplate | 2019/12/26-21:38
null | [Daniel Helfand] converting taskrun desc tests to use step state test builder | 2019/12/27-00:24
null | [Pradeep Kumar] change test name | 2019/12/27-09:20
null | [Pradeep Kumar] Add command to delete triggerbinding | 2019/12/27-11:11
null | [Piyush Garg] Bump hashicorp/golang-lru | 2019/12/28-04:01
null | [Khurram Baig] Add Command to Remove EventListener | 2020/01/02-08:53
null | [Daniel Helfand] error message for using --last with tkn task start -f | 2020/01/02-09:39
null | [16yuki0702] Refactoring pipeline log tests. | 2020/01/02-09:51
null | [Daniel Helfand] updating release notes for CLI | 2020/01/06-07:22
null | [Daniel Helfand] add choco package to README and minor edits | 2020/01/06-08:17
null | [Piyush Garg] Refactor triggertemplate list test | 2020/01/07-00:29
null | [Chmouel Boudjnah] Syncronize cobra to latest | 2020/01/07-09:01
null | [Scott] Update all delete commands to support multiple arguments | 2020/01/08-13:02
null | [16yuki0702] Refactoring pipeline start tests. | 2020/01/09-07:56
null | [Daniel Helfand] add tkn task start -f with remote files | 2020/01/09-10:01
null | [Scott] Refactor delete command code to make a bit more DRY | 2020/01/10-02:49
null | [Daniel Helfand] add nil check for pr desc taskrun sorting | 2020/01/10-07:12
null | [Chmouel Boudjnah] Add coloured status condition | 2020/01/10-15:20
null | [Chmouel Boudjnah] Add colouring to steps status too | 2020/01/13-10:29
null | [Daniel Helfand] correct tkn task start typo | 2020/01/13-14:18
null | [Daniel Helfand] add tkn clustertask start | 2020/01/14-08:29
null | [Daniel Helfand] remove second taskrun from pr desc test | 2020/01/15-00:01
null | [Chmouel Boudjnah] Subtle cosmetics changes to describe command | 2020/01/15-09:58
null | [Chmouel Boudjnah] Show fluffy decorations only when we can or when the user wants it | 2020/01/15-09:58
null | [Chmouel Boudjnah] Fix release tarball version to remove the v at first | 2020/01/15-11:38
null | [Chmouel Boudjnah] Add Namespace to tkn pipeline desc | 2020/01/15-14:57
null | [Chmouel Boudjnah] Fix to auto select the first pipeline when only one is available | 2020/01/16-02:45
null | [Chmouel Boudjnah] Disable TestPipelineLog_Interactive | 2020/01/16-02:45
null | [Daniel Helfand] tkn create command | 2020/01/16-03:32
null | [Chmouel Boudjnah] Do not show bracket when showing the RunAfter.Tasks in Pipeline desc | 2020/01/16-04:07
null | [Chmouel Boudjnah] Set no colours automatically when not running with a tty or a pipe | 2020/01/16-16:33
null | [Chmouel Boudjnah] Skipping flakey interactive tests | 2020/01/17-07:42
null | [Vincent Demeester] Use golden package for unit test for Task 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test in TaskRun 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for Pipeline 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for PipelineRun 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for Condition 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for ClusterTask 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for TriggerBinding 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for TriggerTemplate 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for EventListener 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Use golden package for unit test for PipelineResource 🐐 | 2020/01/19-15:20
null | [Vincent Demeester] Add `test-unit-update-golden` target to update golden files 🐟 | 2020/01/19-15:20
null | [Chmouel Boudjnah] generate steps name when none has been provided | 2020/01/20-00:02
null | [Chmouel Boudjnah] Add tests for k8.Condition | 2020/01/20-04:27
null | [Daniel Helfand] add tkn clustertask desc | 2020/01/20-11:11
null | [Chmouel Boudjnah] Add emojis to pipeline/pipelinerun/task/taskrun describe | 2020/01/22-08:40
null | [Chmouel Boudjnah] tkn clustertask describe zsh completion is broken | 2020/01/22-12:21
null | [Chmouel Boudjnah] Add emojis support for tkn clustertask describe command | 2020/01/22-12:44
null | [Piyush Garg] Return error inspite of nil | 2020/01/23-08:28
null | [Chmouel Boudjnah] Implement output for pipeline describe | 2020/01/27-03:07
null | [Daniel Helfand] sort steps for tr desc by StartedAt | 2020/01/28-03:57
null | [Scott] Add flag to task and pipeline to only delete related resources | 2020/01/28-08:47
null | [Vincent Demeester] Remove 🏻 from the step emoji 🍲 | 2020/01/28-10:00
null | [Chmouel Boudjnah] Refactor a bit custom output function | 2020/01/28-10:57
null | [Chmouel Boudjnah] Fix PipelineResource custom output | 2020/01/28-10:57
null | [Chmouel Boudjnah] Fix PipelineRuns custom output | 2020/01/28-10:57
#648 | [Chmouel Boudjnah] Fix Task custom output | 2020/01/28-10:57
#648 | [Chmouel Boudjnah] Fix TaskRuns custom output | 2020/01/28-10:57
#648 | [Chmouel Boudjnah] Fix ClusterTask custom output | 2020/01/28-10:57
#643 | [Daniel Helfand] --dry-run option for tkn pipeline start | 2020/01/29-02:50
#653 | [Chmouel Boudjnah] Minor wording fixes on the RELEASE_PROCESS document | 2020/01/29-04:26
#656 | [Vincent Demeester] Use gotest.tools assert package instead of testify 🍵 | 2020/01/29-05:16
#657 | [Daniel Helfand] refactor --dry-run tests for tkn pipeline start | 2020/01/29-10:55
#661 | [Chmouel Boudjnah] Fix output=name for pipeline list | 2020/01/30-10:08
#658 | [Piyush Garg] Bump tektoncd/pipeline and tektoncd/triggers | 2020/01/31-03:37
null | [Piyush Garg] Fix workspace not getting copied with --last | 2020/01/31-04:34
null | [16yuki0702] This fixes #639 | 2020/01/31-06:46
null | [ansky] Remove extra empty lines | 2020/01/31-10:30
null | [Daniel Helfand] remove tkn create | 2020/01/31-10:52
null | [Daniel Helfand] add --dry-run option for tkn task start | 2020/02/03-00:59
null | [Daniel Helfand] add --dry-run option for tkn ct start | 2020/02/03-01:17
null | [16yuki0702] Fix overriding GenerateName on taskrun. | 2020/02/03-06:23

Signed-off-by: Piyush Garg <piyushgarg001@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. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants