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

Show logs after task start #400

Merged
merged 2 commits into from
Nov 5, 2019
Merged

Conversation

piyush-garg
Copy link
Contributor

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

This will add the feature of showing logs after
starting the task by default

Adds aa flag to disable it

Add docs and refactoring

Fixes #368

This will fix the issue of taskrun log
throwing error if the pod name is
not yet available in status

This will wait for pod name to be
available in status for follow mode
till 10 secs

And in case of non follow mode it
will check whether pod name is there
or not

Adds test for the scenarios

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.

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 24, 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/start.go 96.2% 93.0% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@chmouel
Copy link
Member

chmouel commented Oct 25, 2019

/retest

@chmouel
Copy link
Member

chmouel commented Oct 25, 2019

This CI error seems legit,

@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/start.go 96.2% 93.0% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@danielhelfand
Copy link
Member

Make note of changes from #415 and #417 for start.go and start_test.go.

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@piyush-garg
Copy link
Contributor Author

/cc @chmouel @hrishin

@chmouel chmouel added this to the 0.5.0 🐱 milestone Oct 29, 2019
docs/cmd/tkn_task_start.md Show resolved Hide resolved
pkg/cmd/task/start.go Outdated Show resolved Hide resolved
pkg/cmd/taskrun/log_reader.go Outdated Show resolved Hide resolved
pkg/cmd/taskrun/log_reader.go Show resolved Hide resolved
@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.3% 2.0
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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/task/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.6% 2.3
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

This will add the feature of showing logs after
starting the task by default

Adds aa flag to disable it

Add docs and refactoring

Fixes tektoncd#368
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 Nov 4, 2019
Copy link
Member

@hrishin hrishin left a comment

Choose a reason for hiding this comment

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

A couple of comments otherwise looks good 👍

pkg/cmd/taskrun/log_reader.go Outdated Show resolved Hide resolved
pkg/cmd/taskrun/log_reader.go Show resolved Hide resolved
This will fix the issue of taskrun log
throwing error if the pod name is
not yet available in status

This will wait for pod name to be
available in status for follow mode
till 10 secs

And in case of non follow mode it
will check whether pod name is there
or not

Adds test for the scenarios
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Nov 5, 2019
Copy link
Member

@hrishin hrishin 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 Nov 5, 2019
@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielhelfand, hrishin

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 Nov 5, 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/start.go 96.3% 93.2% -3.2
pkg/cmd/taskrun/log_reader.go 83.3% 85.6% 2.3
pkg/cmd/taskrun/logs.go 91.7% 92.3% 0.6

@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

@tekton-robot tekton-robot merged commit e0d2ecd into tektoncd:master Nov 5, 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/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.

Start task and follow logs
7 participants