Skip to content

Add attribution to external participant

Rajendra Kadam requested to merge 226995-author-attribution-external-user into master

What does this MR do and why?

Adds a column in the notes table to store the email addresses of the external participants. As of now, this column is used by the service desk for the external email addresses.

Changes frontend and backend to match the design set mentioned in #226995 (closed)

Adds specs for backend and frontend

This feature is behind a feature flag. See [Feature flag] Rollout of `external_note_author... (#408932 - closed).

Screenshots or screen recordings

This is how it looks on the UI.

Before

Screenshot_2023-04-18_at_11.03.46_AM

After

For user with atleast reporter permissions

Screenshot_2023-04-13_at_11.19.36_AM

For user with guest and below permissions if the issue is public

Screenshot_2023-04-19_at_10.27.42_AM

Migrations

UP
main: == 20230413045416 AddEmailParticipantColumnToNote: migrating ==================
main: -- add_column(:notes, :issue_email_participant, :text, {:null=>true, :default=>""})
main:    -> 0.0044s
main: == 20230413045416 AddEmailParticipantColumnToNote: migrated (0.0084s) =========

main: == 20230419062355 AddTextLimitToEmailParticipantInNotes: migrating ============
main: -- transaction_open?()
main:    -> 0.0000s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("ALTER TABLE notes\nADD CONSTRAINT check_469b8a1e9b\nCHECK ( char_length(email_participant) <= 255 )\nNOT VALID;\n")
main:    -> 0.0040s
main: -- execute("SET statement_timeout TO 0")
main:    -> 0.0002s
main: -- execute("ALTER TABLE notes VALIDATE CONSTRAINT check_469b8a1e9b;")
main:    -> 0.0012s
main: -- execute("RESET statement_timeout")
main:    -> 0.0002s
main: == 20230419062355 AddTextLimitToEmailParticipantInNotes: migrated (0.1123s) ===
DOWN
main: == 20230419062355 AddTextLimitToEmailParticipantInNotes: reverting ============
main: -- transaction_open?()
main:    -> 0.0000s
main: -- transaction_open?()
main:    -> 0.0000s
main: -- execute("            ALTER TABLE notes\n            DROP CONSTRAINT IF EXISTS check_469b8a1e9b\n")
main:    -> 0.0035s
main: == 20230419062355 AddTextLimitToEmailParticipantInNotes: reverted (0.1843s) ===

main: == 20230413045416 AddEmailParticipantColumnToNote: reverting ==================
main: -- remove_column(:notes, :issue_email_participant, :text, {:null=>true, :default=>""})
main:    -> 0.0020s
main: == 20230413045416 AddEmailParticipantColumnToNote: reverted (0.0088s) =========

How to set up and validate locally

  1. Setup Service desk by following the steps mentioned in setup doc.
  2. Create an issue using the service desk email.
  3. Copy the reply-to email address from the letter opener.
  4. Send an email to the above address and see your email as comment author and match the design mentioned in the linked issue and screenshot.

MR acceptance checklist

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

Related to #226995 (closed)

Edited by Peter Leitzen

Merge request reports