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

Restore faker for development environments #11786

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

eileen-nava
Copy link
Contributor

🛠 Summary of changes

Shane and I worked on this during our 1:1. The user mailer was broken because faker was missing. I included a screenshot of the error. We restored faker and the user mailer looks a-okay now.

📜 Testing Plan

👀 Screenshots

Error:

UserMailerBrokeDueToFaker

@eileen-nava eileen-nava requested review from mitchellhenke, a team and gina-yamada January 22, 2025 21:19
@eileen-nava eileen-nava changed the title Em sc/restore faker Restore faker for development environments Jan 22, 2025
@eileen-nava
Copy link
Contributor Author

Gemfile Outdated Show resolved Hide resolved
@@ -105,6 +105,7 @@ group :development, :test do
gem 'bullet', '~> 7.0'
gem 'capybara-webmock', git: 'https://github.com/hashrocket/capybara-webmock.git', ref: 'd3f3b7c'
gem 'erb_lint', '~> 0.7.0', require: false
gem 'faker'
Copy link
Contributor

@zachmargolis zachmargolis Jan 22, 2025

Choose a reason for hiding this comment

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

let's add an explicit require in the mailer preview too? or maybe a comment here noting why it's here?

Suggested change
gem 'faker'
gem 'faker', require: false # used in mailer previews

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the motivation making the bundle smaller, so that performance is improved? Or ensuring that faker doesn't mistakenly get removed from development in the future?
I'm not against the change, just want to be sure I understand the benefit.

Copy link
Contributor

Choose a reason for hiding this comment

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

the comment is to make sure it doesn't get removed in the future

the require: false is because we don't strictly need that in memory for our "normal" production flow so this just helps keep things small and explicit

Copy link
Contributor

Choose a reason for hiding this comment

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

Unless I'm misunderstanding something, moving from :test to the :development, :test group shouldn't impact production?

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.

4 participants