Skip to content

Add Abuse Reports Detail View

Alex Buijs requested to merge abuse-reports-detail-view into master

What does this MR do and why?

This adds the Abuse Report detail view.

Note that there is no path linking to this view, this will be handled in a followup.

Figma design

Issue: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/158+

Epic: https://gitlab.com/groups/gitlab-org/modelops/anti-abuse/-/epics/8+

Database

I introduced a new scope. Here's the Postgres.ai explanation with my user ID.

Raw SQL
SELECT
	mode()
	WITHIN GROUP (ORDER BY ip_address) AS ip_address
FROM
	"authentication_events"
WHERE
	"authentication_events"."user_id" = 4018056
LIMIT 1
Query plan
 Limit  (cost=6.67..6.68 rows=1 width=32) (actual time=42.477..42.480 rows=1 loops=1)
   Buffers: shared hit=31 read=31 dirtied=1
   I/O Timings: read=40.507 write=0.000
   ->  Aggregate  (cost=6.67..6.68 rows=1 width=32) (actual time=42.475..42.476 rows=1 loops=1)
         Buffers: shared hit=31 read=31 dirtied=1
         I/O Timings: read=40.507 write=0.000
         ->  Index Only Scan using index_authentication_events_on_user_and_ip_address_and_result on public.authentication_events  (cost=0.57..6.28 rows=155 width=9) (actual time=16.138..40.961 rows=95 loops=1)
               Index Cond: (authentication_events.user_id = 4018056)
               Heap Fetches: 1
               Buffers: shared hit=17 read=30 dirtied=1
               I/O Timings: read=39.513 write=0.000

Screenshots or screen recordings

Screen_Recording_2023-04-14_at_16.08.34

How to set up and validate locally

  1. Login as admin and go to a Profile, Issue, MR or an Issue/MR comment by another user and report them for abuse
  2. Get the ID of the just created abuse report by entering the following in the console: AbuseReport.last.id
  3. Visit http://localhost:3000/admin/abuse_reports/:id where id is the id fetched in the previous step

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alex Buijs

Merge request reports