fix: preserve keyword markers in themes for default export configuration#1387
Open
ankita10119 wants to merge 1 commit into
Open
fix: preserve keyword markers in themes for default export configuration#1387ankita10119 wants to merge 1 commit into
ankita10119 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1387 +/- ##
==========================================
- Coverage 79.84% 79.84% -0.01%
==========================================
Files 153 153
Lines 7052 7056 +4
Branches 1547 1549 +2
==========================================
+ Hits 5631 5634 +3
Misses 781 781
- Partials 640 641 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
🔧 Changes
Fixes keyword preservation for themes when
AUTH0_EXPORT_IDENTIFIERSisfalse(the default configuration).Root cause:
ThemesHandlerusedidentifiers: ['themeId']to match local theme entries during keyword preservation. However,themeIdis stripped from exported files by default (AUTH0_EXPORT_IDENTIFIERS: false), so the preservation logic could never find a matching identifier and silently skipped preservation, causing keyword markerslike
##CDN_URL##to be overwritten with raw values on re-export.Changes:
ThemesHandler: AddeddisplayNameas a secondary identifier alongsidethemeId, providing a match path for users who have named their theme but do not useAUTH0_EXPORT_IDENTIFIERSgetPreservableFieldsFromAssetsinkeywordPreservation.ts:reduceto skip missing identifiers instead of resetting the accumulator, allowing multi-identifier fallback to work correctly📚 References
AUTH0_EXPORT_IDENTIFIERS: true)🔬 Testing
Unit tests added covering the following scenarios:
themeIdpresent in local file (AUTH0_EXPORT_IDENTIFIERS: true) - preserved viathemeIdidentifierdisplayNamepresent but notthemeId- preserved viadisplayNameidentifierthemeIdnordisplayNamepresent (default export, exact customer scenario) - preserved via positional index fallbackidentifiers: [](no identifiers registered for array type) - NOT preserved, confirming the fallback does not apply to unrecognized arraysManual end-to-end test:
AUTH0_PRESERVE_KEYWORDS: falsein config, run export to get a baselinetenant.yamltenant.yaml- replace raw URLs with quoted keyword markers e.g.font_url: '##CDN_URL##/fonts/custom.woff2'AUTH0_PRESERVE_KEYWORDS: true, re-run exporttenant.yamlstill contains##CDN_URL##markers instead of resolved URLs📝 Checklist