backstage / backstage

Backstage is an open framework for building developer portals
https://backstage.io/
Apache License 2.0
26.61k stars 5.46k forks source link

🐛 Bug Report: Copying from from task log does not preserve newlines #24613

Closed brodo closed 1 week ago

brodo commented 2 weeks ago

📜 Description

When I try to copy more than one line from the task log, newlines are not preserved. (Tested in Safari and Chrome)

👍 Expected behavior

I should be able to copy the whole log text, including newlines.

👎 Actual Behavior with Screenshots

I get the entire log in one long line, including the line numbers.

Screenshot 2024-05-03 at 10 52 51

What I get out:

12024-05-02T15:08:47.220Z Beginning step Log Repo URL22024-05-02T15:08:47.234Z info: {3  "extra": {4    "host": "gitlab.i40.ifm-datalink.net, Opens in a new window",5    "owner": "software/dev-docs",6    "repo": "k6k8s"7  }8}92024-05-02T15:08:47.234Z Finished step Log Repo URL102024-05-02T15:08:47.235Z Beginning step Log Repo URL112024-05-02T15:08:47.239Z info: {12  "extra": {13    "USER_OAUTH_TOKEN": "[REDACTED]",14    "backstageToken": "[REDACTED]",15    "__initiatorCredentials": "REDACTED"16  }17}182024-05-02T15:08:47.239Z Finished step Log Repo URL192024-05-02T15:08:47.241Z Beginning step fetch:template202024-05-02T15:08:47.249Z info: Fetching template content from remote URL212024-05-02T15:08:47.604Z info: Listing files and directories in template222024-05-02T15:08:47.615Z info: Processing 1 template files/directories with input values {"description":"[REDACTED]","lifecycle":"production","name":"k6k8s","owner":"[REDACTED]","type":"application"}232024-05-02T15:08:47.657Z info: Writing file catalog-info.yaml.njk to template output path with mode 33188.242024-05-02T15:08:47.663Z info: Template result written to /tmp/5788c486-1ad5-443a-b640-5f93a565029d252024-05-02T15:08:47.666Z Finished step fetch:template262024-05-02T15:08:47.667Z Beginning step Create Merge Request

👟 Reproduction steps

  1. Run any template
  2. In the last screen of the wizard, try copying the whole log

📃 Provide the context for the Bug.

No response

🖥️ Your Environment

yarn backstage-cli info

OS:   Darwin 23.4.0 - darwin/x64
node: v18.13.0
yarn: 1.22.21
cli:  0.26.4 (installed)
backstage:  1.26.4

Dependencies:
  @backstage/app-defaults                                          1.5.4
  @backstage/backend-app-api                                       0.5.14, 0.7.1
  @backstage/backend-common                                        0.20.2, 0.21.7
  @backstage/backend-defaults                                      0.2.17
  @backstage/backend-dev-utils                                     0.1.4
  @backstage/backend-openapi-utils                                 0.1.10
  @backstage/backend-plugin-api                                    0.6.17
  @backstage/backend-tasks                                         0.5.22
  @backstage/catalog-client                                        1.6.4
  @backstage/catalog-model                                         1.4.5
  @backstage/cli-common                                            0.1.13
  @backstage/cli-node                                              0.2.5
  @backstage/cli                                                   0.26.4
  @backstage/config-loader                                         1.8.0
  @backstage/config                                                1.2.0
  @backstage/core-app-api                                          1.12.4
  @backstage/core-compat-api                                       0.2.4
  @backstage/core-components                                       0.13.10, 0.14.5
  @backstage/core-plugin-api                                       1.9.2
  @backstage/e2e-test-utils                                        0.1.1
  @backstage/errors                                                1.2.4
  @backstage/eslint-plugin                                         0.1.7
  @backstage/frontend-plugin-api                                   0.6.4
  @backstage/integration-aws-node                                  0.1.12
  @backstage/integration-react                                     1.1.26
  @backstage/integration                                           1.10.0
  @backstage/plugin-api-docs                                       0.11.4
  @backstage/plugin-app-backend                                    0.3.65
  @backstage/plugin-app-node                                       0.1.17
  @backstage/plugin-auth-backend-module-atlassian-provider         0.1.9
  @backstage/plugin-auth-backend-module-aws-alb-provider           0.1.9
  @backstage/plugin-auth-backend-module-azure-easyauth-provider    0.1.0
  @backstage/plugin-auth-backend-module-bitbucket-provider         0.1.0
  @backstage/plugin-auth-backend-module-cloudflare-access-provider 0.1.0
  @backstage/plugin-auth-backend-module-gcp-iap-provider           0.2.12
  @backstage/plugin-auth-backend-module-github-provider            0.1.14
  @backstage/plugin-auth-backend-module-gitlab-provider            0.1.14
  @backstage/plugin-auth-backend-module-google-provider            0.1.14
  @backstage/plugin-auth-backend-module-microsoft-provider         0.1.12
  @backstage/plugin-auth-backend-module-oauth2-provider            0.1.14
  @backstage/plugin-auth-backend-module-oauth2-proxy-provider      0.1.10
  @backstage/plugin-auth-backend-module-oidc-provider              0.1.8
  @backstage/plugin-auth-backend-module-okta-provider              0.0.10
  @backstage/plugin-auth-backend                                   0.22.4
  @backstage/plugin-auth-node                                      0.4.12
  @backstage/plugin-auth-react                                     0.1.1
  @backstage/plugin-catalog-backend-module-gitlab                  0.3.15
  @backstage/plugin-catalog-backend-module-scaffolder-entity-model 0.1.15
  @backstage/plugin-catalog-backend                                1.21.1
  @backstage/plugin-catalog-common                                 1.0.22
  @backstage/plugin-catalog-graph                                  0.4.4
  @backstage/plugin-catalog-import                                 0.10.10
  @backstage/plugin-catalog-node                                   1.11.1
  @backstage/plugin-catalog-react                                  1.11.3
  @backstage/plugin-catalog                                        1.19.0
  @backstage/plugin-events-node                                    0.3.3
  @backstage/plugin-home-react                                     0.1.12
  @backstage/plugin-home                                           0.7.3
  @backstage/plugin-org                                            0.6.24
  @backstage/plugin-permission-backend-module-allow-all-policy     0.1.14
  @backstage/plugin-permission-backend                             0.5.41
  @backstage/plugin-permission-common                              0.7.13
  @backstage/plugin-permission-node                                0.7.28
  @backstage/plugin-permission-react                               0.4.22
  @backstage/plugin-proxy-backend                                  0.4.15
  @backstage/plugin-scaffolder-backend-module-azure                0.1.9
  @backstage/plugin-scaffolder-backend-module-bitbucket-cloud      0.1.7
  @backstage/plugin-scaffolder-backend-module-bitbucket-server     0.1.7
  @backstage/plugin-scaffolder-backend-module-bitbucket            0.2.7
  @backstage/plugin-scaffolder-backend-module-gerrit               0.1.9
  @backstage/plugin-scaffolder-backend-module-gitea                0.1.7
  @backstage/plugin-scaffolder-backend-module-github               0.2.7
  @backstage/plugin-scaffolder-backend-module-gitlab               0.3.3
  @backstage/plugin-scaffolder-backend                             1.22.4
  @backstage/plugin-scaffolder-common                              1.5.1
  @backstage/plugin-scaffolder-node                                0.4.3
  @backstage/plugin-scaffolder-react                               1.8.4
  @backstage/plugin-scaffolder                                     1.19.3
  @backstage/plugin-search-backend-module-catalog                  0.1.23
  @backstage/plugin-search-backend-module-pg                       0.5.26
  @backstage/plugin-search-backend-module-techdocs                 0.1.22
  @backstage/plugin-search-backend-node                            1.2.21
  @backstage/plugin-search-backend                                 1.5.7
  @backstage/plugin-search-common                                  1.2.11
  @backstage/plugin-search-react                                   1.7.10
  @backstage/plugin-search                                         1.4.10
  @backstage/plugin-techdocs-backend                               1.10.4
  @backstage/plugin-techdocs-module-addons-contrib                 1.1.9
  @backstage/plugin-techdocs-node                                  1.12.3
  @backstage/plugin-techdocs-react                                 1.2.3
  @backstage/plugin-techdocs                                       1.10.4
  @backstage/plugin-user-settings                                  0.8.5
  @backstage/release-manifests                                     0.0.11
  @backstage/repo-tools                                            0.8.0
  @backstage/test-utils                                            1.5.4
  @backstage/theme                                                 0.4.4, 0.5.3
  @backstage/types                                                 1.1.1
  @backstage/version-bridge                                        1.0.8
✨  Done in 4.00s.

👀 Have you spent some time to check if this bug has been raised before?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

No, I don't have time to work on this right now

npiyush97 commented 1 week ago

@brodo can you help me to replicate i also tried to copy the log using copyclipboard provided by backstage. Im not getting line numbers and pasting in docs https://docs.google.com/document/d/1661jdbG_lh8ICTF4PIpCa6WUfTtia7QBv58NEQV25yg/edit?usp=sharing rendering alright. am i missing something ? picture for reference image

brodo commented 1 week ago

Thanks for looking into this! I did not know about the hidden copy buttons on the left, so I just selected the text using drag-and-drop. Also, it took me a while to figure out that once you have clicked on a like, you can shift-click on another one, and it copies the text. The UI could be improved to make it more discoverable, but that's more of a feature request than a bug, so I'm closing this ticket.

npiyush97 commented 1 week ago

Thanks for looking into this! I did not know about the hidden copy buttons on the left, so I just selected the text using drag-and-drop. Also, it took me a while to figure out that once you have clicked on a like, you can shift-click on another one, and it copies the text. The UI could be improved to make it more discoverable, but that's more of a feature request than a bug, so I'm closing this ticket.

Agree may be in future I or someone from the community make the icon visible on hover.