Skip to content

Add screenshot field to report abuse form

What does this MR do and why?

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

  1. Navigate to any issue
  2. Click on the Issue Actions > Report abuse to administrator

To check that the correct screenshot has been uploaded

  1. Get the URL of the screenshot uploaded from the rails console
% bundle exec rails c

> AbuseReport.last.screenshot_path
  1. 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.

Edited by Hinam Mehra

Merge request reports

Loading