Store abuse report labels separate from project/group labels
-
Review changes -
-
Download -
Patches
-
Plain diff
Context
This MR implements a part of https://gitlab.com/gitlab-org/gitlab/-/issues/430957+ and is MR no. 3 of 3:
- Move base label behavior to a concern
- Create AbuseReportLabelType GraphQL type
-
Store abuse report labels separate from project/group labels -
YOU ARE HERE
Gist of https://gitlab.com/gitlab-org/gitlab/-/issues/430957+
Abuse report labels are currently implemented as Label
s and stored in labels
DB table. Since these labels are for abuse reports they do not have a project_id
or a group_id
and should be under gitlab_main_clusterwide
schema (labels
is under gitlab_main_cell
).
The goal is to introduce a separate model and database table for abuse report labels so that both labels and abuse report labels features are compatible with Cells 1.0.
What does this MR do and why?
This MR introduces AntiAbuse::Reports::Label
and AntiAbuse::Reports::LabelLink
models backed by abuse_report_labels
and abuse_report_label_links
DB tables. It also updates the label_links
and labels
association of AbuseReport
to use these new models as follows:
Before
erDiagram
AbuseReport ||--o{ LabelLink : has_many
Label ||--o{ LabelLink : has_many
Label {
bigint group_id
bigint project_id
}
After
erDiagram
AbuseReport ||--o{ "AntiAbuse::Reports::LabelLink": has_many
"AntiAbuse::Reports::Label" ||--o{ "AntiAbuse::Reports::LabelLink" : has_many
Finally, Admin::AbuseReportLabel < Label
model is removed and all references to it are updated to use the new AntiAbuse::Reports::Label
model so abuse report labels records go to abuse_report_labels
table.
Questions
-
Do we need to migrate any abuse report label data from
labels
toabuse_report_labels
?No. The feature is currently not actively used by T&S and is behind a disabled feature flag. There is one abuse report record created in
labels
table in production that was created for testing and is planned to be deleted through a change request. -
What is the anticipated growth for the new table over the next 3 months, 6 months, 1 year? What assumptions are these based on?
Abuse report labels will be used by T&S team (instance admins) in Gitlab.com. There is no limit but with normal use we expect at most a few hundred (overestimate) records in this table.
-
How many reads and writes per hour would you expect this table to have in 3 months, 6 months, 1 year? Under what circumstances are rows updated? What assumptions are these based on?
We expect labels to be created in bulk or a few at a time and updated rarely (maybe update description, title, color). Reads will happen only when visiting the abuse reports list and abuse report show page.
-
Based on the anticipated data volume and access patterns, does the new table pose an availability risk to GitLab.com or self-managed instances?
No.
-
Does the proposed design scale to support the needs of GitLab.com and self-managed customers?
Yes.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screen_Recording_2024-10-17_at_11.41.24_AM
How to set up and validate locally
- In rails console, enable the feature flag
> Feature.enable(:abuse_report_labels)
- Login with an admin user (
root
) - Go to abuse reports page (http://localhost:3000/admin/abuse_reports) and click on any abuse report
- Validate that creating, searching, adding, and removing labels to the abuse report works (see screencast above).
Merge request reports
- version 18c2780e33
- version 17ee2c11f9
- version 165bcf13ea
- version 15b48709fe
- version 1493839a56
- version 1391764816
- version 12c082d8dd
- version 11b0783c76
- version 101d7e800e
- version 9df4b4b99
- version 84d0fe097
- version 750fef099
- version 6b402386b
- version 5733aed6a
- version 45553b136
- version 3ce723a12
- version 205dd041f
- version 13b3863d2
- master (base)
- latest versione6dd24721 commit,
- version 18c2780e331 commit,
- version 17ee2c11f91 commit,
- version 165bcf13ea1 commit,
- version 15b48709fe1 commit,
- version 1493839a565 commits,
- version 13917648164 commits,
- version 12c082d8dd4 commits,
- version 11b0783c763 commits,
- version 101d7e800e2 commits,
- version 9df4b4b991 commit,
- version 84d0fe0972 commits,
- version 750fef0991 commit,
- version 6b402386b1 commit,
- version 5733aed6a2 commits,
- version 45553b1364 commits,
- version 3ce723a124 commits,
- version 205dd041f4 commits,
- version 13b3863d23 commits,
- Side-by-side
- Inline
There are no changes yet
No changes between version 6 and version 6