Fix user password reset mail template value #12882
Fix user password reset mail template value #12882erikbocks wants to merge 7 commits intoapache:4.22from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12882 +/- ##
============================================
+ Coverage 3.70% 17.60% +13.90%
- Complexity 0 15674 +15674
============================================
Files 448 5917 +5469
Lines 38041 531537 +493496
Branches 7038 64985 +57947
============================================
+ Hits 1409 93600 +92191
- Misses 36445 427382 +390937
- Partials 187 10555 +10368
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: GaOrtiga <[email protected]>
engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql
Outdated
Show resolved
Hide resolved
| SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' | ||
| WHERE value IN ( | ||
| 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\nhttp://{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team', | ||
| 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{domainUrl}}}{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' |
There was a problem hiding this comment.
agree to update the value if it has the previous defaults. ConfigDepot does not update value.
Co-authored-by: Suresh Kumar Anaparti <[email protected]>
engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Suresh Kumar Anaparti <[email protected]>
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17265 |
Description
The #11379 and #12078 PRs changed the user password email template, stored in the
user.password.reset.mail.templateconfiguration value. However, these changes were only made to the configuration's default value, and the database's configuration value was not changed. This caused environments that were deployed before the4.22.0.0release to face errors due to outdated configuration values, such as the duplicated HTTP protocol in the URL.This PR adds a step in the
4.22.0.0version to4.22.1.0version update script to update theuser.password.reset.mail.templateconfiguration value to the current value, if its current value matches one of the old defaults. The step changes the configuration's value only if the current value is one of the outdated default ones, keeping customized templates untouched.Old default templates
domainUrl:New default template
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
In an environment where the
user.password.reset.mail.templateconfiguration had thehttp://value, I manually executed the query to replace the configuration's value, and asserted that the value was changed accordingly. Then, I updated the configuration to the{{{domainUrl}}}outdated template, and manually executed the query one more time. The configuration's value was updated to the current template successfully.In order to test ACS' automatic update behavior, the query was inserted to the version update SQL file, and the packages with the changes were installed in an environment previous to the
4.22.1.0version. The correct behavior was observed for both of the outdated templates.With the environment updated in the previous step, a password reset email was sent, and I validated that the template was working properly.