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

Bugfix/logf newline #57583

Merged
merged 1 commit into from Feb 22, 2018
Merged

Conversation

MorrisLaw
Copy link
Member

@MorrisLaw MorrisLaw commented Dec 23, 2017

What this PR does / why we need it:
Removes all redundant new lines being passed into the Logf() function. This involved going through code in both test/e2e and test/e2e_node, finding the newline redundancies in calls to Logf() and removing them.

Which issue(s) this PR fixes:
Fixes #57102

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed size/XS cncf-cla: yes needs-ok-to-test do-not-merge/hold labels Dec 23, 2017
@k8s-ci-robot k8s-ci-robot added release-note-none and removed do-not-merge/release-note-label-needed labels Dec 23, 2017
@dims
Copy link
Member

@dims dims commented Dec 24, 2017

/ok-to-test
/release-label-none

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test label Dec 24, 2017
@@ -259,6 +259,7 @@ func nowStamp() string {
}

func log(level string, format string, args ...interface{}) {
strings.TrimSuffix(format, "\n")
Copy link
Member

@ncdc ncdc Jan 2, 2018

Choose a reason for hiding this comment

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

This doesn't mutate format, but instead returns a new string with the suffix trimmed. You'll need to pass the returned value to fmt.Fprintf.

Copy link
Member

@timothysc timothysc Jan 2, 2018

Choose a reason for hiding this comment

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

Also, we shouldn't trim, vs. find and fix offenders in the logs.

Copy link
Member

@ncdc ncdc Jan 2, 2018

Choose a reason for hiding this comment

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

👍

Copy link
Member Author

@MorrisLaw MorrisLaw Jan 4, 2018

Choose a reason for hiding this comment

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

@timothysc can you clarify "find and fix offenders in the logs", I want to make sure I completely understand your review suggestion. Thank you! 😄

Copy link
Member

@ncdc ncdc Jan 4, 2018

Choose a reason for hiding this comment

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

He means we should go through all the e2e code and remove any trailing newlines from log statements.

Copy link
Member Author

@MorrisLaw MorrisLaw Jan 4, 2018

Choose a reason for hiding this comment

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

Thank you for the clarification @ncdc!

@@ -259,6 +259,7 @@ func nowStamp() string {
}

func log(level string, format string, args ...interface{}) {
strings.TrimSuffix(format, "\n")
Copy link
Member

@timothysc timothysc Jan 2, 2018

Choose a reason for hiding this comment

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

Also, we shouldn't trim, vs. find and fix offenders in the logs.

@k8s-ci-robot k8s-ci-robot added size/XXL size/L and removed size/XS size/XXL labels Jan 5, 2018
timothysc
timothysc previously requested changes Jan 5, 2018
Copy link
Member

@timothysc timothysc left a comment

Please squash your commits.

Also, I'm not certain all the newlines are redundant in your removal, some appear to be separators on purpose.

@k8s-github-robot k8s-github-robot added the needs-rebase label Jan 14, 2018
@MorrisLaw
Copy link
Member Author

@MorrisLaw MorrisLaw commented Feb 14, 2018

I've been pretty busy this past month. But I'm going to get working on this again. I'll be updating the PR soon, with your recommendations. Thank you @timothysc

@k8s-ci-robot k8s-ci-robot added size/XXL and removed size/L labels Feb 18, 2018
@k8s-ci-robot k8s-ci-robot added size/S and removed size/XXL needs-rebase labels Feb 18, 2018
@k8s-ci-robot k8s-ci-robot added size/XXL needs-rebase and removed size/S labels Feb 18, 2018
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Feb 18, 2018

@MorrisLaw: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gke-gci 8896103 link /test pull-kubernetes-e2e-gke-gci
pull-kubernetes-cross 510238e link /test pull-kubernetes-cross
pull-kubernetes-e2e-gke 510238e link /test pull-kubernetes-e2e-gke

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added size/S and removed size/XXL needs-rebase labels Feb 18, 2018
@timothysc timothysc dismissed their stale review Feb 21, 2018

out-of-date

@timothysc timothysc added ok-to-merge and removed do-not-merge/hold labels Feb 21, 2018
Copy link
Member

@timothysc timothysc left a comment

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 21, 2018
@k8s-ci-robot
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Feb 21, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MorrisLaw, timothysc

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

@k8s-ci-robot k8s-ci-robot added the approved label Feb 21, 2018
@k8s-github-robot
Copy link
Contributor

@k8s-github-robot k8s-github-robot commented Feb 22, 2018

Automatic merge from submit-queue (batch tested with PRs 60158, 60156, 58111, 57583, 60055). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 714b19e into kubernetes:master Feb 22, 2018
13 checks passed
@MorrisLaw MorrisLaw deleted the bugfix/logf-newline branch Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved cncf-cla: yes lgtm release-note-none size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants