Updating Policy Scope may remove unrelated linked groups
Summary
Using the Policy Scope drop-down to add linked groups
Steps to reproduce
- Create a project / group and add a Security Policy
- Make sure there are enough linked to same SPP groups that the menu can be scrolled to load more items
- Add a group that would not be loaded by the initially-loaded list in linked grouped option in policy scope
- Update the policy
- Return to update policy again
- Toggle an item above the scroll
- Observe the YAML preview reflects the removal
Example Project
I recorded this issue being reproduced and have attached that as a confidential comment.
What is the current bug behavior?
The policy will be updated with previously-selected items removed
What is the expected correct behavior?
The only items changed should be the items that are deliberately changed.
Results of GitLab environment info
This was reproduced on GitLab.com ( GitLab Enterprise Edition 17.9.0-pre 94243d5e )
Possible fixes
If you can, link to the line of code that might be responsible for the problem.