Skip to content

Fix: a0deploy keyword replacement mappings not applied to theme.json #1379

Open
ankita10119 wants to merge 1 commit intomasterfrom
DXCDT-1620
Open

Fix: a0deploy keyword replacement mappings not applied to theme.json #1379
ankita10119 wants to merge 1 commit intomasterfrom
DXCDT-1620

Conversation

@ankita10119
Copy link
Copy Markdown
Contributor

@ankita10119 ankita10119 commented May 7, 2026

Prior to this fix, keyword placeholder substitution (e.g. ##CDN_URL##) was silently skipped for theme assets during export. The root cause was that ThemesHandler did not declare an identifiers array, so the keyword-preservation logic - which uses identifiers to build dot-notation lookup paths for each array item - found no matching fields and returned the raw resolved remote URLs instead of preserving the original placeholders.

🔧 Changes

Added identifiers: ['themeId'] to the DefaultHandler options in ThemesHandler, aligning it with how other handlers expose their identifier field so that getPreservableFieldsFromAssets can correctly locate each theme record.

🔬 Testing

New unit tests added under describe('#themes keyword preservation') in test/tools/auth0/handlers/themes.tests.js:

  1. Positive case – verifies that when themeId is included in identifiers, keyword placeholders (e.g. ##CDN_URL##) in nested theme fields (fonts.font_url, widget.logo_url) are preserved after export.
  2. Regression case – verifies that when identifiers does not include themeId (the pre-fix state), placeholders are not preserved and raw URLs are returned, documenting exactly why the bug occurred.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@ankita10119 ankita10119 requested a review from a team as a code owner May 7, 2026 05:55
@ankita10119 ankita10119 changed the title Fix: a0deploy replacement mapping not working in theme.json file Fix: a0deploy keyword replacement mappings not applied to theme.json May 7, 2026
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.85%. Comparing base (406a6fc) to head (f126ae2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1379   +/-   ##
=======================================
  Coverage   79.85%   79.85%           
=======================================
  Files         153      153           
  Lines        7023     7023           
  Branches     1537     1537           
=======================================
  Hits         5608     5608           
  Misses        780      780           
  Partials      635      635           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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