ruthst00 commented on PR #16452: URL: https://github.com/apache/grails-core/pull/16452#issuecomment-5935541644
Thank you @jdaugherty and @matrei for your feedback. Here's a summary of new changes: #### Commit https://github.com/apache/grails-core/pull/16452/changes/9688db1c3f6fb18b3a6b394285f54e7ebc968693 Documentation Changes Four documentation files now reflect the new `overrideToAddress` and `overrideFromAddress` mail plugin properties: 1. grails-doc/src/en/guide/mail/mailConfiguration.adoc — "Overriding Addresses" section documents all three properties with YAML examples and precedence rules. 2. grails-doc/src/en/guide/mail/mailTesting.adoc — "Using an Override Address" section was expanded into two sub-sections: "Overriding All Addresses" (the existing `overrideAddress`) and "Overriding Recipients and Sender Independently" (the new `overrideToAddress` / `overrideFromAddress`), each with a `application-test.yml` example. 3. grails-doc/src/en/guide/upgrading/upgrading80x.adoc — New section 80 covers the change for applications upgrading from Grails 7. 4. .agents/skills/grails-8-upgrade/SKILL.md — Concise checklist entry added for AI agents performing Grails 8 upgrades. @matrei, with regard to your comment: > If changing overrideAddress is intended instead, it needs to be described as a breaking change, with an entry in the 8.0 upgrade notes... Hopefully the changes to `upgrading80x.adoc` satisfy this requirement. Let me know if it doesn't and I'll fix it. #### Commit https://github.com/apache/grails-core/pull/16452/changes/8074a6ebd6524aa3b28b6f339442dd5e5f2bda0f Test Changes Three new Spock feature methods were added to `grails-mail/src/test/groovy/grails/plugins/mail/MailMessageBuilderSpec.groovy`, each pinning a previously untested behavioral decision in `MailMessageBuilder`: 1. **`"Test that overrideToAddress replaces cc and bcc recipients"`** — Confirms that `toDestinationAddresses()` is called for `cc()` and `bcc()` as well as `to()`, so `overrideToAddress` replaces every recipient address in all three fields, while `from` is left untouched. 2. **`"Test that overrideAddress overrides the explicit from address (backward-compatibility contract)"`** — Documents that when only `overrideAddress` is configured (no separate `overrideFromAddress`), it is promoted to `overrideFromAddress` in the constructor and therefore replaces an explicit `from` call in the DSL. This is the backward-compatibility contract that was previously implicit. 3. **`"Test that replyTo and envelopeFrom are not affected by overrideFromAddress or overrideAddress"`** — Explicitly asserts that `replyTo` and `envelopeFrom` pass through unchanged even when both `overrideAddress` and `overrideFromAddress` are set, making this a documented decision rather than an accident. (The `envelopeFrom` field is stored on the builder and applied at send time via `SMTPMessage`, so it is intentionally not subject to address overrides.) All 23 tests in `MailMessageBuilderSpec` pass, and `codeStyle` reports no violations for the module. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
