Add screenshot field to report abuse form
What does this MR do and why?
- Partially resolves https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/159
- This MR will ask users to upload a screenshot of the abuse they are reporting while filling out the report abuse form. This field is optional
Screenshots or screen recordings
Uploading screenshot | capture-screenshot |
Accessing screenshot | access-screenshot |
Database Migrations
Output of db:migrate
Running: `bundle exec rake db:migrate:main`
main: == 20230315053635 AddScreenshotToAbuseReports: migrating ======================
main: -- add_column(:abuse_reports, :screenshot, :text, {:null=>false, :default=>""})
main: -> 0.0025s
main: == 20230315053635 AddScreenshotToAbuseReports: migrated (0.0126s) =============
main: == 20230327074932 AddTextLimitToAbuseReportsScreenshot: migrating =============
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute("ALTER TABLE abuse_reports\nADD CONSTRAINT check_4b0a5120e0\nCHECK ( char_length(screenshot) <= 255 )\nNOT VALID;\n")
main: -> 0.0009s
main: -- execute("SET statement_timeout TO 0")
main: -> 0.0004s
main: -- execute("ALTER TABLE abuse_reports VALIDATE CONSTRAINT check_4b0a5120e0;")
main: -> 0.0006s
main: -- execute("RESET statement_timeout")
main: -> 0.0004s
main: == 20230327074932 AddTextLimitToAbuseReportsScreenshot: migrated (0.0401s) ====
Output of db:rollback
Running: `bundle exec rake db:migrate:down:main VERSION=20230327074932`
main: == 20230327074932 AddTextLimitToAbuseReportsScreenshot: reverting =============
main: -- transaction_open?()
main: -> 0.0000s
main: -- transaction_open?()
main: -> 0.0000s
main: -- execute(" ALTER TABLE abuse_reports\n DROP CONSTRAINT IF EXISTS check_4b0a5120e0\n")
main: -> 0.0010s
main: == 20230327074932 AddTextLimitToAbuseReportsScreenshot: reverted (0.0189s) ====
Running: `bundle exec rake db:migrate:down:main VERSION=20230315053635`
main: == 20230315053635 AddScreenshotToAbuseReports: reverting ======================
main: -- remove_column(:abuse_reports, :screenshot, :text, {:null=>false, :default=>""})
main: -> 0.0020s
main: == 20230315053635 AddScreenshotToAbuseReports: reverted (0.0146s) =============
How to set up and validate locally
To report abuse
- Navigate to any issue
- Click on the
Issue Actions
>Report abuse to administrator
To check that the correct screenshot has been uploaded
- Get the URL of the screenshot uploaded from the rails console
% bundle exec rails c
> AbuseReport.last.screenshot_path
- Log in as
root
and access that URL
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Hinam Mehra