fix(cli-utilities): read aggregate globalfields.json in readGlobalFieldSchemas (DX-7312) - #2716
fix(cli-utilities): read aggregate globalfields.json in readGlobalFieldSchemas (DX-7312)#2716harshitha-cstk wants to merge 2 commits into
Conversation
…ldSchemas readGlobalFieldSchemas ignored the aggregate global_fields/globalfields.json and only read per-uid files, so aggregate-format exports returned 0 global fields. This caused the audit to strip all global-field references from content types, global fields to never import, and content-types/entries to fail with "The referenced Global Field does not exist" (plus image-preset data loss). Now prefer the aggregate globalfields.json when present and fall back to per-uid files, so both export formats load correctly. Shared by the audit and the import global-fields/content-types modules. Fixes DX-7312 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
What
readGlobalFieldSchemas()now reads the aggregateglobal_fields/globalfields.jsonwhen present, falling back to per-uid files.Why
The function ignored the aggregate
globalfields.jsonand only read per-uid files. For aggregate-format exports it returned 0 global fields, which cascaded:global_fieldreference from content types.This is the shared reader used by the audit and the import global-fields/content-types modules, so the single fix corrects all three consumers.
Investigation notes
extension_uidremapping (that works — verified same-org: apps install, mapper populated, 0 marketplace-extension errors).node bin/run-vs-csdx-specific: reproduced identically on2.0.0,2.0.0-beta.21,2.0.0-beta.28. The real variable is the export format (aggregate vs per-uid).Verification
Clean import of the ticket's export into an empty dev11 stack →
✅ IMPORT completed successfully, 0 errors; global fields / content types / entries all imported; extension + marketplace UID mappings applied.🤖 Generated with Claude Code