feat: support AiAuthoringBundle metadata with dynamic handler resolution#1234
Merged
feat: support AiAuthoringBundle metadata with dynamic handler resolution#1234
Conversation
Owner
Author
AiAuthoringBundle metadataAiAuthoringBundle metadata
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 58 58
Lines 1544 1574 +30
Branches 194 204 +10
=========================================
+ Hits 1544 1574 +30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add `adapter` and `decomposition` optional fields to the Metadata Zod schema and persist them from SDR registry `strategies.adapter` and `strategies.decomposition` in `SDRMetadataAdapter.convertType()`. These fields carry SDR strategy information through the metadata pipeline, enabling downstream consumers (TypeHandlerFactory) to dynamically resolve handlers based on registry attributes instead of hardcoded mappings.
Replace the hardcoded 50-entry handlerMap with a multi-tier resolution chain that auto-resolves handlers from SDR metadata attributes: 1. Explicit overrides (handlerMap) — for types needing specialized behavior 2. inFolder — maps to InFolderHandler 3. adapter (bundle/mixedContent → InResource, digitalExperience → InBundle) 4. Child heuristics (xmlTag+key → Decomposed, folderPerType → CustomObjectChild) 5. InFile parent detection (parent with xmlTag+key children) 6. Fallback → StandardHandler This reduces the override map from 50 to 21 entries. New SDR metadata types are auto-resolved without code changes in most cases.
Update Stage 4 dispatch flow diagram to show multi-tier resolution chain. Add handler resolution tiers table. Document adapter and decomposition metadata fields. Update handler "Used by" lists to note auto-resolved types. Update extensibility guidance for new metadata types.
AiAuthoringBundle metadataAdd tests for deletion change type (line 84 ternary) and child type falling through both child heuristics to Standard (line 126 false branch). Mark xmlName guard in buildIndex as istanbul ignore since all real metadata entries always provide xmlName.
Remove defensive guard and istanbul ignore comment for xmlName in buildIndex. Since all metadata entries always have xmlName set (both SDR and internal registry provide it), use a non-null assertion instead. Also remove leftover investigation script (verify_resolution.js).
|
Published under $ sf plugins install sfdx-git-delta@dev-1234 |
Contributor
|
Hello, I just tested it and it works! The new metadata type is in the package.xml and the diff files are generated as well. Thanks |
|
Shipped in release $ sf plugins install sfdx-git-delta@latest-rc
# Or
$ sf plugins install sfdx-git-delta@v6.33.0💡 Enjoying sfdx-git-delta? |
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.
Explain your changes
Support
AiAuthoringBundlemetadata and introduce dynamic handler resolution from SDR registry attributes.Instead of hardcoding every metadata type → handler mapping,
TypeHandlerFactorynow auto-resolves handlers using a multi-tier chain:handlerMap) — for types needing specialized behavior (reduced from 50 to 21 entries)inFolder: true→InFolderHandleradapterfrom SDR strategies (bundle/mixedContent→InResource,digitalExperience→InBundle)xmlTag+key+ non-adapter parent →Decomposed, noxmlTag+folderPerTypeparent →CustomObjectChild)xmlTag+keychildren →InFile)StandardHandlerNew SDR metadata types (like
AiAuthoringBundle) are now handled automatically without code changes in most cases.Changes:
adapteranddecompositionfields to Metadata schema, persisted from SDRstrategiesTypeHandlerFactory.resolveHandler()with multi-tier dynamic resolutionDoes this close any currently open issues?
closes #1232
Any particular element that can be tested locally
Any metadata type with
strategies.adapterset tobundle,mixedContent, ordigitalExperiencein the SDR registry will now auto-resolve to the correct handler without needing an explicit entry inhandlerMap.Any other comments
The override map still handles types that need specialized behavior deviating from what SDR signals would suggest (e.g.,
Flow→FlowHandlerfor deletion warnings,CustomField→CustomFieldHandlerfor MasterDetail detection).