Skip to content

Handle null file size changes on change tab

What does this MR do and why?

This change fixes Bug #374090 (closed) when no files are changed in a Merge Request. parseInt() returns NaN when null is returned in the response. This Merge Request will default to 0 if parseInt() evaluates as a False value.

Screenshots or screen recordings

Merge request with no changes and change applied: image

Merge request with changes and change applied: image

How to set up and validate locally

Steps to reproduce bug

  1. Checkout current main branch.

  2. Create a branch in a repo of your choice off of the main branch.

  3. Create a Merge Request, confirm there is no changes in the MR.

  4. Open the Merge Request.

    • Make note of the four tabs: Overview 0, Commits 0, Pipelines 1, and Changes 0.
    • Changes is 0 on initial load
  5. Click on the Changes tab

    • Make note of the fourth tab, the value changes from 0 to NaN.
    • Changes 0 -> Changes NaN
  6. Repeat Step 2, but add a file to the branch.

  7. Create a Merge Request, confirm there are changes in the MR

  8. Open the Merge Request.

    • Make note of the four tab values, Changes should be a number greater than 0
  9. Click on the Changes tab

    • Make note of the fourth tab, the value does not change
    • Changes 0 -> Changes NaN

Steps to confirm bug fix

  1. Checkout this branch
  2. Repeat steps above, and confirm NaN does not appear in the tab header

MR acceptance checklist

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

Merge request reports