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 taskrun logs interactive. #491

Merged

Conversation

16yuki0702
Copy link
Member

Changes

Related issue is #263

adding interactive menu to taskrun 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

taskrun 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 3, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 3, 2019
// See the License for the specific language governing permissions and
// limitations under the License.

package list
Copy link
Member Author

@16yuki0702 16yuki0702 Dec 3, 2019

Choose a reason for hiding this comment

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

I wanted to define it pkg/helper/taskrun/taskrun.go at first,
but pkg/helper/taskrun/taskrun.go already imported github.com/tektoncd/cli/pkg/cmd/taskrun to using taskrun's logreader, logwriter.

so this is a workaround to avoid cycle importing.
(I think it would be better extracting logreader, logwriter to common utility packages later!)

@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 3, 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/helper/options/logs.go 78.6% 80.0% 1.4
pkg/helper/taskrun/list/list.go Do not exist 87.5%

@16yuki0702
Copy link
Member Author

/retest

1 similar comment
@16yuki0702
Copy link
Member Author

/retest

@danielhelfand
Copy link
Member

danielhelfand commented Dec 3, 2019

@16yuki0702 Issues with integration tests are unrelated to your changes. We're digging into it now.

@danielhelfand
Copy link
Member

/test pull-tekton-cli-integration-tests

@@ -143,6 +172,9 @@ func TestLogOptions_Ask(t *testing.T) {
if opts.PipelineRunName != tp.want.PipelineRunName {
t.Errorf("unexpected PipelineRunName")
}
if opts.TaskrunName != tp.want.TaskrunName {
t.Errorf("unexpected TaskRunName")
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
t.Errorf("unexpected TaskRunName")
t.Errorf("Unexpected TaskRun name")

t.Run(tp.name, func(t *testing.T) {
got, err := GetAllTaskRuns(tp.params, metav1.ListOptions{}, 5)
if err != nil {
t.Errorf("unexpected Error")
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
t.Errorf("unexpected Error")
t.Errorf("Unexpected error")

}
} else {
if err != nil {
t.Errorf("unexpected Error")
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
t.Errorf("unexpected Error")
t.Errorf("Unexpected error")

prompt: htest.PromptTest{
CmdArgs: []string{},
Procedure: func(c *goexpect.Console) error {
if _, err := c.ExpectString("Select taskrun :"); err != nil {
Copy link
Member

@danielhelfand danielhelfand Dec 3, 2019

Choose a reason for hiding this comment

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

Suggested change
if _, err := c.ExpectString("Select taskrun :"); err != nil {
if _, err := c.ExpectString("Select taskrun:"); err != nil {

Can you remove the space before : and also in the associated code in Ask? There may also be other tests that are affected.

@16yuki0702
Copy link
Member Author

@danielhelfand

@16yuki0702 Issues with integration tests are unrelated to your changes. We're digging into it now.

Thank you for addressing it and reviews!
I fixed all of them 🙏

@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/helper/options/logs.go 78.6% 80.0% 1.4
pkg/helper/taskrun/list/list.go Do not exist 87.5%

@16yuki0702
Copy link
Member Author

/retest

@16yuki0702
Copy link
Member Author

/test pull-tekton-cli-unit-tests

@16yuki0702
Copy link
Member Author

Umm... where is error detail page 🤔
I run go test ./pkg/cmd/pipelineresource/ locally, but all tests are passed 🤔

@danielhelfand
Copy link
Member

@16yuki0702 The two unit tests that are failing are notoriously flaky running as part of the CI. We're going to be looking into the cause soon, but your changes aren't the issue.

/test pull-tekton-cli-unit-tests

@16yuki0702
Copy link
Member Author

@danielhelfand

@16yuki0702 The two unit tests that are failing are notoriously flaky running as part of the CI. We're going to be looking into the cause soon, but your changes aren't the issue.

Oh... I got it, thanks!!

@danielhelfand
Copy link
Member

/test pull-tekton-cli-unit-tests

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.

Thanks @16yuki0702!

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 4, 2019
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

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielhelfand, 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:
  • OWNERS [danielhelfand,vdemeester]

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 f9678c1 into tektoncd:master Dec 4, 2019
@16yuki0702 16yuki0702 deleted the make_taskrun_logs_interactive branch December 9, 2019 01:30
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.

5 participants