chore: add TODO.md to .gitignore to prevent tracking of temporary files - #1
Merged
Conversation
Reviewer's GuideAdds comprehensive tests and integration infrastructure around SMTP, queue, templates, config loading, and the HTTP API; introduces Mailpit-based end-to-end tests, bumps the Rust toolchain/workspace version to 1.88, wires new dev-dependencies and CI env vars, and adds a CLAUDE.md/rust-toolchain configuration for contributors. Sequence diagram for Mailpit-based end-to-end email send testsequenceDiagram
actor Tester
participant MailifyAPI as mailify_api
participant Queue as mailify_queue
participant Smtp as mailify_smtp
participant MailpitSMTP as mailpit_smtp
participant MailpitHTTP as mailpit_http
Tester->>MailifyAPI: HTTP POST /mail/send
MailifyAPI->>Queue: enqueue MailJob in Postgres
activate Queue
Queue-->>MailifyAPI: ack enqueued
deactivate Queue
MailifyAPI-->>Tester: 202 Accepted
note over Queue,Smtp: Worker runtime picks up MailJob
Queue->>Smtp: build_message and send
Smtp->>MailpitSMTP: SMTP transaction (MAIL FROM, RCPT TO, DATA)
MailpitSMTP-->>Smtp: 250 OK
Smtp-->>Queue: job completed
Tester->>MailpitHTTP: HTTP GET /api/v1/messages
MailpitHTTP-->>Tester: JSON with delivered message
Tester->>Tester: assert subject, recipients, headers
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
- Bump Rust version from 1.80 to 1.88 in Cargo.toml and Dockerfile. - Update Cargo.lock with new dependencies: reqwest and urlencoding. - Add integration tests for end-to-end email sending via Mailpit. - Implement tests for job serialization and SMTP override behavior. - Enhance existing tests for template rendering and configuration loading. - Introduce CLAUDE.md for developer guidance on repository usage.
Owner
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The config and mailpit-related helper functions (
smtp_host,mailpit_api,mailpit_reachable, env URL builders, mailpit purge/search loops) are duplicated across multiple test crates; consider extracting them into a shared test utility module to keep behavior consistent and avoid drift. - In
mailify-config/tests/load.rs,clear_mailify_varsmutates the environment while iterating and wrapsset_var/remove_varinunsafe; it would be safer and clearer to first collect matching keys into a vector and then remove them using the safe APIs withoutunsafe. - The integration tests use hard-coded polling intervals and deadlines (e.g., 10–20s loops when checking Mailpit); consider centralizing these as constants or making them configurable via env vars so they can be tuned for CI stability versus local test speed.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The config and mailpit-related helper functions (`smtp_host`, `mailpit_api`, `mailpit_reachable`, env URL builders, mailpit purge/search loops) are duplicated across multiple test crates; consider extracting them into a shared test utility module to keep behavior consistent and avoid drift.
- In `mailify-config/tests/load.rs`, `clear_mailify_vars` mutates the environment while iterating and wraps `set_var`/`remove_var` in `unsafe`; it would be safer and clearer to first collect matching keys into a vector and then remove them using the safe APIs without `unsafe`.
- The integration tests use hard-coded polling intervals and deadlines (e.g., 10–20s loops when checking Mailpit); consider centralizing these as constants or making them configurable via env vars so they can be tuned for CI stability versus local test speed.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add comprehensive integration and unit test coverage across core crates and wire them into CI using a standardized Rust toolchain version.
Enhancements:
Build:
CI:
Documentation:
Tests: