Issue board list totalWeight integer out of bounds

Summary

The totalWeight, which is the sum of all issue's weight values, can exceed the GraphQL Integer type's maximum value. When this occurs:

  • BoardListCountEE operation receives a 500 error with Integer out of bounds: 2147483648 @ boardList.totalWeight (BoardList.totalWeight). Consider using ID or GraphQL::Types::BigInt instead.

  • UI elements that rely on the GraphQL operation do not render properly

Under limit Over limit
Screenshot_2023-06-26_at_10.33.25_am Screenshot_2023-06-26_at_10.33.09_am

Steps to reproduce

  1. Create a group and project in that group
  2. In the project, create an issue with a weight of 2147483647
  3. In the project, create another issue with a weight of 1
  4. Navigate to Plan > Issue boards

Example Project

https://gitlab.com/gitlab-gold/tmike/issue416218/issue416218/-/boards

What is the current bug behavior?

BoardListCountEE gets a 500 error and the total weight isn't displayed correctly in the UI

What is the expected correct behavior?

BoardListCountEE does not error and returns the total weight

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Michael Trainor