Skip to content

Fix/ans spec compliance#34

Merged
busehalis-sap merged 28 commits into
mainfrom
fix/ans-spec-compliance
Jun 30, 2026
Merged

Fix/ans spec compliance#34
busehalis-sap merged 28 commits into
mainfrom
fix/ans-spec-compliance

Conversation

@busehalis-sap

@busehalis-sap busehalis-sap commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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.

@busehalis-sap
busehalis-sap requested a review from lisajulia June 23, 2026 14:22
@busehalis-sap
busehalis-sap force-pushed the fix/ans-spec-compliance branch from 1a3c5b7 to a98815b Compare June 24, 2026 11:02

@lisajulia lisajulia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR :) please have a look at my findings!

@busehalis-sap
busehalis-sap requested a review from lisajulia June 26, 2026 15:39

@lisajulia lisajulia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last small change :)

@busehalis-sap
busehalis-sap requested a review from lisajulia June 30, 2026 12:17
@busehalis-sap
busehalis-sap merged commit f8c2757 into main Jun 30, 2026
6 checks passed
@busehalis-sap
busehalis-sap deleted the fix/ans-spec-compliance branch June 30, 2026 13:01
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.

2 participants