WIP: [POC] Create DB tables for storing mentioned users
What does this MR do?
Creates DB tables for storing mentioned users, groups, projects referenced in a note(for issue, epic, merge requests, commit or snippet), issue, epic, merge request description issuable description
All 5 tables are very similar so I will take issue_user_mentions
as an example.
We would store all mentions for a given issue in this table by parsing issue description and issue notes.
-
issue_id
- is always non null. -
note_id
- is only null if users, projects or groups were mentioned in issue description. We neednote_id
field mainly to be able to update mentions when note is being updated or deleted. -
user_id
- stores mentioned user ID. -
project_id
- stores mentioned project ID. It will get expanded to all project members when a new notification for given issue needs to be sent out. -
group_id
- stores mentioned group ID. It gets expanded to all group members when a new notification for the given issue needs to be sent out.
So for any given issue can have something like:
issue_id | note_id | user_id | project_id | group_id | ---- |
---|---|---|---|---|---|
1 | null | 1 | null | null | |
1 | null | 2 | null | null | |
1 | null | null | 1 | null | |
1 | null | null | 2 | null | |
1 | null | null | null | 1 | |
1 | null | null | null | 2 | |
1 | 1 | 1 | null | null | |
1 | 1 | 2 | null | null | |
1 | 1 | null | 1 | null | |
1 | 1 | null | 2 | null | |
1 | 1 | null | null | 1 | |
1 | 1 | null | null | 2 |
Having this structure helps us easily get the list of directly mentioned users, list of mentioned projects which can then be joined with project members to get the list of users, as well as list of mentioned groups for one or multiple issues.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance 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
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
Closes #21800 (closed)