Handle relative position on issue move or clone
What does this MR do?
This MR handles the relative position of an issue when it is moved or cloned to a new project. What happens is that if an issue in a project has a very high relative position, e.g. close to MAX_INT, and is being moved to a project where max(relative_position) of issues is low, all of sudden we create a very big gap and we end up with new issues being placed at the end of the new max(relative_position) which becomes very close to MAX_INT, which in return generates the #276483 (closed) issue.
With this change to ensure that if an issue is moved between projects within same group hierarchy we do not affect the relative position, so that the issue appears in the same place on the boards. However if issues is moved to a different hierarchy we reset the position and the issue will end up at the end of the relative position
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because _____.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team