Skip to content

Pre-release 4.2.111 → 4.2.110 — task 2.16 mail swap (illuminate/mail v13) - #83

Merged
agissept merged 2 commits into
masterfrom
pre-release/4.2.111
Oct 1, 2026
Merged

agissept merged 2 commits into
masterfrom
pre-release/4.2.111

Conversation

@oonid

@oonid oonid commented Sep 30, 2026 •

Copy link
Copy Markdown

Task 2.16 — mail swap (illuminate/mail v13)

Moves illuminate/mail from replace to require ^13 (v13.34.0) and deletes the fork's Mail tree. Stacks on #82.

This departs from the plan. MIGRATION-TASKS has 2.16 add Mailable/PendingMail/SendQueuedMailable into the fork and swap mail later with foundation and auth in 4.5. Instead, this swaps mail on its own now, the same way the 4.3 per-unit swaps were done. That works because illuminate/mail v13 needs only:

  • components already on v13: container, contracts, support, collections, macroable, conditionable;
  • league/commonmark and tijsverkoyen/css-to-inline-styles.

It needs nothing from foundation or auth. After this, 4.5 is left with foundation, auth and exception.

Fork glue

  • Core aliases: mirror v13's mail cluster.
    • mail.manager → MailManager, Contracts\Mail\Factory.
    • mailer → Contracts\Mail\Mailer, Contracts\Mail\MailQueue.
    • SendQueuedMailable::handle() resolves the Factory contract, so a queued Mailable fails without it.
    • The Mail facade resolves mail.manager; the fork provider used to alias that to mailer.
  • Mail queued before the deploy: the fork's Mail::queue() pushed mailer@handleQueuedMessage jobs, and v13's Mailer has no such method.
    • The worker now registers a Mailer macro with that name, so jobs already on the queue still send after the deploy.
    • It is registered only when queue:work is built, in the same place as 4.2.109's exception-handler adapter.
  • Config: no change needed. v13's MailManager still reads the L4.2 layout (mail.driver plus top-level host/port/from/…) through its own backwards-compatibility path.

What changes for callers (handled in the app pair)

  • Mail::queue() and later() accept only a Mailable; anything else throws "Only mailables may be queued".
  • mail.pretend is gone; the log driver replaces it.
  • The mailer.sending string event becomes Illuminate\Mail\Events\MessageSending (plus MessageSent).
  • A string message builder (Mail::send($view, $data, 'Class'), which called Class::mail()) is no longer supported; closures still are.
  • The message callback now runs after the view is rendered.
  • Mail::send() returns ?SentMessage, and failures() / isPretending() are gone.

Deleted

  • src/Illuminate/Mail: Mailer, Message, SentMessage, MailServiceProvider, Transport\{Log,Array}Transport and composer.json. v13 ships the same classes.
  • The vendored tests/Mail/{MailMailerTest,MailMessageTest}.

Tests

  • tests/Mail/MailForkBridgeTest has 5 tests:
    • the aliases;
    • the L4.2 config sending through its driver with the global from;
    • a Mailable queued on the sync queue is sent;
    • the macro is absent outside the worker;
    • a job in the old mailer@handleQueuedMessage format drains in the worker.
  • Removing the aliases, or the macro registration, turns the matching tests red.
  • AuthPasswordBrokerTest builds the v13 Mailer.
  • Ratchet: pagination_getters goes from 1 to 0 (its last match was in the fork Mail tree), and the baseline is regenerated.

Verification

  • Fork:
    • suite 315 green (22 vendored mail tests deleted, 5 added); ratchet green; composer validate OK;
    • the real composer.json (with rector) resolves: illuminate/mail v13.34.0, symfony/mailer v7.4.19;
    • no fork import points at a deleted class, and no fork class is shadowed; 114 fork classes still load from src/.
  • Downstream: the dicoding app pair dicoding-dev/dicoding#5954 (feature/platform/framework-4.2.111-rc1), with vendor installed exactly from its lock and a local SMTP sink on 127.0.0.1:1025 (deck's mail catcher address):
    • Psalm (full project, no cache): no errors.
    • Unit suite: 8468 green.
    • NotificationV2 (24), CourseCertificate (14), TechnicalProblemMailerBoringTest, FatalErrorNotificationTest, InviteDevelopersTest (5) and BeanstalkdQueueBoringTest against a real worker (3): green.
    • Mail sent through the SMTP transport uses the L4.2 config and the global from.
    • On a real Beanstalkd worker:
      • a job queued in the old mailer@handleQueuedMessage format is delivered with its view data;
      • a queued ViewMail is delivered to both recipients.
    • artisan dailytask:notify delivers both pending-task mails.
    • Integration suite: all 2987 tests, run per directory with the SMTP sink: 5 failures, the same 5 as the 4.2.110 app branch in the same setup (its vendor also installed exactly from its lock). The 5 are three learning-notes views that get a null date, one tutorial-graduation expectation, and one upload-size check; none is mail-related. Earlier runs without a mail catcher had about 100 failures; with the sink, the mail-sending tests run end to end.
  • Checks ran in a cloud container without deck (PHP 8.4.26, MariaDB 10.11, deck's Asia/Jakarta timezone and max_connections).

Deploy notes

  • Restart the queue workers with the web deploy, or before it. A 4.2.110 worker can't run the SendQueuedMailable jobs that 4.2.111 queues, while a 4.2.111 worker runs both formats.
  • MAIL_PRETEND=true environments: the app pair maps it to the log driver.

Tag

4.2.111 on 6fdd45c0 is not pushed; tag pushes are refused for this session.

🤖 Generated with Claude Code

https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo

claude added 2 commits October 1, 2026 13:33
Move illuminate/mail from replace to require ^13 and delete the fork's
Mail tree (Mailer, Message, SentMessage, MailServiceProvider, Log/Array
transports), which v13 ships under the same names. illuminate/mail v13
depends only on components already swapped (container, contracts,
support, collections, macroable, conditionable), so it can go before
the foundation flip.

Fork glue:
- Core aliases mirror v13's mail cluster: mail.manager ->
  MailManager / Contracts\Mail\Factory, mailer -> Contracts\Mail\Mailer
  / MailQueue. SendQueuedMailable resolves the Factory contract, and
  the Mail facade resolves 'mail.manager' (the fork provider used to
  alias it to 'mailer').
- The worker registers a Mailer macro for 'mailer@handleQueuedMessage',
  so mail jobs queued by the fork's Mail::queue() before the deploy
  still send. Registered only when queue:work is built.

The app's L4.2-style mail config (mail.driver, host, port, from, ...)
keeps working through MailManager's own BC path. v13 drops mail.pretend,
the 'mailer.sending' string event (now MessageSending), string message
builders and queueing anything but a Mailable.

Tests: the vendored Mail tests are deleted; tests/Mail/MailForkBridgeTest
covers the aliases, the legacy config, a Mailable on the sync queue, the
worker-only macro and a pre-swap queued mail payload. The Auth broker
test builds the v13 Mailer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
The deleted fork Mail tree held the last pagination_getters match
(1 -> 0). Regenerate with ci/convergence-ratchet.sh --init src.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0169SsatCE8LhaTsQTPiGtVo
@agissept
agissept force-pushed the pre-release/4.2.111 branch from a5cd00d to 0a1912d Compare October 1, 2026 06:33
@agissept
agissept marked this pull request as ready for review October 1, 2026 06:33
@agissept
agissept merged commit 878cdca into master Oct 1, 2026
2 checks passed
@agissept
agissept deleted the pre-release/4.2.111 branch October 1, 2026 07:19
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.

3 participants