Skip to content

Board scope shouldn't persist "-1" when one selects "Any weight" or "Any milestone"

Currently we persist -1 when selecting "Any weight" or "Any milestone" on https://docs.gitlab.com/ee/user/project/issue_board.html#board-with-configuration (Board#weight, Board#milestone_id). Ideally, a nil value should be enforced in that case.

The main reason why is consistency:

  • Issue#weight persists -1 for No Weight
  • Board#weight persists -1 for Any Weight (blank state)

In the latter, there's no reason to persist -1 at all as frontend doesn't send anything to backend whether the board.weight is nil or -1. Also, we end up maintaining two different values meaning the same thing in a column.

Additionally, the following migrations should take place:

update boards set weight = null where weight = -1
update boards set milestone_id = null where milestone_id = -1