Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailer: Email to announce MFA is required for maintainers of gems with 180M+ downloads #3171

Merged
merged 7 commits into from
Aug 16, 2022

Conversation

bettymakes
Copy link
Contributor

@bettymakes bettymakes commented Aug 10, 2022

🤷‍♀️ What problem are you solving?

Contributes to https://github.com/Shopify/ruby-conventions/issues/137
Closes #3165

We need to send out an email on August 15, 2022 to notify maintainers of gems with 180M+ downloads that MFA enforcement is now in effect. Similar to the reminder email, this mailer continues with a targeted approach. It's only being sent to impacted users who have not yet enabled MFA (disabled), or have weak MFA enabled (ui_only).

📋 How will you solve this?

🔹 Create a mailer

  • Adds a mailer action mfa_required_popular_gems_announcement and a mailer view in both HTML and plain text formats
  • Note that there are minor copy variations dependent on a user's MFA status:
    • If the user does not have MFA enabled at all (disabled)
    • If the user has MFA enabled (ui_only)

🔹 Add rake task for delivering the email

  • This will be the task that the RubyGems Team will run on August 15, 2022 to send out this announcement
  • Task to be run: rake mfa_policy:announce_enforcement_for_popular_gems

🔹 Set up mailer preview

  • So we can more easily tophat and preview the email in both HTML and plain text, I've set up a mailer preview

🎩 Tophat instructions / Acceptance Testing

Below are the instructions for trying this out yourself:

📧 To preview the email:

  • Once you have the app running (rails s) ...
  • You can navigate to (http://localhost:3000/rails/mailers) to review the list of all mailers available for preview
    • To view this mailer, click on the link titled: mfa_required_popular_gems_announcement
  • The mailer for this PR is located at http://localhost:3000/rails/mailers/mailer/mfa_required_soon_announcement

👤 To change the user:

  • The user is configured on the mailer preview based on MailerPreview#mfa_required_popular_gems_announcement.
    • To change the user to verify various MFA states, you can either replace User.last.id with a different user (e.g. User.first)
    • Alternatively, you can adjust the MFA status on your last user

👀 Email versions

🚫 Email for users with MFA disabled

Email for users with MFA disabled - HTML format Email for users with MFA disabled - Plain text format

🤞 Email for users with MFA enabled (ui_only) -- weak MFA

Email for users with MFA enabled set to ui_only - HTML format Email for users with MFA enabled set to ui_only - Plain text format

@bettymakes bettymakes force-pushed the mfa-mailer-phase3-launch branch 2 times, most recently from 4180e88 to 1114743 Compare August 11, 2022 03:56
app/mailers/mailer.rb Outdated Show resolved Hide resolved
@bettymakes bettymakes marked this pull request as ready for review August 11, 2022 04:07
Copy link
Contributor

@jchestershopify jchestershopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question, but otherwise LGTM.

lib/tasks/mfa_policy.rake Outdated Show resolved Hide resolved
Rake task triggers a mailer which will be sent to users
who are owners of at least one gem with 180M+ downloads,
and have not yet enabled MFA, or have MFA set to 'ui_only'.
@bettymakes bettymakes force-pushed the mfa-mailer-phase3-launch branch 2 times, most recently from d2f92c5 to 0302581 Compare August 12, 2022 06:28
Copy link
Member

@jenshenny jenshenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tophatted both email copies and they look good to me!

app/mailers/mailer.rb Outdated Show resolved Hide resolved
@bettymakes bettymakes force-pushed the mfa-mailer-phase3-launch branch 6 times, most recently from cc20270 to d3fe58f Compare August 15, 2022 04:51
app/helpers/mailer_helper.rb Outdated Show resolved Hide resolved
app/models/mfa_copy/required_popular_gems.rb Outdated Show resolved Hide resolved
app/models/mfa_copy/required_soon.rb Outdated Show resolved Hide resolved
Extract conditional strings to a helper. This resolves Code Climate
violation on repetitive code blocks and tidies up the mailer actions.
Per Aditya:
> It is not clear what will be further disruptions.
> Disabling these operations was the final thing.
@bettymakes bettymakes force-pushed the mfa-mailer-phase3-launch branch from d3fe58f to 5f0d130 Compare August 15, 2022 06:32
@bettymakes bettymakes requested a review from sonalkr132 August 15, 2022 06:33
@sonalkr132 sonalkr132 merged commit 7c53adf into rubygems:master Aug 16, 2022
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to staging August 16, 2022 01:58 Inactive
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to production August 16, 2022 02:04 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a mailer to announce the MFA requirement policy is in effect
4 participants