-
Notifications
You must be signed in to change notification settings - Fork 371
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
Comprehensive Update to Email Functionality (0.11.1-RC2) #291
Conversation
Fixes missing dep issue.
…P with BaseEmailer abstraction
…ings in pr_agent.toml
PR Description updated to latest commit (ba3579b) |
Questions to better understand the PR:
Please respond to the questions above in the following format:
|
/answer
|
And removes attic dupe
Includes a few modifications from the linter as well.
Type
Enhancement, Documentation, Other
This update introduces a significant overhaul to the email functionality within OneTimeSecret, alongside various configuration enhancements and code quality improvements. Key changes include:
pr_agent.toml
) for the Codium PR Agent, specifying model preferences, git provider, secret provider, and detailed configurations for PR review, description, questions, code suggestions, documentation addition, changelog updates, analysis, testing, checks, and GitHub integration settings.lib/onetime/email.rb
to support both SendGrid and SMTP emailers. This includes the creation of aBaseEmailer
class from whichSendGridEmailer
andSMTPEmailer
inherit, encapsulating the email sending logic and setup process. TheSendGridEmailer
class now includes detailed logging of the email sending process and error handling. TheSMTPEmailer
class is introduced with SMTP configuration and detailed logging of email delivery details.bin/smtp_test.rb
) to test SMTP configuration using environment variables defined in the.env
file..env.example
file to include new environment variables for SMTP testing and Redis configuration.lib/onetime.rb
andlib/onetime/logic.rb
to align with the refactored email functionality.Gemfile
, such asattic
, and updates to existing gem versions..rubocop.yml
configuration to enable new cops and specific checks for gemspec attributes and development dependencies.These changes aim to improve the flexibility, reliability, and maintainability of email functionality within OneTimeSecret, as well as to enhance the overall code quality and configuration management.
Changes walkthrough
onetime/email.rb:
Enhancement
Added debugging support and scoped SendGrid inclusion (1-7)Added 'byebug' for debugging and removed 'include SendGrid' from the global scope, likely moving it to a more localized scope within the codebase.
Refactor
Refactored email sending functionality with base and derived classes (14-33)Introduced a new base class
BaseEmailer
with abstract methodssend_email
andsetup
, and a derived classSendGridEmailer
that includesSendGrid
and implements these methods.Enhancement
Enhanced logging for SendGridEmailer (54-77)Enhanced
SendGridEmailer
with detailed logging for mailer responses including status code, body, parsed body, and headers.Enhancement
Added SMTP email sending functionality (78-124)Added a new class
SMTPEmailer
derived fromBaseEmailer
for sending emails using SMTP, including detailed logging for the mailer response.pr_agent.toml:
Enhancement
Added global configuration for Codium PR Agent (1-191)Introduced a new global configuration file for the Codium PR Agent, specifying various settings for model, git provider, secret provider, PR reviewer, description, questions, code suggestions, documentation, changelog updates, analysis, testing, checks, and GitHub integration.
bin/smtp_test.rb:
Enhancement
Added SMTP configuration test script (1-55)Added a new script for testing SMTP configuration using environment variables for SMTP settings and sending a test email.
lib/onetime.rb:
Refactor
Updated SMTP setup call to new SMTPEmailer (64)Changed the setup call from
OT::SMTP.setup
toOT::SMTPEmailer.setup
, reflecting the new SMTP emailer implementation..env.example:
Enhancement
Expanded .env.example with additional settings (1-28)Expanded the example environment variables file to include additional settings for app configuration, SMTP testing, and Redis.
onetime/logic.rb:
Refactor
Updated email delivery to use new parameter (473)Modified the email delivery call to use the new
OT::Email::SecretLink
parameter, aligning with changes in the email handling logic.Gemfile:
Refactor
Updated gem dependencies (12-16)Updated gem dependencies, adding 'attic' and adjusting versions for 'gibbler', 'redis', 'familia', and 'storable'.
.rubocop.yml:
Style
Updated RuboCop configuration (11-18)Updated RuboCop configuration to enable new cops and specific checks for gemspec attributes and development dependencies.