feat: add waveBuildNotification user preference for build email notifications#1069
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create WaveBuildNotification enum with three constants (ALWAYS_ON, ON_ERROR, ALWAYS_OFF) and a defaultValue() method. Add comprehensive tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add nullable waveBuildNotification field to the User class to support storing build notification preferences as a deserialized enum from JSON. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add preference gate to MailServiceImpl.sendCompletionEmail: ALWAYS_OFF suppresses all notifications, ON_ERROR suppresses successful-build emails, null/ALWAYS_ON (default) preserves existing behaviour. Parametrized Spock test covers all 8 pref × outcome combinations using @MockBean(MailSpoolerImpl). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t files Move WaveBuildNotification import to the io.seqera.wave group in MailServiceImpl, and add AGPL license headers to WaveBuildNotificationTest and UserTest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t log Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Related Platform PR |
|
@claude please review with super powers |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review this PR with super powers. Also, we need to temporarily use Node 20, so set the ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true environment variable for the review CI/CD processes. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
- restore jakarta imports above static imports in MailServiceImpl - use request.buildId (not result.buildId which is '-' for unknown) in missing-recipient log line - simplify PlatformId construction in test using @canonical default args - bump copyright year on new files to 2023-2026 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Internal agent-generated planning/design docs — belong outside the repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Address review feedback on the waveBuildNotification preference: - Enable Jackson READ_UNKNOWN_ENUM_VALUES_AS_NULL so a waveBuildNotification value not (yet) known to Wave degrades to null (→ default ALWAYS_ON) instead of failing the entire Tower user-info deserialization. - Inline the ALWAYS_ON default and drop the redundant defaultValue() helper. - Document the new enum, the User field, and the mail gating logic. - Replace the tautology defaultValue test with one asserting unknown enum values deserialize to null. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review follow-up — addressed feedback (commit
|
Summary
WaveBuildNotificationenum (ALWAYS_ON,ON_ERROR,ALWAYS_OFF) to theio.seqera.wave.towerpackagewaveBuildNotificationfield to theUsermodel, deserialized from Tower's user-info JSON payloadMailServiceImpl.sendCompletionEmailon the user preference before sending email viaMailSpoolerBehaviour
null(default → Always On)null(default → Always On)ALWAYS_ONALWAYS_ONON_ERRORON_ERRORALWAYS_OFFALWAYS_OFFNull preference (older Tower clients that don't send the field) defaults to
ALWAYS_ON, preserving existing behaviour. The existingnoEmailsystem flag onBuildRequest(sub-build suppression) is unchanged and continues to take priority at theonBuildEventlevel.Test plan
WaveBuildNotificationTest— verifies 3 enum constants anddefaultValue()returnsALWAYS_ONUserTest— verifies field is nullable and stores enum valuesMailServiceImplTest— 8-row parametrized test covering every cell of the decision table above; uses@MockBean(MailSpoolerImpl)to assertsendMailcall countFollow-up (post-merge)
user, fallback toconfig.from) to confirm it also defaults toALWAYS_ON🤖 Generated with Claude Code