Skip to content

Artifacts page: Handle case where project statistics is null

What does this MR do and why?

Link to error in sentry (internal link)

In certain circumstances (such as when the user is not logged in), the result of a project statistics GraphQL query may not even have a statistics object. This MR handles that case by returning buildArtifactsSize as null so that we don't throw an error, and it adds a test for this case that would've failed before.

Screenshots or screen recordings

before with this MR
Screenshot_2023-05-02_at_14.58.58 no unhandled console errors

How to set up and validate locally

  1. git checkout master
  2. in a private browsing window, open your browser's devtools Console tab
  3. navigate to a project and choose CI/CD => Artifacts in the sidebar
  4. an error about buildArtifactsSize appears in the devtools Console tab
  5. git checkout artifacts-page-handle-when-project-statistics-is-null
  6. refresh the artifacts page
  7. the error should be gone

MR acceptance checklist

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

Edited by Miranda Fluharty

Merge request reports

Loading