Show validation error if link creation fails
What does this MR do?
It updates Issue and Epic link creation:
- we try to create all possible links - until now if one of created links failed we raised an exception. But because links creation is not in transaction (and can't be because of notes creation - this would require more refactoring), some links (before exception was raised) were created and some not. Now we don't raise an exception but rather to try create all possible links
- if any of link creation fails we return an error with a message about what links were not created and why
- links creation is idempotent - if issue link already exists we don't reacreate the link again (this behavior is unchanged)
Related to #219244 (closed)
Screenshots
Before: Missing error message why adding issues failed
After: The reason why an issue couldn't be added is displayed in the widget
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
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
Edited by Jan Provaznik