console icon indicating copy to clipboard operation
console copied to clipboard

CONSOLE 3250: Configure default behavior for "Wrap lines" in log viewers

Open sg00dwin opened this issue 2 years ago • 14 comments

Add the ability to include a pod annotation console.openshift.io/wrap-log-lines which will default the log viewer to wrap log lines. https://issues.redhat.com/browse/CONSOLE-3250

@jhadvig @TheRealJon there is a consequence of this change. Since wrapLines is stored in local storage, if a user has selected to turn off wrap lines checkbox in the past and then views the log of a pod with the configured default wrap annotation, then this "wrapped" preference will persist to subsequent pod logs. Is this behavior acceptable?

cc @rhamilto

Example: The left side pod has console.openshift.io/wrap-log-lines annotation. On the right side, the pod wrap lines setting is unchecked. Once user has viewed left side pod logs with default wrap config, then subsequent pod log settings are switched to wrapped. setWrapLines-true-persists-to-other-pod-logs

sg00dwin avatar Sep 02 '22 15:09 sg00dwin

/retest

sg00dwin avatar Sep 08 '22 14:09 sg00dwin

The PR has been updated to check if the pod annotation console.openshift.io/wrap-log-lines: 'true' if so default log lines to wrapped. The wrap lines checkbox can be toggled off to unwrap lines. And the local storage preference is not effected.

sg00dwin avatar Sep 21 '22 19:09 sg00dwin

/assign @rhamilto

jhadvig avatar Sep 22 '22 09:09 jhadvig

Screencast showing local storage preference not changing when viewing pod with wraplines annotation. pod-annotation-log-wrap-local-storage

sg00dwin avatar Sep 27 '22 16:09 sg00dwin

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcaianirh, jhadvig, sg00dwin

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

openshift-ci[bot] avatar Sep 30 '22 14:09 openshift-ci[bot]

/label px-approved

RickJWagner avatar Sep 30 '22 14:09 RickJWagner

Not sure which qe person to tag, so adding Ya Dan /assign @yapei

jcaianirh avatar Oct 03 '22 19:10 jcaianirh

Docs approval: /assign @opayne1

jcaianirh avatar Oct 04 '22 20:10 jcaianirh

QE aprroval: 
/assign @zhigwang

jcaianirh avatar Oct 04 '22 20:10 jcaianirh

/assign @yanpzhan

jcaianirh avatar Oct 04 '22 21:10 jcaianirh

/label docs-approved

opayne1 avatar Oct 05 '22 11:10 opayne1

@sg00dwin after test the pr, I found pod with annotation "console.openshift.io/wrap-log-lines: 'false'" has the same behavior with pod without this annotation, is it expected? I've pasted new case link in jira issue, pls help to review, thanks!

yanpzhan avatar Oct 09 '22 08:10 yanpzhan

@sg00dwin after test the pr, I found pod with annotation "console.openshift.io/wrap-log-lines: 'false'" has the same behavior with pod without this annotation, is it expected? I've pasted new case link in jira issue, pls help to review, thanks!

@yanpzhan A pod with the annotation console.openshift.io/wrap-log-lines: 'false' would have the same behavior as a pod without the annotation. Only console.openshift.io/wrap-log-lines: 'true' should wrap the lines.

sg00dwin avatar Oct 17 '22 16:10 sg00dwin

@yanpzhan just checking to see if this has passed qe tests and is ready for qe-approved label. Thanks!

jcaianirh avatar Oct 18 '22 23:10 jcaianirh

@sg00dwin I didn't found issue when tested the pr again, and the checkpoints for the pr/US are added in new case, Could you help to review test case if there is checkpoint missed?

yanpzhan avatar Oct 24 '22 04:10 yanpzhan

@sg00dwin I didn't found issue when tested the pr again, and the checkpoints for the pr/US are added in new case, Could you help to review test case if there is checkpoint missed?

@yanpzhan the test cases are approved

sg00dwin avatar Oct 24 '22 14:10 sg00dwin

/label qe-approved

yanpzhan avatar Oct 24 '22 14:10 yanpzhan

/retest

rhamilto avatar Oct 24 '22 19:10 rhamilto

/retest

rhamilto avatar Oct 24 '22 20:10 rhamilto

@sg00dwin: all tests passed!

Full PR test history. Your PR dashboard.

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.

openshift-ci[bot] avatar Oct 24 '22 20:10 openshift-ci[bot]