argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.07k stars 5.53k forks source link

Copy/paste from logs UI does not preserve newlines in some editors #14019

Closed crenshaw-dev closed 1 year ago

crenshaw-dev commented 1 year ago

Describe the bug

When I click/drag to select logs in the logs UI, ctrl+c to copy, and then paste into an editor, newlines are gone.

Works for Mac's TextEdit, fails for IntelliJ.

To Reproduce

Do the above.

Expected behavior

Newlines are preserved.

Version

2.7.2

alexec commented 1 year ago

will you fix this, or do you need me to?

crenshaw-dev commented 1 year ago

I won't fix it any time soon. @ashutosh16 might try in the next month or two.

alexec commented 1 year ago

this is the kind of UI annoyance that really impacts a features usefulness, I will fix

alexec commented 1 year ago

Works for me on master:

image

alexec commented 1 year ago

This is a bug in v2.7.2.

2023-06-16T15:14:06+0000 WARN A warning that should be ignored is usually at this level and should be actionable.2023-06-16T15:14:07+0000 WARN A warning that should be ignored is usually at this level and should be actionable.2023-06-16T15:14:08+0000 INFO This is less important than debug log and is often used to provide context in the current task.2023-06-16T15:14:12+0000 INFO This is less important than debug log and is often used to provide context in the current task.2023-06-16T15:14:12+0000 ERROR An error is usually an exception that has been caught and not handled.2023-06-16T15:14:13+0000 INFO This is less important than debug log and is often used to provide context in the current task.2023-06-16T15:14:16+0000 DEBUG This is a debug log that shows a log that can be ignored.
crenshaw-dev commented 1 year ago

@alexec must be a line ending difference. Try pasting into an IntelliJ scratch window instead of TextEdit.

Another bug: "copy logs to clipboard" fails with "Cannot read properties of undefined (reading 'getData')" on first load of the logs window. Self-resolves after a couple minutes.

crenshaw-dev commented 1 year ago

@alexec I can reproduce it in latest here: https://cd.apps.argoproj.io/applications/argocd/argo-rollouts?view=tree&resource=&node=%2FPod%2Fargo-rollouts%2Fargo-rollouts-6bc46bcfd-4r5vp%2F0&tab=logs

alexec commented 1 year ago

So it depends where you paste it.

alexec commented 1 year ago

Just needs a new line:

2023-06-16T15:24:57+0000 DEBUG This is a debug log that shows a log that can be ignored.
2023-06-16T15:25:02+0000 DEBUG This is a debug log that shows a log that can be ignored.
2023-06-16T15:25:07+0000 INFO This is less important than debug log and is often used to provide context in the current task.
2023-06-16T15:25:07+0000 INFO This is less important than debug log and is often used to provide context in the current task.
alexec commented 1 year ago

PR created. Pls review.