Fix/ans spec compliance#34
Merged
Merged
Conversation
…set explicit PRIVATE visibility when @notification.customizable is absent
… and move to assemblers package
…ationTypeAutoProvisionerHandler
…d validation and ANS spec compliance
…Type re-provisioning to avoid ANS 400 rejection when existing type has Templates but new payload uses Translations, and align NotificationTemplate re-provisioning to use the same strategy for consistency
…cationType Translations instead of @notification.template.title, and throw on missing required annotation
…tionTemplate re-provisioning
…NotificationTemplate re-provisioning" This reverts commit 8590d10.
busehalis-sap
force-pushed
the
fix/ans-spec-compliance
branch
from
June 24, 2026 11:02
1a3c5b7 to
a98815b
Compare
…ranslations instead of embedded Templates
…s not part of the ANS API spec
…ingTest as DisplayName is no longer set
lisajulia
requested changes
Jun 25, 2026
lisajulia
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR :) please have a look at my findings!
…format, batch index, and email body rendering
…ForEvent as 'und' is not a valid ANS language code
…back to PATCH to eliminate infinite loop risk
…Ds stable instead of delete+create
… skipping update on 409
lisajulia
requested changes
Jun 30, 2026
lisajulia
left a comment
Contributor
There was a problem hiding this comment.
One last small change :)
…409 skip log message
lisajulia
approved these changes
Jun 30, 2026
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
This PR aligns the notification provisioning logic with the ANS API specification.
- NotificationType payload now uses Translations instead of embedded Templates: The ANS API requires Translations for user-facing display names and group titles. @notification.template.groupedTitle is now a required annotation, startup fails with a clear error if it is missing.
- NotificationTemplate re-provisioning uses delete+create strategy: Existing templates are deleted and recreated on startup to apply annotation changes. If delete fails, re-create is skipped and the template stays as-is until the next startup.
- Locale filtering per event: Translations are now built only for locales that have app-specific notification texts, filtering out framework-only locales (e.g. 37 languages from @sap/cds/common) that would produce duplicate English content.
- Explicit PRIVATE visibility on templates: When @notification.customizable is absent, PRIVATE is now set explicitly instead of relying on ANS default behavior.
- Null-safe production mode check: cds.environment.production.enabled now correctly defaults to local mode when the property is not configured (previously unboxing a null Boolean could cause a NullPointerException).
- System.out.println replaced with logger.info in LocalNotificationTypeAutoProvisionerHandler: local mode notification type logs now go through the standard logging framework instead of stdout.
- NotificationBuilderTest renamed to NotificationAssemblerTest and moved to assemblers package: the test class was testing NotificationAssembler, not a builder, so the name and location are now aligned with the class under test.