Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce B2B Notification Template Inheritance #291

Merged

Conversation

dhaura
Copy link
Contributor

@dhaura dhaura commented Dec 5, 2024

Purpose

  • This PR introduces notification template inheritance across b2b organization hierarchies. Therefore, if no template/s is configured for a given orgnizaition or application, it can inherit the template/s configured in its nearest ancestor organization within its organization hierarchy. If none found within the hierarchy, it will fall back to the system default templates.

Related Issues

Related PRs

pom.xml Outdated Show resolved Hide resolved
AnuradhaSK
AnuradhaSK previously approved these changes Dec 5, 2024
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 17.68293% with 135 lines in your changes missing coverage. Please review.

Project coverage is 32.69%. Comparing base (336a292) to head (6d3e859).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
...carbon/email/mgt/store/UnifiedTemplateManager.java 20.31% 98 Missing and 4 partials ⚠️
...so2/carbon/email/mgt/EmailTemplateManagerImpl.java 14.28% 17 Missing and 1 partial ⚠️
...bon/email/mgt/NotificationTemplateManagerImpl.java 0.00% 12 Missing ⚠️
...rg/wso2/carbon/email/mgt/EmailTemplateManager.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #291      +/-   ##
============================================
- Coverage     33.10%   32.69%   -0.41%     
+ Complexity      482      478       -4     
============================================
  Files            72       72              
  Lines          4616     4683      +67     
  Branches        576      614      +38     
============================================
+ Hits           1528     1531       +3     
- Misses         2933     2997      +64     
  Partials        155      155              
Flag Coverage Δ
unit 16.24% <17.68%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12231458666

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12231458666
Status: failure

@dhaura
Copy link
Contributor Author

dhaura commented Dec 9, 2024

Unit Tests

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12232134741

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12232134741
Status: failure

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12233779495

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12233779495
Status: failure

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12233912893

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12233912893
Status: failure

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12250150974

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12250150974
Status: failure

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12253354132

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12253354132
Status: cancelled

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12253415169

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12253415169
Status: failure

@dhaura
Copy link
Contributor Author

dhaura commented Dec 10, 2024

  • PR builder fails here with the following two test cases.
 2024-12-10T11:30:35.7633864Z [ERROR] Tests run: 2937, Failures: 2, Errors: 0, Skipped: 10

 [ERROR] Run 1: EmailTemplatesPositiveTest.testAddEmailTemplateType:192 1 expectation failed.
 Expected status code <201> but was <409>.
 
 [ERROR] Run 2: EmailTemplatesPositiveTest.testAddEmailTemplateType:192 1 expectation failed.
 Expected status code <201> but was <409>.
  • The reason behind this issue is due to template existence check in EmailTemplateManagerImpl returns resolved template existence by default. It says that the template already exists when adding application templates since the org-level template is already available.
  • In order to retrieve the unresolved template existence the new existence check should be called with resolve param set to false. This is fix is done to the API layer through Introduce B2B Resolving Capabilities to Email/SMS Template Mgt APIs wso2/identity-api-server#755.
  • Locally, all notification template management integrations were run with the fix mentioned in the above PR. All tests were passed as mentioned below.
Screenshot 2024-12-10 at 15 23 49

Template_mgt_TestNG_ Integration Test.pdf

@dhaura
Copy link
Contributor Author

dhaura commented Dec 10, 2024

@AnuradhaSK AnuradhaSK merged commit 10ec05e into wso2-extensions:master Dec 10, 2024
3 of 4 checks passed
@dhaura
Copy link
Contributor Author

dhaura commented Dec 10, 2024

PR builder is successful - wso2/product-is#21999 (comment)

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