Skip to content

Fix broken CSV artifact rendering

What does this MR do and why?

This MR fixes broken CSV rendering on Artifact Browse page. Details are on #350581 (closed)

Screenshots or screen recordings

Here is example of error on Artifact with CSV file:

  • local GDK URL is http://localhost:3000/hpaluch/csv-artifact-bug/-/jobs/341/artifacts/file/test.csv

csv-viewer-artifact

How to set up and validate locally

Tip: you can see full example project on my personal namespace:

  1. Add any CSV file to your project, for example test.csv with content (see https://gitlab.com/hpaluch/csv-artifact-bug/-/blob/master/test.csv):

    HeaderA,HeaderB
    A,B
  2. Create simple CI job that will just pack test.csv as artifact (see https://gitlab.com/hpaluch/csv-artifact-bug/-/blob/master/.gitlab-ci.yml)

    test_bug:
      script:
        - cat test.csv
        - 'wc -l test.csv'
        - 'echo "Go to Artifact -> Browse and select test.csv"'
        - 'echo "You may see err \"Failed to render CSV file for...\""'
        - 'echo "See https://gitlab.com/gitlab-org/gitlab/-/issues/350581"'
      artifacts:
        paths:
          - test.csv
  3. Build project with CI

  4. Go to artifacts page, click on Browse and click on test.csv, for example try https://gitlab.com/hpaluch/csv-artifact-bug/-/jobs/3822836320/artifacts/file/test.csv

  5. You will see error like one below (screenshot is from latest GDK):

    csv-viewer-artifact

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #350581 (closed)

Merge request reports

Loading