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:
Merge request with changes and change applied:
How to set up and validate locally
Steps to reproduce bug
-
Checkout current
main
branch. -
Create a branch in a repo of your choice off of the main branch.
-
Create a Merge Request, confirm there is no changes in the MR.
-
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
-
Click on the Changes tab
- Make note of the fourth tab, the value changes from
0
toNaN
. - Changes
0
-> ChangesNaN
- Make note of the fourth tab, the value changes from
-
Repeat Step 2, but add a file to the branch.
-
Create a Merge Request, confirm there are changes in the MR
-
Open the Merge Request.
- Make note of the four tab values, Changes should be a number greater than 0
-
Click on the Changes tab
- Make note of the fourth tab, the value does not change
- Changes
0
-> ChangesNaN
Steps to confirm bug fix
- Checkout this branch
- 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.
-
I have evaluated the MR acceptance checklist for this MR.